Port upstream 0.67.0: provider switcher shortcut editor and persistence (stacked on #693) - #700
Conversation
Adds the switcher_shortcuts setting (overrides only, validated in Rust and mirrored in TS), the resolved map in the settings snapshot, and a Settings > Menu editor. The switcher hook now follows the configured shortcuts.
|
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 reviewHead reviewed: Correctness against the spec
Structure and size
Non-blocking notes (left as is, no change requested)
Validation I re-ran
UI proofSettings chrome changed (Menu tab). A proof build from this head and a proof kit are being prepared for the CUA run at |
Thermo-nuclear review follow-up (second pass)Reviewed by Codex gpt-6-luna (xhigh); verified and validated by Claude. The earlier review comment stands; this pass found and fixed the following. Fixed:
Left:
Commands run: |
CUA proof (rerun)Build commit: Proof-only patch (throwaway, restored with Driven with the cua-driver CLI only, background delivery only (UIA invoke, PostMessage keys, window-state screenshots), proof windows on the second monitor.
Notes: Screenshots (local, not committed), |
Summary
PR 2 of 2 for the deferred upstream 0.67.0 "provider switcher keyboard shortcuts" feature. PR 1 (#693) added the fixed keys (Left/Right, Ctrl+1..9). This PR makes them configurable:
switcher_shortcutssetting (overrides only; omitted when everything is default), validated in Rust (rust/src/switcher_shortcuts.rs) and mirrored inapps/desktop-tauri/src/lib/switcherShortcuts.ts.{}restores defaults).none, reset to defaults, inline localized errors for duplicate / reserved / invalid keys).tracingwarning; it does not break the rest of the settings.ShortcutCapturegained optionalcompose,recordingHintandemptyLabelprops so the editor reuses it without a mode flag.docs/CONFIGURATION.mddocuments the editor, theswitcher_shortcutskey and the rules.Approved design
From the approved note
design-provider-switcher-shortcuts.md, implemented as written:ctrl alt shift; keys areleft,right,,, or an ASCII letter/digit;nonedisables an action.cmdis accepted as an alias forctrl.ctrl+r,ctrl+q,ctrl+,,ctrl+w, and letters/digits/comma with only shift or no modifier. Duplicates and unknown actions are rejected.left,right,ctrl+1..9.settings.json; the snapshot exposes the resolved map.menusettings tab id is reused, so the tab whitelist is unchanged.Upstream reference
steipete/CodexBar 0.67.0, provider switcher keyboard shortcuts (tag-pinned read only).
Ported / Deferred
Ported: persistence, validation (Rust + TS), snapshot/patch plumbing, Settings > Menu editor, hook wiring, docs.
Deferred: the portable-preferences key
switcherShortcuts, because portable preferences does not exist on this base. It can be added when that feature lands.Validation
cargo +1.98.0 fmt --allcargo +1.98.0 clippy --workspace --all-targets -- -D warnings(both manifests): cleancargo +1.98.0 test -p codexbar: 2175 passed, 0 failedcargo +1.98.0 test -p codexbar-desktop-tauri: 465 passed, 1 failed.commands::tests::bootstrap_payload_exposes_every_provider_variantreports 79 catalog entries vs 78 active providers.get_bootstrap_stateadds a deprecated provider to the catalog when it is enabled in the machine-local settings, so this depends on the developer machine's state and is not touched by this change (this PR only adds a field to the settings snapshot). CI runs on a clean profile.pnpm test(vitest): 71 files, 449 tests passedpnpm run build(tsc + vite): passed; lint has only pre-existing warningsAffected areas
rust/src/switcher_shortcuts.rs(+tests.rs),rust/src/settings.rs,rust/src/settings/raw.rs,rust/src/locale.rs,rust/src/locale/en-US.ftlapps/desktop-tauri/src-tauri/src/commands/settings.rs,commands/bridge.rsapps/desktop-tauri/src/:lib/switcherShortcuts.ts,hooks/useProviderSwitcherKeys.ts,hooks/useTrayPanelController.ts,surfaces/PopOutPanel.tsx,surfaces/settings/SwitcherShortcutsSection.tsx,surfaces/settings/tabs/DisplayTab.tsx,components/ShortcutCapture.tsx,i18n/keys.ts,types/bridge.tsdocs/CONFIGURATION.mdUI proof
This PR changes Settings chrome (Menu tab). CUA / desktop proof has not been captured: the automation run that produced this PR is not permitted to launch the desktop app. Coverage is Vitest component tests (
SwitcherShortcutsSection.test.tsx, 8 tests) only. A CUA retest atCODEXBAR_PROOF_MODE=settings:menuon a fresh debug build is still required before merge; hence this is a draft.