fix(macos): host the dashboard sidebar toggle beside back/forward in the titlebar#104380
Conversation
…the titlebar The Control UI's floating sidebar-expand button rendered as a bordered web control crowding the traffic lights in the dashboard window. The toggle now lives as a native borderless button in the leading titlebar accessory ahead of back/forward (Safari ordering) and bridges to the web UI via the openclaw:native-toggle-sidebar event; the injected chrome script advertises the capability with an openclaw-native-nav class so the web control retires itself visually while staying keyboard/screen-reader reachable.
|
Codex review: needs maintainer review before merge. Reviewed July 11, 2026, 6:13 AM ET / 10:13 UTC. Summary PR surface: Source +25, Tests +26, Docs 0, Other +35. Total +86 across 6 files. Reproducibility: yes. Current source places the collapsed web expand control in the macOS titlebar-clearance area, and the supplied native render directly demonstrates the corrected placement beside the history controls. Review metrics: none identified. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Risk before merge
Maintainer options:
Next step before merge
Maintainer decision needed
Security Review detailsBest possible solution: Accept the native titlebar placement as the macOS-specific chrome, retain the current single Control UI navigation-state path and accessible mixed-version fallback, and land only after the protected-label owner confirms the direction and GitHub reports the exact head mergeable. Do we have a high-confidence way to reproduce the issue? Yes. Current source places the collapsed web expand control in the macOS titlebar-clearance area, and the supplied native render directly demonstrates the corrected placement beside the history controls. Is this the best way to solve the issue? Yes. The patch uses the correct owner boundary—AppKit owns native titlebar chrome while the Control UI remains the sole navigation-state owner—and avoids a duplicate state or compatibility path. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against cbc84767bd7e. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +25, Tests +26, Docs 0, Other +35. Total +86 across 6 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
|
Merged via squash.
|
* origin/main: fix(macos): host the dashboard sidebar toggle beside back/forward in the titlebar (#104380)
…the titlebar (openclaw#104380) * fix(macos): host the dashboard sidebar toggle beside back/forward in the titlebar The Control UI's floating sidebar-expand button rendered as a bordered web control crowding the traffic lights in the dashboard window. The toggle now lives as a native borderless button in the leading titlebar accessory ahead of back/forward (Safari ordering) and bridges to the web UI via the openclaw:native-toggle-sidebar event; the injected chrome script advertises the capability with an openclaw-native-nav class so the web control retires itself visually while staying keyboard/screen-reader reachable. * docs: note the macOS app's native titlebar sidebar toggle in the Control UI guide
* origin/main: fix(macos): host the dashboard sidebar toggle beside back/forward in the titlebar (openclaw#104380)
What Problem This Solves
Resolves a problem where the Mac app's dashboard window shows the Control UI's floating sidebar-expand button as a bordered box floating directly under the traffic-light window controls whenever the navigation sidebar is collapsed. It crowds the window controls, uses web-style chrome (border, panel background) that clashes with the native titlebar, and sits in a different row than the native back/forward buttons introduced in #104328.
Why This Change Was Made
The dashboard window already hosts native back/forward controls in a leading titlebar accessory; the natural macOS home for a sidebar toggle is that same row (Safari ordering: sidebar toggle, then history controls). A web-rendered control cannot live in that row because the AppKit drag regions over the titlebar strip swallow its clicks, so the toggle becomes a native
NSButtonthat bridges into the Control UI:DashboardWindowControlleradds a borderlesssidebar.leadingbutton ahead of back/forward, gives the whole accessory group slightly wider insets/spacing, and dispatchesopenclaw:native-toggle-sidebarinto the page.app-host.ts) listens for that event and runs the existingtoggleNavigationSurface()path (same as ⌘B).openclaw-native-navclass;layout.cssvisually retires the floating web expand button under that class using a skip-link pattern (opacity: 0, revealed on:focus-visible) rather thandisplay: none, so the collapse focus-restoration path inapp-host.tsand keyboard/screen-reader access to an in-page expand control keep working.User Impact
Mac app users get a native, always-available sidebar toggle next to the back/forward buttons — matching Safari/Notes conventions — instead of a bordered web button crowding the traffic lights. Collapsing and expanding the navigation sidebar now works from the titlebar in both directions. Keyboard and screen-reader users keep an in-page expand control. Browser users see no change.
Evidence
swift test --package-path apps/macos --filter DashboardWindowSmokeTests: 25/25 pass locally (macOS-only surface), including the extendeddashboard titlebar hosts sidebar and history controlstest asserting Safari ordering, borderless style, enabled state, a resolvable SF Symbol image, and a frame wide enough for all three controls, plus the chrome-script test asserting the newopenclaw-native-navcapability class../scripts/lint-swift.sh macosand./scripts/format-swift.sh macos: clean.tbx_01kx88fctssqntsv9ggta8rk9x):pnpm check:changedpluspnpm test ui/src/app/app-host.test.ts— exit 0, 9/9 tests pass; CSS follow-up validated with a path-scopedpnpm check:changed -- ui/src/styles/layout.csson the same lease.navCollapsedboth ways through the existing navigation-surface path.display: nonefocus-restoration regression; fixed via the skip-link pattern above and re-reviewed clean.