Skip to content

feat(pos): unify split checks & add steppers - #1539

Merged
khaira777 merged 9 commits into
mainfrom
fm/flocafe-unified-split-check-ux
Nov 10, 2026
Merged

khaira777 merged 9 commits into
mainfrom
fm/flocafe-unified-split-check-ux

Conversation

@khaira777

@khaira777 khaira777 commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

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 separate Split items into checks block in the bottom sticky footer), and in SplitCheckModal.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

  • Consolidated equal-amount shares and item-based check splitting into a unified Split card within PaymentModal with a two-tab mode switcher, removing the separate split controls from the bottom sticky checkout footer.
  • Added touch-friendly - and + stepper buttons alongside 2, 3, and 4 quick presets for equal-share payer count adjustments in PaymentModal.
  • Added - and + steppers to check counts, table allocation cells, and leaving-guest rows in SplitCheckModal, 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.

  • Live validation: ✅ go - 5 of 5 scenarios driven live against the product
Scenario Result Live Evidence
Checkout modal displays unified Split card with mode tabs (By Items / Equal Share) and removes duplicate footer controls ✅ pass live ~/.no-mistakes/evidence/01M71NBWNXG2P6XSMSRMXYM0D3/01-checkout-modal-unified-split-card.png
Equal Amount split view provides touch-friendly - / + steppers, 1-tap quick presets (2, 3, 4), and boundary clamping (2..20) ✅ pass live ~/.no-mistakes/evidence/01M71NBWNXG2P6XSMSRMXYM0D3/02-equal-share-steppers-preset-4.png and ~/.no-mistakes/evidence/01M71NBWNXG2P6XSMSRMXYM0D3/03-equal-share-bo…
SplitCheckModal table mode provides touch-friendly - / + steppers on check count and cells with 1-tap item reallocation between guests ✅ pass live ~/.no-mistakes/evidence/01M71NBWNXG2P6XSMSRMXYM0D3/04-table-mode-single-tap-transfer.png
SplitCheckModal table mode displays unassigned units warning pill on decrement and restores even distribution via Distribute evenly ✅ pass live ~/.no-mistakes/evidence/01M71NBWNXG2P6XSMSRMXYM0D3/05-table-mode-unassigned-warning.png and ~/.no-mistakes/evidence/01M71NBWNXG2P6XSMSRMXYM0D3/06-table-mode-dis…
SplitCheckModal selected guest mode provides touch-friendly - / + steppers bounded by item quantity, row highlight, and 1-tap Clear reset ✅ pass live ~/.no-mistakes/evidence/01M71NBWNXG2P6XSMSRMXYM0D3/07-selected-guest-steppers-highlight.png and ~/.no-mistakes/evidence/01M71NBWNXG2P6XSMSRMXYM0D3/08-selected-g…

Unified Split Card in Checkout Modal
Equal Share Steppers and 4-way Preset Pill
Equal Share Stepper Boundary Clamping (2..20)
Table Mode Steppers and 1-Tap Item Rebalance
Table Mode Unassigned Units Warning Pill
Table Mode Distribute Evenly Reset
Selected Items Steppers with Row Highlight
Selected Items 1-Tap Clear Reset

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.

  • Live validation: ✅ go - 5 of 5 scenarios driven live against the product
Scenario Result Live Evidence
Checkout modal displays unified Split card with mode tabs (By Items / Equal Share) and removes duplicate footer controls ✅ pass live ~/.no-mistakes/evidence/01M71NBWNXG2P6XSMSRMXYM0D3/01-checkout-modal-unified-split-card.png
Equal Amount split view provides touch-friendly - / + steppers, 1-tap quick presets (2, 3, 4), and boundary clamping (2..20) ✅ pass live ~/.no-mistakes/evidence/01M71NBWNXG2P6XSMSRMXYM0D3/02-equal-share-steppers-preset-4.png and ~/.no-mistakes/evidence/01M71NBWNXG2P6XSMSRMXYM0D3/03-equal-share-bo…
SplitCheckModal table mode provides touch-friendly - / + steppers on check count and cells with 1-tap item reallocation between guests ✅ pass live ~/.no-mistakes/evidence/01M71NBWNXG2P6XSMSRMXYM0D3/04-table-mode-single-tap-transfer.png
SplitCheckModal table mode displays unassigned units warning pill on decrement and restores even distribution via Distribute evenly ✅ pass live ~/.no-mistakes/evidence/01M71NBWNXG2P6XSMSRMXYM0D3/05-table-mode-unassigned-warning.png and ~/.no-mistakes/evidence/01M71NBWNXG2P6XSMSRMXYM0D3/06-table-mode-dis…
SplitCheckModal selected guest mode provides touch-friendly - / + steppers bounded by item quantity, row highlight, and 1-tap Clear reset ✅ pass live ~/.no-mistakes/evidence/01M71NBWNXG2P6XSMSRMXYM0D3/07-selected-guest-steppers-highlight.png and ~/.no-mistakes/evidence/01M71NBWNXG2P6XSMSRMXYM0D3/08-selected-g…
  • npm run build
  • npm run build:frontend
  • npm run test:unified-split-check-ux
  • cd 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:1306
  • cd 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:961
  • Live 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.

@qodo-code-review

Copy link
Copy Markdown

ⓘ Qodo reviews are paused because your trial has ended. Ask your workspace admin to add credits to resume reviews. Manage billing

@coderabbitai

coderabbitai Bot commented Nov 10, 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

@khaira777 khaira777 changed the title feat(pos): unify split check modes and add touch-friendly steppers feat(pos): unify split checks & add steppers Nov 10, 2026
…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
@khaira777

Copy link
Copy Markdown
Contributor Author

@greptile review

1 similar comment
@khaira777

Copy link
Copy Markdown
Contributor Author

@greptile review

@greptile-apps

greptile-apps Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 4/5

[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

  1. P2 Guide promises missing presets ▶

Summary

Combines equal-share and item-based splitting in one checkout card.

  • Checkout puts item splitting and equal sharing in one card.
  • Equal sharing has touch controls for choosing payer counts.
  • Split Check adds touch controls for dividing items among checks and guests.
  • Existing test fixtures change without changing product behavior.

Previously fixed issues acknowledged by khaira777: source-text-only test assertions were replaced, and clicking the active Equal Share tab now keeps it selected.

Verification was limited to source inspection; builds, tests, and browser capture were not run.

Reviews (1) · Last reviewed commit: "no-mistakes(ci): Fixed Oxfmt formatting ..." · Reviewed by Greptile

Comment thread docs/architecture/frontend.md Resolved
@khaira777
khaira777 merged commit 609acf8 into main Nov 10, 2026
23 checks passed
@khaira777
khaira777 deleted the fm/flocafe-unified-split-check-ux branch November 10, 2026 06:16
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