Skip to content

feat(mac): swap dashboard titlebar buttons with sidebar state#105175

Merged
steipete merged 2 commits into
mainfrom
claude/mac-window-nav-buttons-839878
Jul 12, 2026
Merged

feat(mac): swap dashboard titlebar buttons with sidebar state#105175
steipete merged 2 commits into
mainfrom
claude/mac-window-nav-buttons-839878

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Closes #105129

What Problem This Solves

The macOS dashboard window always shows the same three titlebar buttons (sidebar toggle, back, forward) next to the traffic lights. With the sidebar collapsed there is no quick way to open session search or start a new session without first reopening the sidebar, and with the sidebar expanded the history arrows sit bunched against the toggle instead of at the sidebar edge where sibling macOS apps put them.

Why This Change Was Made

The Control UI now reports its sidebar state (collapsed + width) to the app over a new openclawNav WKScriptMessage (validated with the same main-frame/trusted-origin checks as the existing bridge messages), and the titlebar accessory becomes state-dependent — always three buttons:

  • Sidebar expanded: [toggle] stays by the traffic lights; [back][forward] right-align to the web sidebar's edge.
  • Sidebar collapsed (or mobile drawer layout / onboarding / settings takeover): [toggle][search][+]. Search dispatches openclaw:native-open-search (opens the command palette); + dispatches openclaw:native-new-session (new-session surface with the selected agent), mirroring the existing openclaw:native-toggle-sidebar event contract.
  • Older gateway bundles that never report state keep the shipped [toggle][back][forward] layout — the compatibility contract is "no report → no change", so remote/old gateways are unaffected.

Non-goals: the Windows WebView2 shell and the in-page sidebar controls are untouched.

User Impact

Mac app users get Safari/Claude-Desktop-style titlebar controls: search and new-session are one click away while the sidebar is collapsed, and back/forward sit at the sidebar edge while it is open. Users on older gateways see no change.

Evidence

Sidebar Before After
Expanded before expanded after expanded
Collapsed before collapsed after collapsed

Full-window shots: before expanded · before collapsed · after expanded · after collapsed

Capture note: WKWebView's remote layer does not composite in an xctest host, so each image is the live titlebar chrome from an env-gated DashboardWindowController harness (before = main build, after = this branch, driven end-to-end through the real openclawNav message) composited over a Playwright render of the same Control UI build with the app's injected native-chrome classes/CSS. Button states and geometry are the app's real output.

Validation:

  • cd apps/macos && swift build — pass.
  • swift test --filter DashboardNavAccessoryTests — 3/3 (message parser bounds/rejection, width clamping).
  • swift test --filter DashboardWindowSmokeTests — 27/27, including the updated titlebar-controls test that now covers legacy→collapsed→expanded transitions.
  • node scripts/run-vitest.mjs ui/src/app/app-host.test.ts ui/src/app/native-nav-state.test.ts — 14/14 (nav-state dedupe, no-webkit no-op, native search/new-session events, onboarding guard).
  • ui/src/e2e/native-nav-sidebar-toggle.e2e.test.ts extended (initial nav-state report, collapse report, palette open, new-session route) — 4/4 with local Playwright Chromium (e2e lane runs outside PR CI).
  • pnpm native:i18n:checkentries=3163 changed=false; swiftformat/swiftlint clean on touched files (controller policy methods moved to a same-file extension to stay under type_body_length).

@openclaw-barnacle openclaw-barnacle Bot added app: macos App: macos app: web-ui App: web-ui size: L maintainer Maintainer-authored PR labels Jul 12, 2026
@steipete steipete closed this Jul 12, 2026
@steipete steipete reopened this Jul 12, 2026
@openclaw-barnacle openclaw-barnacle Bot added the docs Improvements or additions to documentation label Jul 12, 2026
steipete added 2 commits July 12, 2026 02:10
The Control UI reports sidebar collapsed/width over a new openclawNav
WKScriptMessage; the titlebar accessory shows toggle+back/forward
right-aligned to the sidebar edge while expanded, and
toggle+search+new-session while collapsed. Search opens the command
palette and + opens the new-session surface via openclaw:native-*
events. Older gateway bundles that never report keep the shipped
toggle/back/forward layout.

Refs #105129
@steipete
steipete force-pushed the claude/mac-window-nav-buttons-839878 branch from 5ffa969 to f806859 Compare July 12, 2026 09:11
@clawsweeper

clawsweeper Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Codex review: stale review; fresh review needed.

Summary
The latest durable ClawSweeper review was for head 805019933804092b2840ff3952b56499d5c874fb, but the PR head is now f8068598493ff84026b55c762d015ad82935afb1. Its old verdict and PR readiness labels are no longer current.

Next step
Run or wait for a fresh ClawSweeper review on the current PR head.

@steipete
steipete merged commit a8b104c into main Jul 12, 2026
79 checks passed
@steipete
steipete deleted the claude/mac-window-nav-buttons-839878 branch July 12, 2026 09:13
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 13, 2026
…aw#105175)

* feat(mac): swap dashboard titlebar buttons with sidebar state

The Control UI reports sidebar collapsed/width over a new openclawNav
WKScriptMessage; the titlebar accessory shows toggle+back/forward
right-aligned to the sidebar edge while expanded, and
toggle+search+new-session while collapsed. Search opens the command
palette and + opens the new-session surface via openclaw:native-*
events. Older gateway bundles that never report keep the shipped
toggle/back/forward layout.

Refs openclaw#105129

* docs: describe state-dependent mac titlebar buttons
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: macos App: macos app: web-ui App: web-ui docs Improvements or additions to documentation maintainer Maintainer-authored PR size: L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Mac app titlebar buttons should follow sidebar state (search + new session when collapsed)

1 participant