Repository navigation
fix(pos): suspend POS shortcuts while the cart price override dialog is open - #1328
Merged
Merged
Conversation
Contributor
|
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 |
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.
Intent
Verify this review finding and, if true, fix it: Suspend POS shortcuts inside the price override dialog (
frontend/src/components/pos/CartPanel.tsxaround line 729). The dialog's local state (priceOverrideItemId) never reaches the POS page's modal guard. Reproduced: open Override price, focus Cancel, press F4, and checkout opens behind the dialog. Include this dialog in the shared modal guard.What Changed
CartPanelvia anonModalOpenChangecallback wheneverpriceOverrideTargetis present, resetting tofalseon close or unmount.cartPanelModalOpeninPOSPage's sharedanyModalOpenshortcut guard and Escape handler so POS keyboard shortcuts are suspended while the price override dialog is open.frontend/e2e/pos-keyboard-shortcuts.spec.tsverifying thatF4does not trigger checkout while the cart price override dialog is open.Risk Assessment
✅ Low: The change cleanly wires CartPanel's price override dialog state into POSPage's shared modal guard and Escape handler using the existing onModalOpenChange pattern, with an end-to-end regression test covering F4 shortcut suppression.
Testing
Built the backend and static desktop frontend, ran the focused
test:pos-keyboard-shortcutsandtest:cart-price-overrideunit suites, executed the fulle2e/pos-keyboard-shortcuts.spec.tsPlaywright Chromium suite (including the new regression test forF4inside the price override dialog), and drove live browser scenarios with visual screenshot evidence confirming that POS shortcuts are suspended while the price override dialog is open and resume cleanly after canceling, pressing Escape, or applying a new price.tests/e2e-server.cjsandnpx playwright test --config=playwright.config.ts --project=chromium e2e/pos-keyboard-shortcuts.spec.tsPipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
✅ **Test** - passed
✅ No issues found.
tests/e2e-server.cjsandnpx playwright test --config=playwright.config.ts --project=chromium e2e/pos-keyboard-shortcuts.spec.tsnpm run build && npm run build:frontendnpm run test:pos-keyboard-shortcutsnpm run test:cart-price-overridecd frontend && E2E_EVIDENCE_DIR=~/.no-mistakes/evidence/01M5MK48A8Q6EK0WFS8KT0ASD4 npx playwright test --config=playwright.config.ts --project=chromium e2e/pos-keyboard-shortcuts.spec.tsLive Playwright Chromium scenario verification againsttests/e2e-server.cjsdriving F4 suppression on focused Cancel button, adversarial POS shortcut barrage (Control+k,Meta+k,F1,?,F2,F3,F6,+,-,Alt+4) andEscapedismissal, and applying a price override followed byF4checkout✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.