CodexBar icon indicating copy to clipboard operation
CodexBar copied to clipboard

Add Cmd-number shortcuts for provider switcher

Open anirudhvee opened this issue 6 months ago โ€ข 3 comments

It would be nice to add Cmd-number shortcuts for the provider switcher while the menu is open.

Expected behavior:

  • Cmd+1 selects Overview
  • Cmd+2 selects the first provider
  • Cmd+3 selects the second provider
  • and so on in the visible switcher order
  • numbers past the visible items do nothing

This makes it faster to jump between Overview and providers without clicking.

anirudhvee avatar May 25 '26 10:05 anirudhvee

Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed May 25, 2026, 9:19 PM ET / 01:19 UTC.

Summary Keep open: current main still only implements persistent menu Cmd actions and relative left/right provider-switcher navigation, so the narrowed Cmd-number request remains missing and is a small, bounded UX feature.

Reproducibility: There is no bug reproduction because this is a feature request, but the current-main source path clearly shows the requested Cmd-number behavior is absent. The existing keyboard path only handles persistent Cmd actions and unmodified arrow navigation.

Ways to help us reproduce this

  • Add a screenshot or short recording showing the behavior.
  • Add expected vs actual behavior.
  • Include redacted logs or terminal output.

Next step This is a narrow, source-confirmed UX feature with clear files, expected behavior, and focused test coverage.

Review details

Best possible solution:

Implement a menu-local ordinal selection path that reuses the existing visible switcher order and state updates without changing provider ordering, settings defaults, or global shortcuts.

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

There is no bug reproduction because this is a feature request, but the current-main source path clearly shows the requested Cmd-number behavior is absent. The existing keyboard path only handles persistent Cmd actions and unmodified arrow navigation.

Is this the best way to solve the issue?

Yes: the narrowest maintainable solution is to extend the existing StatusItemMenu keyboard dispatch and StatusItemController provider-navigation helper to select by visible ordinal. That keeps the behavior local to the open menu and testable beside the existing switcher keyboard tests.

AGENTS.md: found and applied where relevant.

Remaining risk / open question:

  • No live menu run was performed in this read-only review; after implementation, the open-menu shortcut path should be proven against a freshly built app bundle.

Codex review notes: model gpt-5.5, reasoning high; reviewed against 5d74e3770e52.

Label changes

Label changes:

  • add issue-rating: ๐Ÿฆž diamond lobster: Current issue advisory state selects this label.
  • add clawsweeper:source-repro: Current issue advisory state selects this label.
  • remove issue-rating: ๐Ÿš platinum hermit: Current issue advisory state no longer selects this label.
  • remove clawsweeper:needs-live-repro: Current issue advisory state no longer selects this label.

Label justifications:

  • P3: This is a low-risk provider-switcher ergonomics improvement with limited blast radius.
  • impact:other: The issue affects user-visible menu navigation ergonomics, which is meaningful but outside the specific data, auth, session, message, security, and availability labels.
Evidence reviewed

Acceptance criteria:

  • swift test --filter StatusMenuSwitcherClickTests
  • make check
  • Fresh bundle/live menu smoke proof: open the merged provider menu and verify Cmd+1/Cmd+2/Cmd+3 select the expected visible switcher items while an out-of-range digit leaves selection unchanged.

What I checked:

  • Repository policy: AGENTS.md was present and read fully; it points menu behavior toward focused tests and stable menu/model seams rather than broad live AppKit flows when possible. (AGENTS.md:20, 5d74e3770e52)
  • Vision fit: VISION.md lists small UI or UX tweaks under merge-by-default work while calling out higher-signoff areas such as broad refactors, auth, storage, privacy, and package changes. (VISION.md:5, 5d74e3770e52)
  • Scoped request update: The reporter narrowed this issue on 2026-05-26 to only cover Cmd-number shortcuts, removing the earlier broader keyboard-shortcut scope from the remaining request.
  • Current keyboard dispatch: StatusItemMenu.performKeyEquivalent handles Cmd+R, Cmd+comma, Cmd+Q, and then unmodified left/right arrows when the first menu item is ProviderSwitcherView; there is no Cmd-number branch. (Sources/CodexBar/StatusItemMenu.swift:18, 5d74e3770e52)
  • Existing switcher navigation: navigateProviderSwitcher builds the same Overview-plus-provider selection list and moves previous/next only, so it does not expose a direct ordinal selection helper yet. (Sources/CodexBar/StatusItemController+ProviderNavigation.swift:4, 5d74e3770e52)
  • Visible order source: ProviderSwitcherView constructs segments from visible providers and inserts Overview at index 0, which is the ordering the requested shortcuts should reuse. (Sources/CodexBar/StatusItemController+SwitcherViews.swift:52, 5d74e3770e52)

Likely related people:

  • steipete: The current menu keyboard dispatch and provider navigation helper trace to the arrow-navigation commit that touched StatusItemMenu, ProviderNavigation, Actions, and switcher tests. (role: introduced current keyboard navigation path; confidence: high; commits: eadf5c175e53, f61469c3cde6; files: Sources/CodexBar/StatusItemMenu.swift, Sources/CodexBar/StatusItemController+ProviderNavigation.swift, Sources/CodexBar/StatusItemController+Actions.swift)
  • Yuxin-Qiao: Recently changed ProviderSwitcherView and StatusMenuSwitcherClickTests for compact multi-row switcher behavior, adjacent to the requested shortcut surface. (role: recent area contributor; confidence: medium; commits: 2ff00f6d8e66; files: Sources/CodexBar/StatusItemController+SwitcherViews.swift, Tests/CodexBarTests/StatusMenuSwitcherClickTests.swift)
  • Karl: Previously repaired provider-switcher click routing through the parent view and added regression coverage in the same switcher test file. (role: adjacent switcher behavior contributor; confidence: medium; commits: 9907f7496a8e; files: Sources/CodexBar/StatusItemController+SwitcherViews.swift, Tests/CodexBarTests/StatusMenuSwitcherClickTests.swift)
How this review workflow works
  • 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.

clawsweeper[bot] avatar May 25 '26 10:05 clawsweeper[bot]

Updated the issue scope to only cover Cmd-number shortcuts

@clawsweeper re-review

anirudhvee avatar May 26 '26 01:05 anirudhvee

๐Ÿฆž๐Ÿงน ClawSweeper re-review requested.

I asked ClawSweeper to review this item again. Action: item re-review queued (workflow sweep.yml, event repository_dispatch). Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

  • State: Complete
  • Detail: The targeted re-review finished, the durable review comment was updated, and the synced verdict was routed.
  • Run: https://github.com/openclaw/clawsweeper/actions/runs/26426711939
  • Updated: 2026-05-26T01:23:28.119Z

clawsweeper[bot] avatar May 26 '26 01:05 clawsweeper[bot]