Repository navigation
fix(pos): guard shortcut modifiers and close help modal before blurring input - #1127
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks 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 |
|
@greptile review |
|
|
The production changes look sound, but the new modifier guards need stronger regression coverage before merging. The tests cover quantity shortcuts and macOS Option+Digit behavior, but several changed guards remain untested. Please:
Do not change production shortcut behavior unless a failing test reveals a real issue. Keep the fix limited to missing coverage and any confirmed defects. Avoid unrelated refactoring or formatting. |
a8f252b to
b47c89b
Compare
b47c89b to
a2d8aca
Compare
a2d8aca to
3291786
Compare
Prevent Ctrl/Alt/Meta modifier combinations from triggering POS cart quantity or single-key shortcuts, use physical Digit2/Digit4 codes for Alt/Option shortcuts, and dismiss the keyboard shortcuts help modal on Escape before blurring a focused input. Fixes #1070
…ion from keyboard shortcut test"}
3291786 to
72e5028
Compare
Intent
Verify and implement the surgical fix for FreeOpenSourcePOS/FloCafe issue #1070 ("POS keyboard shortcuts trigger on browser/OS modifier combinations and Escape blurs input before closing help"): in
frontend/src/hooks/usePosKeyboardShortcuts.tsandfrontend/src/app/(dashboard)/pos/page.tsx, preventCtrl/Alt/Metamodifier combinations (such asCtrl+MinusorOption+Digit) from triggering cart quantity or shortcut actions, use physical Digit codes where appropriate, and ensureEscapecloses the help overlay before blurring a focused input. Deliver via theno-mistakespipeline as its own PR withFixes #1070in the PR summary.What Changed
usePosKeyboardShortcutsagainst unintendedCtrl,Meta,Alt, andShiftmodifier combinations while matchingAlt+2andAlt+4via physicalDigit2/Digit4key codes (e.code) so macOSOptionchords work reliably.onDismissModalOrBlurinPOSPageso pressingEscapecloses the keyboard shortcuts help modal before blurring a focused<input>or<textarea>.defaultPreventedbehavior, physicalAlt+Digitchords, andEscapemodal dismissal priority.Fixes #1070
Risk Assessment
✅ Low: The change is a small, well-bounded keyboard event guard update and Escape dismissal ordering fix with comprehensive unit and E2E behavioral test coverage.
Testing
Ran the targeted unit test suite (
npm run test:pos-keyboard-shortcuts), built the backend (npm run build), and executed all 7 Playwright E2E tests infrontend/e2e/pos-keyboard-shortcuts.spec.tsagainst the live running POS server and Chromium browser, capturing visual screenshot evidence in~/.no-mistakes/evidence/01M4VJ3X5V5WYW0D87PCQ48VHA; all tests and live scenarios passed.Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
✅ No issues found.
✅ No issues found.
✅ **Test** - passed
✅ No issues found.
npx --prefix frontend playwright test --config=frontend/playwright.config.ts --project=chromium e2e/pos-keyboard-shortcuts.spec.ts("/ focuses product search input, and multiplier search adds item w…npx --prefix frontend playwright test --config=frontend/playwright.config.ts --project=chromium e2e/pos-keyboard-shortcuts.spec.ts("F2 toggles table picker, and Escape dismisses it")npx --prefix frontend playwright test --config=frontend/playwright.config.ts --project=chromium e2e/pos-keyboard-shortcuts.spec.ts("? opens keyboard shortcuts modal cheat sheet, Escape closes it")…npx --prefix frontend playwright test --config=frontend/playwright.config.ts --project=chromium e2e/pos-keyboard-shortcuts.spec.ts("F4 opens checkout modal, and Space tenders cash to complete order…npm run test:pos-keyboard-shortcutsnpm run build && npm run build:frontendnpx --prefix frontend playwright test --config=frontend/playwright.config.ts --project=chromium e2e/pos-keyboard-shortcuts.spec.ts✅ No issues found.
npm run test:pos-keyboard-shortcutsnpm run build && npm run build:frontendcd frontend && npx playwright test --config=playwright.config.ts --project=chromium e2e/pos-keyboard-shortcuts.spec.ts✅ No issues found.
npm run test:pos-keyboard-shortcutsnpm run buildnpx playwright test --config=playwright.config.ts --project=chromium e2e/pos-keyboard-shortcuts.spec.ts✅ **Document** - passed
✅ No issues found.
✅ No issues found.
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ No issues found.
✅ No issues found.
✅ **Push** - passed
✅ No issues found.
✅ No issues found.
✅ No issues found.