(useReviewKeyboard) Guard bare-key review shortcuts against Cmd/Ctrl/Alt#241
Merged
Conversation
The document-level review keydown handler is active over the module's companion panels (image viewer / original view). Its digit (1-5) and letter (a/i/r/x/m) shortcuts matched on the bare key without checking modifiers, so a Cmd+1..5 menu accelerator was consumed by preventDefault before Electron could fire it (step switch never ran) and also wrongly selected a face alternative. Require no Cmd/Ctrl/Alt for those bare-key branches so modified presses fall through to the accelerator while plain presses still act. Shift+Cmd+A (accept all) keeps its own branch.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
This was referenced Jul 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Owner-reported bug: the workflow-step accelerators Cmd+1–5 didn't fire while the ImageViewer had focus. Review's keyboard handler treats image-viewer/original-view as companion tabsets, and its digit branch matched
e.key1–5 without a modifier guard —preventDefault()consumed the key before the menu accelerator could fire (and spuriously selected a face alternative).Fix: bare-key guard (
!metaKey && !ctrlKey && !altKey) on the digit branch and the letter branches (a/i/r/x/m), which had the same gap (swallowed Cmd+A etc.). Arrow keys and the modifier-requiring branches (Alt+Enter, Shift+Cmd+A, Cmd+Z, Cmd+Backspace) untouched; Shift+Cmd+A verified to still work via its earlier branch.Testing
npm test: 89 files / 838 tests passed (new: reviewKeyboard.test.jsx covering bare vs modified digits/letters)npm run build:workspace: OK