Repository navigation
fix(shortcuts): keep Open settings on Alt+, on Windows/Linux (#9824) - #10796
chenmingwei23 wants to merge 2 commits into
Conversation
Opus 4.8 Review (fork) — ✅ no blocking findingsReviewed |
GPT 5.6 Review (fork) — ✅ no blocking findingsReviewed Review detailsNo findings. |
First Principles Review (Fable 5, fork) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS The CJK-IME premise (Ctrl+, types the comma) is untested by the author — confirm on a real Windows host with a Chinese IME before merge. What this change shipsInventory (5 items) — 5 justifiedIntent: FIX — restore Alt+, as the Windows/Linux Open-settings chord so a Ctrl+, keystroke reaches CJK IMEs as a comma instead of opening Settings (Refs #9824).
[FIRST-PRINCIPLES-REVIEWED] 8853d7c |
UX Review (Fable 5, fork) — 🔴 BLOCKUX-level review of UX-Verdict: BLOCK cannot evaluate: missing the Windows/Linux File > Settings… menu after its accelerator removal — no attached screenshot shows that changed surface. Evidence gaps
Watch
[UX-REVIEWED] 8853d7c |
Design Review (Fable 5, fork) — ✅ PASSDesign-level review of Design-Verdict: PASS Verify on a real Windows CJK-IME host that Ctrl+, now types a comma in the desktop app — the native menu path is only pinned by template-shape tests, not exercised by CI. The history claims check out against the base tree: #783 ( [DESIGN-REVIEWED] 8853d7c |
ce79086 to
e55fc63
Compare
|
Answering the UX BLOCK on head Gap 1: Shortcuts reference (Win/Linux) - "Open settings" =
|
e55fc63 to
9173b20
Compare
|
/ai-review override ux 9173b20: UX BLOCK is an evidence gap, not a code finding -- it asks for a screenshot of the native Electron File > Settings menu on Windows/Linux, which no headless Linux CI worker or Playwright can render; the behavior is proven by the test pin and the sibling shortcuts-modal frame is already attached, so the missing frame is disclosed rather than a defect. |
Human judgment recorded@chenmingwei23 marked the ux AI finding as false positive, not applicable, or explicitly accepted for
This decision applies only to this commit. A new push requires a new judgment. |
…otdev#9824) PR kirodotdev#9555 gave "Open settings" the conventional Ctrl+, default on Windows/Linux. Ctrl+, is how a Chinese IME types a comma, so every comma keystroke navigated to Settings instead -- a full comma-input blocker for CJK users. The chord also fires ahead of the global "Enable shortcuts" gate, so turning shortcuts off did not work around it, and kirodotdev#9555's P1 shipped no per-shortcut rebind UI. PR kirodotdev#783 had deliberately kept Windows/Linux on Alt+, and reserved Ctrl+, for the desktop shell menu, so this restores a documented decision. Two surfaces bind this action and both had to drop Ctrl+, off macOS: - In-page (website/src/lib/shortcutRegistry.ts): revert the open-settings default to Alt+, on Windows/Linux (macOS keeps Cmd+, with an Option+, alias, unchanged). Pinned with a regression test in shortcutRegistry.test.ts and matching flips in settingsShortcut.test.tsx. - Desktop shell (website/electron/app-menu.js): the Settings... menu item used accelerator CmdOrCtrl+, on every platform, and a menu accelerator fires before the renderer regardless of focus, so the shell still ate the comma on Windows/Linux even after the in-page fix. Ship the accelerator only on macOS; the item stays discoverable off macOS without claiming Ctrl+,. Uses the same isMac predicate as the in-page fix so there is one notion of "this platform can hold Ctrl+,", and is pinned in app-menu.test.js. The global-gate exemption and the missing rebind UI are left untouched, so this refs rather than closes the issue. Refs kirodotdev#9824
8ff6c43 to
5ae9ed8
Compare
|
/ai-review override ux 5ae9ed8: evidence-gap test fails - the requested native Electron File > Settings frame cannot be captured by headless Linux or Playwright; app-menu.test.js pins the behavior, the Alt+K frame is attached, and the body discloses the absent frame. |
Human judgment recorded@chenmingwei23 marked the ux AI finding as false positive, not applicable, or explicitly accepted for
This decision applies only to this commit. A new push requires a new judgment. |
|
Human judgment recorded, but the following reviewer lane(s) could not be re-run automatically: UX Review. Re-run the lane's latest workflow run for |
Re-rolled the fork UX lane on
|
The open-settings comment in the shortcut registry states that the desktop shell's menu owns Ctrl+, off macOS. The menu built in electron/app-menu.js gives its File > Settings item no accelerator on those platforms, keyed off the same isMac predicate, precisely so the chord stays free for the IME. So nothing owns Ctrl+, there, and the comment describes a binding the code does not create. Restate it as what the code does: no accelerator is claimed off macOS, the keystroke reaches the IME untouched, the menu item stays discoverable without one, and the in-page chord stays Alt-based. Comment only; no behavior change. shortcutRegistry.test.ts and settingsShortcut.test.tsx pass (42 tests), app-menu.test.js passes (29 tests), eslint and tsc are clean.
|
Superseded by #11738, which carries this change from a branch in this repository. Why the move was necessary. This PR's only red was the fork
An objection about missing rendered pixels is invariant under both paths, so Same-repo lanes do consume the marker, which is what makes #11738 able to record What #11738 adds on top of this diff. The The Two comments claiming the desktop shell owns or reserves The rendered-evidence gap is disclosed rather than chased, and the missing Nothing here reflects a problem with the change itself. Closing to keep one |
Problem / Motivation
On Windows/Linux the "Open settings" keyboard shortcut is
Ctrl+,. On Windowswith a Chinese input method,
Ctrl+,is the keystroke that types a comma. Soevery time a CJK user tries to type a comma the app navigates to Settings
instead and no comma is inserted. This is a full input blocker for CJK users,
not a cosmetic default.
The action is bound in TWO places, and both held
Ctrl+,off macOS:Settings...accelerator), which firesbefore the renderer sees the key regardless of where focus is.
Two escape routes are closed:
Open settings chord is dispatched ahead of that global gate on purpose (so
Settings stays reachable to re-enable shortcuts), so the toggle cannot
disable it.
cannot be changed.
Why it matters
A CJK user on Windows cannot type a comma anywhere in the dashboard and has no
in-product way to work around it. For anyone typing Chinese this makes the app
effectively unusable in the composer. It is a full input blocker, not a
cosmetic issue.
Evidence
Windows/Linux shortcuts reference (Alt+K modal), "Open settings" row showing
Alt + ,after the rebind:The desktop File menu (
Settings...with no accelerator caption off macOS) is a native Electron menu and cannot be rendered from a Linux headless harness. Its behaviour is pinned by test instead:website/electron/test/app-menu.test.jsassertsSettings...ships no accelerator on Windows/Linux and keepsCmdOrCtrl+,on macOS (29/29 pass).What changed (motivation -> approach -> change)
Symptom: pressing
Ctrl+,(a CJK comma) navigates to Settings instead oftyping a comma.
Root cause, surface 1 (in-page): PR #9555 introduced the shortcut registry
(
website/src/lib/shortcutRegistry.ts) and gaveopen-settingstheconventional primary-modifier default on every platform
(
both({ key: ',', mod: true })). Off macOS the primary modifiermodisCtrl, so Windows/Linux resolved to
Ctrl+,. That reversed a deliberate earlierdecision: PR #783 explicitly kept Windows/Linux on
Alt+,and reservedCtrl+,for the desktop shell menu -- its body states "the shell menu ownsCtrl+, there, and the in-page chords are Alt-based", and that the chord "stays
ahead of the enabled / disabled gates, preserving the existing property that
Settings ... is reachable even when shortcuts are globally off". So #9555
regressed a documented choice rather than making a new one; restoring it is a
bug fix.
Root cause, surface 2 (desktop shell):
website/electron/app-menu.jsgave theSettings...menu item acceleratorCmdOrCtrl+,on every platform. A nativemenu accelerator is captured before the keystroke reaches the web contents,
independent of focus, so on Windows/Linux the shell itself swallowed
Ctrl+,and no in-page change alone could fix it. This is the path Design Review named,
and it is correct: without this the PR would not fix the reported problem for
desktop users.
Approach: on both surfaces, do not hold
Ctrl+,on the platforms where Ctrl isthe comma key. This is the smallest change that restores the documented
decision, and it invents no rebind UI and does not touch the global-gate
exemption. Both surfaces key off the same
isMacpredicate, so there is onenotion of "this platform can hold Ctrl+," rather than two that could drift.
Change:
open-settingsdefault so Windows/Linux isAlt+,againwhile macOS keeps
Cmd+,(withOption+,as an accepted alias, since a Macbrowser can claim
Cmd+,for its own Preferences before the page sees it).Because the binding is data in the registry, the exempt Comma-reservation
path (
isSettingsChord, which reads the registry entry directly) is correctedby the same one-line change -- no handler edit needed.
Settings...ships itsCmdOrCtrl+,accelerator only onmacOS. Off macOS the item stays in place (File > Settings...), fully
discoverable and clickable, it just does not claim
Ctrl+,and so no longereats the comma.
Deliberately NOT changed: the global-gate exemption (the bootstrap reason
checks out -- you may need Settings to re-enable shortcuts, as #783 documents)
and the absent per-shortcut rebind UI. Those are separate, larger items, so
this uses
Refs #9824, notCloses.Tests
regression test in
shortcutRegistry.test.ts: on Windows/Linuxopen-settingsisAlt+,, neverCtrl+,;Ctrl+,no longer matches andAlt+,does; macOS is unaffected (Cmd+,primary,Option+,alias). Aprose comment is what failed here, so the guarantee is an assertion.
settingsShortcut.test.tsxto match:isSettingsChordnowrejects
Ctrl+,on Windows/Linux, the registry-entry shape assertsAlt+,with no Ctrl/Meta and no alias off macOS,
formatShortcutrendersAlt + ,on Win32, and the handler-level test asserts
Ctrl+,does NOT navigate (theregression) while
Alt+,still does, including when shortcuts are globallyoff.
app-menu.test.js-- on Windows/LinuxSettings...ships NO accelerator (never
CmdOrCtrl+,/Ctrl+,), on macOS it keepsCmdOrCtrl+,. Same prose-is-not-a-guarantee reasoning as the in-page pin.extensionSeams.test.tsxis unaffected: it derives the reserved-code setfrom the registry, and Comma stays reserved via the Alt+, chord.
vitest runon the three frontend files -> 104/104 pass(shortcutRegistry 23, extensionSeams 62, settingsShortcut 19).
node --teston
app-menu.test.js-> 29/29 pass, and onwindows-titlebar-contract.test.js-> 5/5 pass (accelerator change does notdisturb the menu id/order contract).
tsc -bclean andeslintclean on thechanged frontend files.
Manual verification
N/A -- I did not reproduce the IME behaviour on a real Windows host with a
Chinese IME. The bindings are data and are verified by the tests above; the
CJK-comma mechanism is taken from the reporter and from PR #783's documented
reservation of Ctrl+, on Windows/Linux. That a native menu accelerator is
captured ahead of the web contents is standard Electron behaviour.
Pattern harvest
Rule candidate: review-prompt
Pattern: a platform keyboard default that a prior change chose deliberately
(and documented why) must not be replaced by a later convention sweep without
re-reading that rationale; treat such a default as load-bearing, not free to
normalize. Corollary: when one logical binding lives on two surfaces (an
in-page shortcut and a desktop-shell menu accelerator), fixing only one leaves
the defect live, and the shell accelerator wins because it is captured ahead of
the page -- so audit every surface that can claim the chord, and gate them all
on one platform predicate so they cannot drift.
Related Issues
Refs #9824
The two remedies this PR does not take remain open and are the reason it Refs
rather than Closes #9824:
toggle. That exemption is intentional (bootstrap: reach Settings to re-enable
shortcuts), so it should stay, but it means a bad default here can never be
turned off by the user.
answer for "a default collides with my IME or layout" and is a larger item
than this fix.