Repository navigation
feat(pos): unify split checks & add steppers - #1539
Conversation
|
ⓘ Qodo reviews are paused because your trial has ended. Ask your workspace admin to add credits to resume reviews. Manage billing |
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
…sions.test.ts` where drawer movements recorded on `todayLocal` in Sections 3 and 4 leaked into Section 11 reporting assertions when the test suite executed on `2026-11-10`. Cleaned up `cash_drawer_movements WHERE business_date = ?` on `todayLocal` upon completion of Section 6b, and broadened Section 11's fixture cleanup to delete all drawer movements on `2026-11-10`. All 366 tests in `tests/cash-sessions.test.ts` and all 59 suites in Core Test Suite Shard 1/4 passed
…ions.test.ts` introduced in Round 2. Re-ran `oxfmt --write` on `tests/cash-sessions.test.ts`, verified all changed files against base commit with `check-changed-format.cjs`, confirmed all 366 tests pass in `tests/cash-sessions.test.ts`, and verified backend lint, frontend lint, lint budget, TypeScript compilation, and frontend desktop build
|
@greptile review |
1 similar comment
|
@greptile review |
[Medium impact] The changes affect cashier interactions in checkout and Split Check. Correct the inaccurate guide before merging to satisfy the repository’s documentation requirement. Findings
|
Intent
FloCafe currently has two kinds of split checks - equal amount (
Split payment equally) and items by person (Split Check/SplitCheckModal) - and they are finicky because they live in two separate, disconnected places inside the checkout modal (PaymentModal.tsx: an Equal Share accordion at the top of the right column and a separateSplit items into checksblock in the bottom sticky footer), and inSplitCheckModal.tsx(mode === 'table') and Equal Share payer count there are raw number inputs without-/+buttons, forcing staff to manually type numbers. Unify both split options into one consistent, clear, easy-to-use Split section in the checkout modal, make splitting easy to customize, and add touch-friendly-/+stepper buttons next to every changeable numeric value in both Equal Amount and Items-by-Person split views so staff never have to manually type values.What Changed
PaymentModalwith a two-tab mode switcher, removing the separate split controls from the bottom sticky checkout footer.-and+stepper buttons alongside2,3, and4quick presets for equal-share payer count adjustments inPaymentModal.-and+steppers to check counts, table allocation cells, and leaving-guest rows inSplitCheckModal, introducing automatic row rebalancing across donor checks on unit transfers, an unassigned item quantity badge, and a "Distribute evenly" reset action.Risk Assessment
✅ Low: The changes unify checkout split options into a single card, add touch-friendly steppers to all numeric split inputs, and adhere to accessibility, localization, and test-quality contracts.
Testing
Ran backend build, frontend export, unit regression suite npm run test:unified-split-check-ux, and drove live Chromium browser scenarios end-to-end against real running backend and frontend services. Captured 8 visual UI screenshots in the evidence directory validating the unified card, touch steppers, boundary clamping, 1-tap item reallocation, unassigned status badge, and Clear reset. All checks and scenarios passed.
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
🔧 **Review** - 2 issues found → auto-fixed ✅
tests/unified-split-check-ux.test.ts:529- tests/unified-split-check-ux.test.ts:529-550 reads frontend/src/components/pos/PaymentModal.tsx via fs.readFileSync and executes string position, inclusion, and regex assertions (indexOf, includes, and match(/data-testid="split-check-section"/g)) directly on implementation source text. This violates the test-quality rule prohibiting source-content-only assertions. The test already mounts PaymentModal using a React harness; these assertions should be replaced with observable structural assertions on the rendered React tree, and the unused node:fs import removed.frontend/src/components/pos/PaymentModal.tsx:2000- In frontend/src/components/pos/PaymentModal.tsx:2000-2005, split-mode-equal-tab uses onClick={() => { setShowEqualShare((open) => !open); setEqualShareNotice(null); }} and aria-expanded={showEqualShare}, while its sibling split-mode-items-tab (frontend/src/components/pos/PaymentModal.tsx:1986-1998) uses onClick={() => setShowEqualShare(false)} and aria-pressed={!showEqualShare}. When the user is already on the Equal Share tab, clicking the tab button again toggles showEqualShare to false and flips the view back to item splitting rather than keeping the selected tab active. Clicking the tab should explicitly select it (setShowEqualShare(true)) and use aria-pressed={showEqualShare} for consistent segmented-tab semantics.🔧 Fix applied.
✅ Re-checked - no issues remain.
✅ **Test** - passed
✅ No issues found.
npm run buildnpm run build:frontendnpm run test:unified-split-check-uxcd frontend && CI=1 E2E_BASE_URL="http://127.0.0.1:4301" E2E_KDS_BASE_URL="http://127.0.0.1:4302" E2E_SERVER_APP_BASE_URL="http://127.0.0.1:4303" npx playwright test e2e/equal-share-payments.spec.ts:1306cd frontend && CI=1 E2E_BASE_URL="http://127.0.0.1:4301" E2E_KDS_BASE_URL="http://127.0.0.1:4302" E2E_SERVER_APP_BASE_URL="http://127.0.0.1:4303" npx playwright test e2e/selected-guest-checkout.spec.ts:961Live Chromium browser scenario automation driving checkout modal unified card, equal share steppers and presets, table mode 1-tap transfer and Distribute evenly, and selected items steppers and Clear✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.