Skip to content

(useReviewKeyboard) Guard bare-key review shortcuts against Cmd/Ctrl/Alt#241

Merged
krissen merged 1 commit into
devfrom
fix/review-digit-modifier-guard
Jul 17, 2026
Merged

(useReviewKeyboard) Guard bare-key review shortcuts against Cmd/Ctrl/Alt#241
krissen merged 1 commit into
devfrom
fix/review-digit-modifier-guard

Conversation

@krissen

@krissen krissen commented Jul 17, 2026

Copy link
Copy Markdown
Owner

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.key 1–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

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.
@krissen krissen added the bug Something isn't working label Jul 17, 2026
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@krissen
krissen merged commit 569719c into dev Jul 17, 2026
2 checks passed
@krissen
krissen deleted the fix/review-digit-modifier-guard branch July 17, 2026 21:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant