Conversation
…t navigation keys
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Thermo-nuclear reviewReviewed against the 0.67.0 switcher design note and AGENTS.md. Overall the model (
Fixes for 1-3 are pushed as a follow-up commit. |
|
Pushed 4e94fdb "Address thermo review": tray keys now navigate the same list the grid displays (dense overview placeholders included), scroll-into-view moved into ProviderGrid with a test, unused |
CUA proofBuild commit: Commands:
Notes:
Screenshots (local, not committed): |
Summary
PR 1 of 2 for upstream 0.67.0 "provider switcher shortcuts". Adds provider navigation from the keyboard to the tray flyout and the pop-out window:
Left/Right: previous / next segment, wrapping Overview -> providers -> Overview.Ctrl+1...Ctrl+9: Nth segment in displayed order, Overview = 1 (as upstream). Positions past the last segment do nothing (key not consumed).lib/switcherShortcuts.ts: shortcut model (actions, defaults),normalizeShortcut,validateSwitcherShortcuts(unknown action / duplicate / reserved / invalid,nonedisables, omitted actions keep defaults),shortcutFromEvent,matchSwitcherAction,resolveSwitcherTarget. Not yet user-configurable: the mapping is the defaults until PR 2.hooks/useProviderSwitcherKeys.ts, shared byuseTrayPanelControllerandPopOutPanel.Approved design
Design note approved by the user (2026-09-29):
design-provider-switcher-shortcuts.md. Summary:v0.67.0, commit26dcc073c) customizes an existing menu-local mapping: actionsprevious,next,select1..9; defaultsleft,right,cmd+1..9;validated/normalized/action(key:modifiers:mapping:); stored underswitcherShortcuts; edited in Settings; also a portable-preferences key. Windows has no such mapping, so this is (a) new navigation keys, then (b) an editor.left,right,ctrl+1..9. Grammar is upstream's;cmdis accepted as an alias forctrland normalized toctrlso exported documents stay portable. Reserved:ctrl+r,ctrl+q,ctrl+,,ctrl+w. Same duplicate and letters-need-a-modifier rules.cmdaliases toctrl; arrow selection scrolls into view and does not expand the grid;selectNfollows displayed order with Overview = 1; the editor ships in a follow-up PR (two micro PRs).Settings.switcher_shortcuts, bridge/settings patch and Rust validation, the Settingsmenueditor section (11 rows, Clear, Reset to defaults, inline errors), 11 locale keys x 5 locales, portable-preferences allowlist key.Upstream reference
v0.67.0):Sources/CodexBarCore/Config/ProviderSwitcherShortcuts.swift(grammar, defaults, validation, matching);Sources/CodexBar/StatusItemMenu.swift(mapping-drivenproviderShortcutAction);Tests/CodexBarTests/PreferencesDocumentTests.swift(alt+cmd+2andnext: leftduplicate cases, mirrored inswitcherShortcuts.test.ts).Ported / Deferred
Ported: shortcut model, validation and normalization (TypeScript), default navigation keys in TrayPanel and PopOut.
Deferred to PR 2 (per the approved split): Rust
Settings.switcher_shortcutsand validator (dead code without persistence), bridge fields, settings editor UI, locale keys, portable-preferences key.Windows deviations from upstream:
cmd->ctrlalias;alt+f4/alt+tabfrom the note need no reserved entry becausef4andtabare outside the grammar and are rejected as invalid; the reserved set drops macOS-only entries (cmd+h,cmd+m,alt+cmd+h).Validation
Frontend only; no Rust files changed, so cargo was not run.
pnpm --dir apps/desktop-tauri exec vitest run src/lib/switcherShortcuts.test.ts src/hooks/useProviderSwitcherKeys.test.tsx: 2 files, 33 tests passed.pnpm --dir apps/desktop-tauri exec vitest run(full): 69 files, 435 tests passed.pnpm --dir apps/desktop-tauri run lint: no findings in touched files (existing warnings elsewhere unchanged).pnpm --dir apps/desktop-tauri run build: passed.Affected areas
docs/CONFIGURATION.md, "Provider switcher keys")UI proof
Pending: coordinator will capture CUA proof on a fresh build (Left/Right and Ctrl+3 in tray flyout and pop-out; confirm WebView2 does not swallow
Ctrl+digit, design note risk 4; zoom slider still uses arrows).