feat(mac): swap dashboard titlebar buttons with sidebar state#105175
Merged
Conversation
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
force-pushed
the
claude/mac-window-nav-buttons-839878
branch
from
July 12, 2026 09:11
5ffa969 to
f806859
Compare
Contributor
|
Codex review: stale review; fresh review needed. Summary Next step |
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 newopenclawNavWKScriptMessage (validated with the same main-frame/trusted-origin checks as the existing bridge messages), and the titlebar accessory becomes state-dependent — always three buttons:[toggle]stays by the traffic lights;[back][forward]right-align to the web sidebar's edge.[toggle][search][+]. Search dispatchesopenclaw:native-open-search(opens the command palette);+dispatchesopenclaw:native-new-session(new-session surface with the selected agent), mirroring the existingopenclaw:native-toggle-sidebarevent contract.[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
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
DashboardWindowControllerharness (before =mainbuild, after = this branch, driven end-to-end through the realopenclawNavmessage) 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.tsextended (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:check—entries=3163 changed=false; swiftformat/swiftlint clean on touched files (controller policy methods moved to a same-file extension to stay undertype_body_length).