Skip to content

feat(ui): move the Mac app Gateway picker into the sidebar footer - #145341

Merged
steipete merged 2 commits into
mainfrom
steipete/mac-gateway-picker-integration-646e87
Sep 11, 2026
Merged

steipete merged 2 commits into
mainfrom
steipete/mac-gateway-picker-integration-646e87

Conversation

@steipete

@steipete steipete commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

The Mac app's Gateway picker lived in the chat header, tied to the rightmost chat pane and hidden when only one Gateway was saved. Gateway identity and switching belong with the persistent account controls at the bottom-left of the dashboard.

Why This Change Was Made

The footer account card now shows the user name above the current Gateway's health dot, name, and primary tag. Offline state shows Reconnecting…. The footer remains 53px high, with 18px/14px text lines and a 28px avatar; the browser-hosted card remains one line and the existing accessible label is preserved.

The identity menu places a Gateway section after the profile header. It lists every saved Gateway with accessible health labels, primary/current indicators, selection, Command/Control-click to open another window, conditional Set as primary…, and Gateway settings…. Normal actions use the menu's selection event so keyboard activation works; modified context-menu events handle macOS Control-click. The native snapshot and Swift bridge are unchanged. Actions use the existing lazy sidebar-menu boundary, and the display-only footer reads the injected snapshot directly.

The old chat header picker, its property plumbing/subscription, CSS, and tests are removed. English strings moved to nav.gateway using the repository's generated, post-merge locale workflow; no locale adapters, translation memory, or budget baselines were edited. The macOS guide documents the new location.

User Impact

Mac users can see and switch Gateways from the sidebar on every route, including when only one Gateway is configured. Opening the current Gateway normally sends no selection command. All native menu actions close the menu after dispatch.

Evidence

Inspected synthetic fixtures only, captured in Chromium with the native bridge injected before load, light appearance, 1280×800 viewport, and device scale factor 2.

Surface Before After
Sidebar footer One-line account card Gateway health, name, and primary tag below the account name
Gateway controls Gateway picker in the chat header Gateway section in the sidebar identity menu

Production LOC: +176 / −268 = −92. Tests and test support (including isolated-lane registration): +212 / −273 = −61. Documentation: +7. Production plus documentation remains −85.

Startup measurement Before After Change
JavaScript gzip 354,015 B 354,025 B +10 B
JavaScript requests 8 8 0
CSS gzip 45,742 B 45,842 B +100 B

The committed JavaScript baseline is 353,694 B. The final build is 331 B above baseline, within the 512 B allowance (growth limit 354,206 B). No budget or baseline file changed.

Validation commands and outcomes:

pnpm ui:build
node --import ./scripts/tsx.mjs scripts/check-control-ui-performance.mts --report-only

Both pass with the measurements above.

node scripts/run-vitest.mjs run --config test/vitest/vitest.ui.config.ts --configLoader runner ui/src/components/app-sidebar.test.ts ui/src/components/sidebar-footer-layout.browser.test.ts ui/src/pages/chat/chat-responsive.browser.test.ts ui/src/pages/chat/chat-page.test.ts ui/src/pages/chat/components/chat-pane-header.test.ts
node scripts/run-vitest.mjs run --config test/vitest/vitest.ui.config.ts --configLoader runner ui/src/components/app-sidebar.test.ts
node scripts/run-vitest.mjs run --config test/vitest/vitest.ui.config.ts --configLoader runner ui/src/components/app-sidebar.test.ts ui/src/components/sidebar-footer-layout.browser.test.ts
node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-isolated.config.ts --configLoader runner ui/src/components/app-sidebar-native-gateways.test.ts ui/src/pages/chat/chat-page.test.ts
node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-isolated.config.ts --configLoader runner ui/src/components/app-sidebar-native-gateways.test.ts
node scripts/run-vitest.mjs run --config test/vitest/vitest.ui.config.ts --configLoader runner ui/src/pages/chat/components/chat-pane-header.test.ts

Final applicable results: 563 targeted tests pass: sidebar 361, responsive browser 126, footer browser 3, header 44, chat page 28, native Gateway menu 1. The initial shared run exposed three test-state contamination failures from resetting the native bridge's modules; the new case now has its own isolated entrypoint with the real bridge and a vi.fn postMessage stub. The full sidebar rerun passes. The chat-page test belongs to the isolated lane and was run there explicitly.

STAGE=before OPENCLAW_CAPTURE_UI_PROOF=1 node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/e2e/zz-gateway-footer.e2e.test.ts
STAGE=after OPENCLAW_CAPTURE_UI_PROOF=1 node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/e2e/zz-gateway-footer.e2e.test.ts ui/src/e2e/sidebar-account-footer.e2e.test.ts
STAGE=verify node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/e2e/zz-gateway-footer.e2e.test.ts

