Skip to content

fix(pos): suspend POS shortcuts while the cart price override dialog is open - #1328

Merged
khaira777 merged 1 commit into
mainfrom
fm/ship-price-dialog-shortcut-guard
Oct 23, 2026
Merged

khaira777 merged 1 commit into
mainfrom
fm/ship-price-dialog-shortcut-guard

Conversation

@khaira777

Copy link
Copy Markdown
Contributor

Intent

Verify this review finding and, if true, fix it: Suspend POS shortcuts inside the price override dialog (frontend/src/components/pos/CartPanel.tsx around 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

  • Report the cart price override dialog's open state from CartPanel via an onModalOpenChange callback whenever priceOverrideTarget is present, resetting to false on close or unmount.
  • Include cartPanelModalOpen in POSPage's shared anyModalOpen shortcut guard and Escape handler so POS keyboard shortcuts are suspended while the price override dialog is open.
  • Add a Playwright E2E test in frontend/e2e/pos-keyboard-shortcuts.spec.ts verifying that F4 does 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-shortcuts and test:cart-price-override unit suites, executed the full e2e/pos-keyboard-shortcuts.spec.ts Playwright Chromium suite (including the new regression test for F4 inside 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.

  • Live validation: ✅ go - 3 of 3 scenarios driven live against the product
Scenario Result Live Evidence
Owner opens Override price on a cart item, focuses Cancel, and presses F4: checkout does not open behind or after closing the dialog, and F4 opens checkout once the dialog is closed ✅ pass live ~/.no-mistakes/evidence/01M5MK48A8Q6EK0WFS8KT0ASD4/price-override-dialog-f4-suspended.png and ~/.no-mistakes/evidence/01M5MK48A8Q6EK0WFS8KT0ASD4/price-override-…
Adversarial POS shortcuts (Ctrl+K, Meta+K, F1, ?, F2, F3, F6, +, -, Alt+4) are suppressed while the cart price override dialog is open, and Escape dismisses the dialog cleanly ✅ pass live Live Playwright Chromium verification against tests/e2e-server.cjs and npx playwright test --config=playwright.config.ts --project=chromium e2e/pos-keyboard-shortcuts.spec.ts
Owner applies a price override in the cart price override dialog and presses F4: the dialog closes, the modal guard releases, and checkout opens with the overridden item total ✅ pass live ~/.no-mistakes/evidence/01M5MK48A8Q6EK0WFS8KT0ASD4/price-override-applied-f4-checkout.png

Price override dialog open with Cancel focused after pressing F4 (no checkout modal opened behind it)
Checkout modal opened by pressing F4 after closing the price override dialog with Cancel
Checkout modal opened by pressing F4 after applying a 42.00 price override in the dialog

Pipeline

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.

  • Live validation: ✅ go - 3 of 3 scenarios driven live against the product
Scenario Result Live Evidence
Owner opens Override price on a cart item, focuses Cancel, and presses F4: checkout does not open behind or after closing the dialog, and F4 opens checkout once the dialog is closed ✅ pass live ~/.no-mistakes/evidence/01M5MK48A8Q6EK0WFS8KT0ASD4/price-override-dialog-f4-suspended.png and ~/.no-mistakes/evidence/01M5MK48A8Q6EK0WFS8KT0ASD4/price-override-…
Adversarial POS shortcuts (Ctrl+K, Meta+K, F1, ?, F2, F3, F6, +, -, Alt+4) are suppressed while the cart price override dialog is open, and Escape dismisses the dialog cleanly ✅ pass live Live Playwright Chromium verification against tests/e2e-server.cjs and npx playwright test --config=playwright.config.ts --project=chromium e2e/pos-keyboard-shortcuts.spec.ts
Owner applies a price override in the cart price override dialog and presses F4: the dialog closes, the modal guard releases, and checkout opens with the overridden item total ✅ pass live ~/.no-mistakes/evidence/01M5MK48A8Q6EK0WFS8KT0ASD4/price-override-applied-f4-checkout.png
  • npm run build && npm run build:frontend
  • npm run test:pos-keyboard-shortcuts
  • npm run test:cart-price-override
  • cd frontend && E2E_EVIDENCE_DIR=~/.no-mistakes/evidence/01M5MK48A8Q6EK0WFS8KT0ASD4 npx playwright test --config=playwright.config.ts --project=chromium e2e/pos-keyboard-shortcuts.spec.ts
  • Live Playwright Chromium scenario verification against tests/e2e-server.cjs driving F4 suppression on focused Cancel button, adversarial POS shortcut barrage (Control+k, Meta+k, F1, ?, F2, F3, F6, +, -, Alt+4) and Escape dismissal, and applying a price override followed by F4 checkout
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

@coderabbitai

coderabbitai Bot commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@khaira777
khaira777 merged commit 261903d into main Oct 23, 2026
23 checks passed
@khaira777
khaira777 deleted the fm/ship-price-dialog-shortcut-guard branch October 23, 2026 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant