Skip to content

Navigation: one model decides where every menu, app and control lives - #640

Merged
mmtr merged 3 commits into
trunkfrom
claude/navigation-architecture-redesign-3dbfb1
Aug 21, 2026
Merged

mmtr merged 3 commits into
trunkfrom
claude/navigation-architecture-redesign-3dbfb1

Conversation

@mmtr

@mmtr mmtr commented Aug 20, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #586

Proposed changes

Every navigable thing (WordPress admin menus, plugin menus, apps, OpenStation's own controls) collapses into one flat list of nav items in src/nav/, and computeNav() decides where each one shows up. The dock, the sidebar and the desktop render what it returns.

  • Placement is a region, not a rail. Stored as rail | desktop | both | hidden. rail resolves to the sidebar for a WordPress menu while the split layout is on, and to the dock for everything else, so switching layout is a re-render rather than a data migration.
  • The dock paints three zones, with a divider between each pair of non-empty ones: WordPress menus, then apps (plugin menus, app launchers, and any running window with no home), then OpenStation's controls. Zone membership comes from what a thing is, so a tile cannot be dragged into another zone.
  • Every open window has a tile. An app whose launcher lives on the wallpaper, or is hidden, gets one in the dock while its window is open and loses it when the window closes. Admin pages are excluded (their menu tile already lights up for child pages), and so is any window a system tile's submenu row opens.
  • Apps & Plugins becomes Preferences > Navigation. Rows grouped by kind, one section each, and the rail option names the rail the item is actually on.
  • Right-click offers one write. "Hide from dock" / "Hide from sidebar" / "Hide from desktop", or "Keep in dock" for a tile that is only there because its window is open. Exit OpenStation is the one item that cannot be moved or hidden.
  • itemVisibility / dockOrder become navPlacement / navOrder. Existing arrangements carry over on read, so nobody loses the way they had things.
Before After
Screenshot 2026-08-20 at 12 52 41 Screenshot 2026-08-21 at 10 27 00

Why are these changes being made?

Each surface answered "where does this live?" for itself, from the registration path that produced it. An app registered twice got two answers.

Games shipped that way. It registers a native window with a dock tile and a desktop icon, which the two APIs explicitly allow, so Preferences read its default off the icon and said "On the desktop" while the dock read it off the window and painted a tile anyway. Picking any value in Preferences wrote an override both paths then agreed on, which is why changing the setting appeared to fix it.

The split layout could not be expressed either. dock was both a stored value and a rail name, so a WordPress menu on the sidebar was a menu whose stored placement said dock, and every consumer had to know that. #586 asks that a placement mean exactly what it says in every layout. The Spatial layout it reproduces on is gone, but that guarantee is now structural rather than something each surface has to remember.

Testing instructions

The Games bug

  1. As an administrator, open Preferences > Features > Extended options and enable Games.
  2. Reload the shell.
  3. Make sure the Games icon appears on the desktop wallpaper and not on the dock. On trunk the dock paints a tile too.
  4. Open Preferences > Navigation. Make sure Games is listed once, under Plugins & Apps, set to On the desktop.

Zones and dividers

  1. Look at the dock in the unified layout. Make sure it reads: WordPress menus, a divider, then OpenStation's controls (Mio, Overview, System, Trash, Exit).
  2. Activate a plugin that registers a top-level admin menu (WooCommerce, Yoast). Make sure its menu appears after the first divider, in the same run as any app launchers, with no divider between them.
  3. Make sure the leading divider does not appear when the run before it is empty.

Running windows

  1. Open Games from its desktop icon.
  2. Make sure a Games tile appears in the dock's middle run with a running dot, while the wallpaper icon stays.
  3. Close the window. Make sure the dock tile disappears.
  4. Set an item to Hidden in Preferences > Navigation, then open its window from ⌘K. Make sure it still gets a tile while open.
  5. Open OpenStation Preferences from the System tile. Make sure the dock does not grow a second gear beside it, and that the System tile shows the running dot instead.
  6. Open a post for editing. Make sure no extra tile appears next to Posts.

The split layout

  1. Preferences > Appearance > Desktop layout, pick Split.
  2. Make sure the sidebar holds WordPress's admin menus and nothing else, and the dock holds apps and controls.
  3. With Preferences still open, make sure the sentence under the Navigation title now says "on the dock/sidebar", and every WordPress menu row now reads In the sidebar.
  4. Right-click a sidebar tile. Make sure the menu says Hide from sidebar.
  5. Switch back to Unified. Make sure the same menus return to the dock in the same order, with nothing reset.

Right-click

  1. Right-click a dock tile. Make sure you get Hide from dock, Also show on desktop, Hide everywhere, Navigation settings….
  2. Pick Hide from dock on a dock-only tile. Make sure it disappears rather than moving to the wallpaper.
  3. Pick Also show on desktop on another, then right-click its dock tile again and Hide from dock. Make sure it stays on the wallpaper.
  4. Open Games, then right-click its dock tile. Make sure the first entry is Keep in dock, and that picking it makes the tile stay after the window closes.
  5. Right-click the Exit tile. Make sure no menu opens.
  6. Right-click a wallpaper icon. Make sure you get Hide from desktop.

Drag to reorder

  1. Drag a WordPress menu tile to a new position in the dock. Make sure it lands there and survives a reload.
  2. Drag a tile from the middle run onto the WordPress run. Make sure it snaps back and nothing is reordered.
  3. Drag a control (Mio, Overview) within the trailing run. Make sure it reorders and Exit stays last.
  4. In the split layout, drag a sidebar tile. Make sure the order holds, and that switching back to Unified keeps it.

Preferences > Navigation

  1. Make sure there are three sections, each in its own box: WordPress Core, Plugins & Apps, OpenStation.
  2. Make sure WordPress Core lists menus in Core's order (Dashboard, Posts, Media, Pages, ...), not alphabetically.
  3. Make sure Exit OpenStation is not listed.
  4. Change a row to On both. Make sure the item appears on the dock and the wallpaper immediately, with no reload.
  5. Change it to Hidden. Make sure it disappears from both.
  6. Drag a promoted item around the wallpaper, set it to Hidden, then back to On the desktop. Make sure it returns to where you dragged it.

Carrying over an existing arrangement

Existing users keep what they had. To check without an upgrade, write the old shape onto your user meta:

wp eval '
$m = get_user_meta( 1, "desktop_mode_os_settings", true );
unset( $m["navPlacement"], $m["navOrder"] );
$m["itemVisibility"] = array( "os-mio-toggle" => "hidden", "menu-posts" => "both" );
$m["dockOrder"] = array( "menu-settings", "menu-posts" );
update_user_meta( 1, "desktop_mode_os_settings", $m );
'
  1. Reload the shell. Make sure Mio is gone from the dock, Posts is on both the dock and the wallpaper, and Settings leads the WordPress run.
  2. Change any placement so the settings save. Make sure navPlacement and navOrder are now on the meta and the old keys are gone.

Plugin surface

  1. With a plugin that registers a dock rail renderer, make sure the rail still paints and updates on plugin activation. Renderers that do not implement setZones() are driven through replaceItems as before.
Open WordPress Playground Preview

@AllTerrainDeveloper AllTerrainDeveloper left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, those changes are wonderful.

@mmtr mmtr self-assigned this Aug 21, 2026
mmtr and others added 2 commits August 21, 2026 10:32
Every navigable thing collapses into one flat list of nav items, and
computeNav() decides where each one shows up. The dock, the sidebar
and the desktop render what it returns instead of each resolving
placement for itself.

Placement is stored as a region (rail, desktop, both, hidden) rather
than a rail name, so a layout switch is a re-render rather than a
migration. itemVisibility and dockOrder become navPlacement and
navOrder, carried over on read.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Two copies of the zone order (nav and dock) become one, and the four
placement write helpers become two that take items or ids.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@mmtr
mmtr force-pushed the claude/navigation-architecture-redesign-3dbfb1 branch from ba9ee0c to 6932ed2 Compare August 21, 2026 08:37
…uest

Two review findings.

`dataset.navLocked` was written as the empty string, which is falsy, so
the drag's `! el.dataset.navLocked` guard read a locked tile as
unlocked. Exit has no drag handler of its own, but a neighbour's
gesture still hit-tested against it, reordered across it and wrote its
id into the persisted order. The marker is now truthy and the guard
tests for presence.

`NavItem.defaultPlacement` was declared and read but never assigned, so
`openstation_register_window( 'placement' => 'dock' )` fell through to
the app default and a plugin's launcher moved to the wallpaper. The
native-window sync now sets it.

Also drops items the wallpaper-icon grid cannot open (a tile whose only
opener is its own `onOpen`) from that grid rather than painting a dead
icon; the files layer still runs them.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@mmtr
mmtr merged commit 5676ba2 into trunk Aug 21, 2026
5 checks passed
@mmtr
mmtr deleted the claude/navigation-architecture-redesign-3dbfb1 branch August 21, 2026 09:08
mmtr added a commit that referenced this pull request Aug 21, 2026
…646)

* Tests: End the About CSS slice at the next section, not a named one

The About theme contract test sliced os-settings.css between the About
tab comment and "Apps & Icons section". #640 renamed that section while
#631 was in flight, so the end index came back -1 and the slice was
empty. One assertion failed on the empty slice; the rest of the file's
assertions had nothing to inspect.

Take the next top-level section comment instead, so a rename downstream
of About cannot silently empty the slice again.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* Update os-settings-about-theme.test.ts

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Spatial layout ignores Apps & Icons placement choices

2 participants