Before capture: 1 passed. After capture plus existing account-footer E2E: 4 passed. Final interaction verification: 1 passed, proving actual Enter selection, current-Gateway no-op, Command/Control-click window dispatch, menu closure, and settings dispatch. The interaction probe caught and verified the macOS Control-click context-menu fix. The scratch file is parked outside the tree and is not committed.

pnpm ui:i18n:baseline
pnpm exec oxfmt $(git diff --name-only) ui/src/components/app-sidebar-native-gateways.test.ts
pnpm exec oxlint $(git diff --cached --name-only -- '*.ts' '*.mjs')
pnpm exec oxlint --type-aware ui/src/test-helpers/native-gateways.ts
git diff --check

All pass. The i18n baseline command requires no raw-copy baseline changes; generated translations remain owned by the post-merge refresh. Grepping ui/src, extensions, and apps finds no remaining references to chat-pane__gateway, gatewayPicker, showGatewayPicker, or gatewaysSnapshot.

node scripts/check-changed.mjs
node scripts/check-changed.mjs --timed

Both commands pass (exit 0). The timed run completed with every selected lane marked ok, including core-test and UI typechecks, all three dead-export scans, core lint, UI style lint, and script lint. The first run caught a test-helper consistent-return error; it is fixed, and focused type-aware lint plus both full reruns pass. This checker suppresses successful tables unless --timed is set; the table below was read and verified. The known nested-worktree declaration-path failure did not occur.

Completed changed-check timing table
[check:changed] summary
   3.38s  ok         conflict markers
  41.97s  ok         max-lines suppression ratchet
  16.36s  ok         assertion SAFETY comment ratchet
   184ms  ok         changelog attributions
   206ms  ok         doctor deprecation registry
   321ms  ok         guarded extension wildcard re-exports
   215ms  ok         plugin-sdk wildcard re-exports
   447ms  ok         duplicate scan target coverage
   361ms  ok         dependency pin guard
   330ms  ok         format changed files
   579ms  ok         package patch guard
   2.20s  ok         test temp creation report (warning-only)
  48.19s  ok         core tsgo graph boundary
   4.20s  ok         Control UI i18n catalog
  12.90s  ok         typecheck core tests
   1.75s  ok         typecheck UI
  27.34s  ok         coercion helper declaration guard
  87.91s  ok         dead export scan (skip with OPENCLAW_CHECK_CHANGED_SKIP_DEADCODE=1)
 225.47s  ok         lint core
   868ms  ok         lint UI changed style files
   671ms  ok         lint UI changed style files
   690ms  ok         lint UI changed style files
  33.72s  ok         lint scripts

Independent Codex autoreview of the final staged diff completed scoped-clean, with no accepted/actionable P0–P2 findings. An earlier accessibility concern was checked against the original source: the old chip exposed health labels only in its menu rows, and those labels remain in the new menu. The final review included that comparison evidence.

Scope/proof notes: the native-menu case lives in a dedicated isolated test file instead of the shared identity-menu case file because the real native capability is a singleton. There is no production behavior deviation from the requested design and no STOP condition was hit. Proof uses the mocked Control UI and injected native bridge; the live signed Mac app/WKWebView and the full repository test suite were not run. This PR remains a draft; it is not marked ready or merged.

@clawsweeper

clawsweeper Bot commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: macos App: macos app: web-ui App: web-ui size: L maintainer Maintainer-authored PR labels Sep 11, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 11, 2026
@clawsweeper

clawsweeper Bot commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 11, 2026, 6:36 PM ET / 22:36 UTC (Revision 2).

ClawSweeper review

What this changes

Moves the Mac dashboard’s Gateway identity and switching controls from the chat header into the sidebar account card and menu, including single-Gateway setups.

Regression provenance

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

⛔ Blocked before merge - 4 items remain

This remains a useful, distinct improvement over current main. Both prior findings remain actionable: the shipped Option-click shortcut is lost, and the dedicated Gateway picker guide still describes the removed control.

Priority: P2
Reviewed head: 434e4d00ff7427fd5b0a08eeb53ce67b54448fd1

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Useful visual evidence and a focused relocation are offset by the remaining shipped-shortcut regression.
Proof confidence 🐚 platinum hermit (4/6) Not applicable: The verified repository-admin author is exempt from the external-contributor gate. Inspected Chromium captures demonstrate the sidebar appearance change; reported injected-bridge interaction checks do not establish native WKWebView effects, whose implementation is unchanged.
Patch quality 🦐 gold shrimp (3/6) 2 actionable review findings remain.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The verified repository-admin author is exempt from the external-contributor gate. Inspected Chromium captures demonstrate the sidebar appearance change; reported injected-bridge interaction checks do not establish native WKWebView effects, whose implementation is unchanged.
Evidence reviewed 9 items Introduced shortcut regression: The pinned introduced diff removes the header's altKey handler and replaces it with a sidebar handler accepting only metaKey or ctrlKey. Normal menu selection dispatches select for another Gateway.
Shipped compatibility contract: The latest supplied release, v2026.9.4, opens another window on Option-click, including the current Gateway. This establishes a shipped shortcut rather than an inferred preference.
Dedicated documentation remains stale: The Gateway picker section still directs users to the dashboard header and says two configured Gateways are required, conflicting with the new overview and sidebar implementation.
Findings 2 actionable findings [P1] Preserve the shipped Option-click new-window shortcut
[P3] Update the dedicated Gateway picker documentation
Security None None.

How this fits together

The Mac app supplies saved Gateway identities and health to the embedded Control UI. The sidebar displays that snapshot and sends selection, window, settings, and promotion requests through the existing native bridge.

flowchart LR
  A[Saved Mac Gateways] --> B[Native Gateway snapshot]
  B --> C[Sidebar account card]
  C --> D[Gateway menu]
  D --> E{Selected action}
  E --> F[Existing native bridge]
  F --> G[Switch or open Gateway window]
  F --> H[Settings or primary confirmation]
Loading

Before merge

  • Preserve the shipped Option-click new-window shortcut (P1) - The prior finding remains: v2026.9.4 handles altKey by opening another dashboard window, including for the current Gateway. This replacement checks only Command/Control, so Option-click on another Gateway now follows ordinary selection and replaces the current dashboard; Option-click on the current Gateway does nothing. Include altKey in the intercepted window-opening path and cover both rows without a select dispatch.
  • Update the dedicated Gateway picker documentation (P3) - The prior documentation finding remains: docs/platforms/mac/webchat.md under “Gateway picker” still tells users to find a header picker available only with two Gateways. Removing that control makes those instructions incorrect, despite the new overview paragraph. Update the dedicated section for the sidebar location, single-Gateway availability, and supported gestures.
  • Resolve merge risk (P1) - Existing users who Option-click to compare Gateways can unexpectedly switch the current dashboard instead of opening another window.
  • Complete next step (P2) - Restore Option-click window opening and correct the dedicated Gateway picker guide.

Findings

  • [P1] Preserve the shipped Option-click new-window shortcut — ui/src/components/app-sidebar-agent-menu.ts:440-445
  • [P3] Update the dedicated Gateway picker documentation — docs/platforms/macos.md:184-189
Agent review details

Security

None.

PR surface

Source -89, Tests -61, Docs +7. Total -143 across 21 files.

View PR surface stats
Area Files Added Removed Net
Source 11 179 268 -89
Tests 9 212 273 -61
Docs 1 7 0 +7
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 21 398 541 -143

Review metrics

None.

Merge-risk options

Maintainer options:

  1. Preserve Option-click alongside the new gestures (recommended)
    Accept altKey in the existing window-opening handler and verify current and alternate Gateway rows never fall through to ordinary selection.
Copy recommended automerge instruction
@clawsweeper automerge

Special instructions:
Preserve the shipped Option-click new-window behavior alongside Command/Control-click, cover current and alternate Gateway rows without select dispatch, and update the dedicated macOS Gateway picker guide.

Technical review

Best possible solution:

Keep one sidebar-owned picker while preserving shipped window-opening gestures and consistent documentation.

Do we have a high-confidence way to reproduce the issue?

Yes, source establishes the shortcut regression: Option-click bypasses the new modifier guard and reaches ordinary selection. No application code or tests were executed during this read-only review.

Is this the best way to solve the issue?

The sidebar relocation is a focused reuse of the existing bridge, but it should preserve Option-click and update the dedicated guide before merging.

Full review comments:

  • [P1] Preserve the shipped Option-click new-window shortcut — ui/src/components/app-sidebar-agent-menu.ts:440-445
    The prior finding remains: v2026.9.4 handles altKey by opening another dashboard window, including for the current Gateway. This replacement checks only Command/Control, so Option-click on another Gateway now follows ordinary selection and replaces the current dashboard; Option-click on the current Gateway does nothing. Include altKey in the intercepted window-opening path and cover both rows without a select dispatch.
    Confidence: 0.99
  • [P3] Update the dedicated Gateway picker documentation — docs/platforms/macos.md:184-189
    The prior documentation finding remains: docs/platforms/mac/webchat.md under “Gateway picker” still tells users to find a header picker available only with two Gateways. Removing that control makes those instructions incorrect, despite the new overview paragraph. Update the dedicated section for the sidebar location, single-Gateway availability, and supported gestures.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.97

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against b6b7ec4b7d3e.

Labels

Label changes:

  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: The verified repository-admin author is exempt from the external-contributor gate. Inspected Chromium captures demonstrate the sidebar appearance change; reported injected-bridge interaction checks do not establish native WKWebView effects, whose implementation is unchanged.
  • remove status: 📣 needs proof: Current PR status label is status: ⏳ waiting on author.

Label justifications:

  • P2: This improves Mac Gateway navigation with a bounded shortcut compatibility defect.
  • merge-risk: 🚨 compatibility: The replacement picker drops the Option-click behavior shipped in v2026.9.4.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🐚 platinum hermit and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: The verified repository-admin author is exempt from the external-contributor gate. Inspected Chromium captures demonstrate the sidebar appearance change; reported injected-bridge interaction checks do not establish native WKWebView effects, whose implementation is unchanged.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. The verified repository-admin author is exempt from the external-contributor gate. Inspected Chromium captures demonstrate the sidebar appearance change; reported injected-bridge interaction checks do not establish native WKWebView effects, whose implementation is unchanged.

Evidence

Acceptance criteria:

  • [P1] node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-isolated.config.ts --configLoader runner ui/src/components/app-sidebar-native-gateways.test.ts.
  • [P1] node scripts/run-vitest.mjs run --config test/vitest/vitest.ui.config.ts --configLoader runner ui/src/components/app-sidebar.test.ts.
  • [P1] pnpm docs:check-links.
  • [P1] node scripts/check-changed.mjs.
  • [P1] git diff --check.

What I checked:

  • Introduced shortcut regression: The pinned introduced diff removes the header's altKey handler and replaces it with a sidebar handler accepting only metaKey or ctrlKey. Normal menu selection dispatches select for another Gateway. (ui/src/components/app-sidebar-agent-menu.ts:441, 434e4d00ff74)
  • Shipped compatibility contract: The latest supplied release, v2026.9.4, opens another window on Option-click, including the current Gateway. This establishes a shipped shortcut rather than an inferred preference. (ui/src/pages/chat/components/chat-pane-header.ts, 3a9d69db306c)
  • Dedicated documentation remains stale: The Gateway picker section still directs users to the dashboard header and says two configured Gateways are required, conflicting with the new overview and sidebar implementation. Public docs: docs/platforms/mac/webchat.md. (docs/platforms/mac/webchat.md:115, 434e4d00ff74)
  • Current-main necessity: Fetched main still renders the chat-header Gateway picker with Option-click handling. The merged related work at feat(mac): dashboard gateway picker with in-place switching #113965 establishes the original picker, not this sidebar relocation. (ui/src/pages/chat/components/chat-pane-header.ts:308, b6b7ec4b7d3e)
  • Inspected visual evidence: Inspected all four prepared screenshots from the captured PR context, sourceRevision 47954102a98fdcccb54a8e84346d0175080de957ff195f9f98f3f882a171e3a2. They show the one-line versus two-line footer and header versus sidebar menu. The body identifies Chromium with synthetic data and an injected native bridge; it explicitly says signed Mac/WKWebView execution was not performed. (434e4d00ff74)
  • Maintainer proof exemption verified: GitHub reports repository admin permission for steipete. This resolves the differing association fields and supports the maintainer exemption from the external-contributor proof requirement.

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Dallin Romney: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Preserve Option-click and verify current and alternate Gateway rows open windows without ordinary selection.
  • Update the dedicated macOS Gateway picker guide to match the sidebar controls.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (1 earlier review cycle)
  • reviewed 2026-09-11T22:20:34.785Z sha f8923d1 :: needs real behavior proof before merge. :: [P1] Preserve the shipped Option-click new-window shortcut | [P3] Update the dedicated Gateway picker documentation

Show native Gateway identity and health below the account name and move switching, primary promotion, and settings into the identity menu. Preserve the 53px footer and one-line web card; remove the chat header picker and its plumbing.
@steipete
steipete force-pushed the steipete/mac-gateway-picker-integration-646e87 branch from bb17a3d to 434e4d0 Compare September 11, 2026 22:29
@steipete
steipete marked this pull request as ready for review September 11, 2026 22:29
@clawsweeper clawsweeper Bot added status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 11, 2026
@steipete
steipete merged commit 61b3bc2 into main Sep 11, 2026
173 of 174 checks passed
@steipete
steipete deleted the steipete/mac-gateway-picker-integration-646e87 branch September 11, 2026 22:53
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 12, 2026
…enclaw#145341)

* feat(ui): move the Mac app Gateway picker into the sidebar footer

Show native Gateway identity and health below the account name and move switching, primary promotion, and settings into the identity menu. Preserve the 53px footer and one-line web card; remove the chat header picker and its plumbing.

* fix(ui): align the Gateway menu actions with their icons
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 merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: L status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant