Repository navigation
fix(pos): harden modal keys, F6 & customer edit - #1314
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 |
|
@greptileai review this at apex |
[Medium impact] The changes affect several bounded POS workflows and access to two guarded pages. The customer-modal shortcut issue still needs fixing before this PR is safe to merge. Findings
|
|
@greptileai review this at apex |
1 similar comment
|
@greptileai review this at apex |
…yout-integrity.spec.ts` (`drains multiple cursor pages, deduplicates overlapping orders, removes completed orders, and clears on follow-up page 401`) that caused `Playwright E2E (Shard 2/4)`, `End-to-End Playwright Tests`, and `Required Checks Gate` to fail: - **Invariant:** Whenever a `/customer-display` E2E test pauses the Playwright fake clock (`clock.pauseAt`) before navigating (`page.goto`), the test must advance the paused clock across both sequential mount `setTimeout(..., 0)` ticks—first to resolve the display token and commit the `<header>` render, and second to fire the initial feed fetch (`setTimeout(refresh, 0)`) registered by the post-token `useEffect`. - **Root cause & fix (`frontend/e2e/layout-integrity.spec.ts`):** `budgetPage.clock.pauseAt` was called before `budgetPage.goto`, so a single `budgetPage.clock.runFor(1)` only fired the token-resolution `setTimeout(..., 0)` and left the subsequent `setTimeout(refresh, 0)` frozen on the paused clock, causing `await slowPage1Arrived` to time out after 30s. Installed the clock at `initialClockMs - 60_000` before pausing at `initialClockMs`, closed `displayPage` after its assertions complete, and polled `budgetPage.clock.runFor(1)` until `<header>` is rendered before advancing `budgetPage.clock.runFor(1)` to trigger the first feed request. - **Verification:** Ran `npm run build`, `npm run build:frontend`, `npx playwright test --config=playwright.config.ts --project=chromium e2e/layout-integrity.spec.ts:2585 e2e/pos-keyboard-shortcuts.spec.ts` (11 passed), `npm run lint`, `node scripts/ci/check-changed-format.cjs --base 8a0c272`, `npm run test:pos-keyboard-shortcuts`, `npm run test:auth-ui-deterministic`, and `git diff --check`
fdf441b to
f7370fd
Compare
|
@greptileai review this at apex |
Fixes #1299
Intent
Fix the double-verified POS keyboard, modal isolation, customer country, quantity search, and role-guard defects from the Playwright audits (ab447c32, 7fc6a1e4, 06a30fe0, GitHub Issue #1299):
What Changed
CreateCustomerModalandEditCustomerModalopen state inPOSPage(anyModalOpen), closing customer modals onEscape, ignoringSpace/Enterquick-pay when interactive controls insidePrepaidCheckoutModalare focused, and wiringF6customer search to focus the search input or click the selected customer button.countryName(country)to the invalid-phone toast inEditCustomerModal, allow trailing-asterisk quantity prefixes (3*) inparseQuantitySearchwithout filtering out the POS product grid mid-keystroke, and disable theAddonModalmulti-select+button when a group reachesmax_selection./print-test(printers.manage) and/order-history-demo(dashboard.view) inAuthGuardroute permissions and cover the keyboard, modal, quantity-search, and route-guard behaviors with unit and Playwright tests.Risk Assessment
✅ Low: The changes are well-bounded UI/keyboard-shortcut, quantity-parser, and route-permission fixes that satisfy all stated acceptance criteria with comprehensive unit and E2E behavioral coverage.
Testing
Ran the targeted unit suites (
npm run test:pos-keyboard-shortcutsandnpm run test:auth-ui-deterministic) and drove all 10 end-to-end browser scenarios infrontend/e2e/pos-keyboard-shortcuts.spec.tsagainst an isolated live FloCafe instance, capturing 9 visual evidence screenshots in~/.no-mistakes/evidence/01M5JR5CW05108XGE6SKM9WNGZwith all checks passing.Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
🔧 **Test** - 2 issues found → no changes applied ✅
git -C ~/.no-mistakes/worktrees/de2296f2e6f8/01M5JR5CW05108XGE6SKM9WNGZ statusandgit -C ~/.no-mistakes/worktrees/de2296f2e6f8/01M5JR5CW05108XGE6SKM9WNGZ diff). Respond with fix to validate it, or abort.🔧 No changes applied.
✅ Re-checked - no issues remain.
npm run test:pos-keyboard-shortcutsnpm run test:auth-ui-deterministiccd frontend && E2E_BASE_URL=http://127.0.0.1:3101 E2E_KDS_BASE_URL=http://127.0.0.1:3102 E2E_SERVER_APP_BASE_URL=http://127.0.0.1:3103 E2E_EVIDENCE_DIR=~/.no-mistakes/evidence/01M5JR5CW05108XGE6SKM9WNGZ npx playwright test --config=playwright.config.ts --project=chromium e2e/pos-keyboard-shortcuts.spec.ts✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.