Skip to content

fix(pos): separate cart control touch targets - #1486

Merged
khaira777 merged 4 commits into
mainfrom
fm/flocafe-fix-cart-controls-hit-target
Nov 7, 2026
Merged

khaira777 merged 4 commits into
mainfrom
fm/flocafe-fix-cart-controls-hit-target

Conversation

@khaira777

@khaira777 khaira777 commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Intent

Verify and fix this review finding with a dedicated PR linked to its issue: [P2] Prevent cart controls from intercepting neighboring buttons - frontend/src/components/pos/CartPanel.tsx:116. The 24px controls expand their hit areas through overlapping pseudo-elements. Clicking inside the right edge of Edit removed the sole cart item because the neighboring minus button received the click. Override Price also overlaps Edit. Give each control a real, non-overlapping touch target.

Fixes #1471

What Changed

  • Replaced the 24px (h-6 w-6) button boxes and overlapping after:-inset-1.5 / after:-inset-2 pseudo-elements on CartPanel controls (discrete and fractional quantity steppers, PAX steppers, item delete, Override Price, and Edit) with real, non-overlapping 28px (h-7 w-7 min-h-7 min-w-7) touch target boxes and increased action group spacing to gap-1.5.
  • Updated SSR markup assertions in tests/ui-regressions-621-623-626.test.ts and added an E2E test in frontend/e2e/layout-integrity.spec.ts verifying non-overlapping bounding boxes, LTR/RTL hit testing, and edge-click routing for cart controls.

Risk Assessment

✅ Low: The change cleanly replaces overlapping pseudo-element hit targets on POS cart controls with real 28x28px button boxes and 6px control spacing, backed by SSR markup assertions and an end-to-end Playwright hit-target regression test.

Testing

Built the backend and static desktop frontend, ran the SSR markup regression test (npm run test:ui-regressions-621-623-626), executed the end-to-end Playwright browser test (POS cart item controls have non-overlapping touch targets and edge clicks do not trigger neighbors (#1471)), and drove an isolated live POS instance with Chromium to verify integer and fractional item controls, PAX steppers, LTR/RTL hit testing, and adversarial right-edge clicks on Override Price and Edit, capturing four visual screenshots as evidence; all checks passed.

  • Live validation: ✅ go - 4 of 4 scenarios driven live against the product
Scenario Result Live Evidence
Each POS cart item control (Remove, Override price, Edit, Minus, Plus) and PAX stepper button (Decrease pax, Increase pax) renders with a real >=28x28px bounding box and non-overlapping horizontal sep… ✅ pass live ~/.no-mistakes/evidence/01M6T0X619BSX7PNFZQBV2KP7W/cart-controls-touch-targets.png
Adversarial right-edge click on Edit for a sole cart item opens the item edit view (Save Changes visible) instead of being intercepted by the neighboring Minus button and deleting the sole item ✅ pass live ~/.no-mistakes/evidence/01M6T0X619BSX7PNFZQBV2KP7W/cart-edit-right-edge-click.png
Adversarial right-edge click on Override Price opens the Override item price dialog instead of being intercepted by the neighboring Edit button ✅ pass live ~/.no-mistakes/evidence/01M6T0X619BSX7PNFZQBV2KP7W/cart-override-price-right-edge-click.png
Edge and center hit-testing (document.elementFromPoint) across all cart item buttons, fractional-quantity stepper inputs/buttons, and PAX stepper inputs/buttons resolves exclusively to each control in… ✅ pass live ~/.no-mistakes/evidence/01M6T0X619BSX7PNFZQBV2KP7W/cart-fractional-and-pax-controls.png

POS Cart Panel with 28x28px non-overlapping item controls and PAX stepper
Right-edge click on Override Price opens the price override modal without triggering Edit
Right-edge click on Edit opens the item edit modal without triggering Minus to delete the sole cart item
POS Cart Panel showing both integer and fractional-quantity item steppers alongside the PAX stepper

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 - 4 of 4 scenarios driven live against the product
Scenario Result Live Evidence
Each POS cart item control (Remove, Override price, Edit, Minus, Plus) and PAX stepper button (Decrease pax, Increase pax) renders with a real >=28x28px bounding box and non-overlapping horizontal sep… ✅ pass live ~/.no-mistakes/evidence/01M6T0X619BSX7PNFZQBV2KP7W/cart-controls-touch-targets.png
Adversarial right-edge click on Edit for a sole cart item opens the item edit view (Save Changes visible) instead of being intercepted by the neighboring Minus button and deleting the sole item ✅ pass live ~/.no-mistakes/evidence/01M6T0X619BSX7PNFZQBV2KP7W/cart-edit-right-edge-click.png
Adversarial right-edge click on Override Price opens the Override item price dialog instead of being intercepted by the neighboring Edit button ✅ pass live ~/.no-mistakes/evidence/01M6T0X619BSX7PNFZQBV2KP7W/cart-override-price-right-edge-click.png
Edge and center hit-testing (document.elementFromPoint) across all cart item buttons, fractional-quantity stepper inputs/buttons, and PAX stepper inputs/buttons resolves exclusively to each control in… ✅ pass live ~/.no-mistakes/evidence/01M6T0X619BSX7PNFZQBV2KP7W/cart-fractional-and-pax-controls.png
  • npm run build && npm run build:frontend
  • npm run test:ui-regressions-621-623-626
  • cd frontend && npx playwright test e2e/layout-integrity.spec.ts -g "1471" --config=playwright.config.ts --project=chromium
  • Live Playwright browser verification against tests/e2e-server.cjs capturing visual screenshots and verifying LTR/RTL, fractional-quantity, and PAX hit targets
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

@coderabbitai

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

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Prevent POS cart controls from intercepting adjacent clicks

🐞 Bug fix 🧪 Tests 🕐 20-40 Minutes

Grey Divider

AI Description

• Replace overlapping cart-button hit areas with real, separated button boxes to prevent unintended
 actions.
• Cover standard and fractional quantity controls with rendered-markup regression checks.
• Verify button bounds and edge-click behavior in LTR and RTL layouts with Playwright.
Diagram

graph TD
  Cart["POS CartPanel"] --> Actions["Item actions"] --> Dialogs["Edit and override"]
  Cart --> Quantity["Quantity controls"] --> Store["Cart state"]
  Cart --> Guest["Guest controls"] --> Store
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Reflow controls around 44px targets
  • ➕ Would preserve the application's default 44px touch-target minimum.
  • ➖ Would require a broader redesign of the compact cart row and could reduce space for item details.

Recommendation: Keep the focused, non-overlapping button-box fix for the current compact cart layout. A 44px-target redesign is worth considering separately if larger touch targets are a product requirement.

Files changed (3) +163 / -12

Bug fix (1) +10 / -10
CartPanel.tsxReplace overlapping cart hit areas with separated buttons +10/-10

Replace overlapping cart hit areas with separated buttons

• Removes expanded pseudo-element hit areas from item actions, quantity steppers, and guest-count controls. Item actions and quantity steppers become 28px boxes with wider spacing between item actions; guest-count buttons retain their 24px boxes.

frontend/src/components/pos/CartPanel.tsx

Tests (2) +153 / -2
layout-integrity.spec.tsExercise POS cart button bounds and edge clicks +122/-0

Exercise POS cart button bounds and edge clicks

• Adds a Playwright regression test for minimum item-button bounds, spacing, and edge hit-testing in LTR and RTL. It also checks that edge clicks open Override Price and Edit without removing the sole cart item.

frontend/e2e/layout-integrity.spec.ts

ui-regressions-621-623-626.test.tsAssert rendered cart-control sizing and separation +31/-2

Assert rendered cart-control sizing and separation

• Adds a fractional-quantity item and enables Edit in the rendered CartPanel fixture. Assertions check item-control sizing and spacing and reject overlapping pseudo-element expansion.

tests/ui-regressions-621-623-626.test.ts

@qodo-code-review

qodo-code-review Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (1) 📘 Rule violations (0) 📎 Requirement gaps (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Remediation recommended

1. Guest-count buttons shrink to 24px and lose their hit area 🐞 Bug ☼ Reliability
Description
The PAX decrease and increase buttons drop their after:-inset-1.5 hit-area expansion while staying
at h-6 w-6, so their clickable box shrinks from about 36px to 24px. The same shrinking applies to
the item stepper, Override Price, Edit and Remove buttons in the cart, which drop their
after:-inset-2 or after:-inset-1.5 expansions and are sized to 28px, cutting their effective tap
areas from about 40px or 36px to 28px on every cart row.
Code

frontend/src/components/pos/CartPanel.tsx[435]

+                  className="touch-target h-6 w-6 min-h-6 min-w-6 rounded-full text-muted-foreground transition-colors hover:bg-muted hover:text-foreground active:bg-muted"
Relevance

●●● Strong

Closely matching cart touch-target shrink findings on CartPanel were accepted in PRs 1438 and 1454;
no rejection or dismissal precedent found.

PR-#1438
PR-#1454

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The old PAX class was `relative touch-target h-6 w-6 ... after:content-[''] after:absolute
after:-inset-1.5, and the new class removes the pseudo-element but keeps h-6 w-6 min-h-6 min-w-6`,
which override the 44px min-size from .touch-target in globals.css, so the clickable area becomes
exactly 24px. For the other cart controls, the removed after:-inset-2 (Override Price, Edit,
stepper) and after:-inset-1.5 (Remove) expanded each control to 40px or 36px, and the replacement
h-7 w-7 gives 28px; the gap-1.5 change only separates boxes and does not recover the lost area.
The updated regression test asserts h-7 w-7 and no after:-inset, locking in the smaller target.
Prior PRs #1438 and #1454 already reported 24px cart controls and cart delete hit areas shrinking.

frontend/src/components/pos/CartPanel.tsx[435-435]
frontend/src/components/pos/CartPanel.tsx[455-455]
frontend/src/app/globals.css[73-80]
frontend/src/components/pos/CartPanel.tsx[812-828]
frontend/src/components/pos/CartPanel.tsx[760-760]
tests/ui-regressions-621-623-626.test.ts[441-456]
PR-#1438
PR-#1454

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The PAX decrease/increase buttons and the cart item action controls (item stepper, Override Price, Edit, Remove) in CartPanel lost their `after:-inset-*` hit-area expansions. The PAX buttons remain 24px (`h-6 w-6`), shrinking their hit area from about 36px to 24px. The item controls are now 28px (`h-7 w-7`), down from an effective 36-40px hit area. Touch targets on every cart row and the guest-count stepper are therefore smaller than before, and the updated regression test pins this smaller size.

## Fix Focus Areas
- frontend/src/components/pos/CartPanel.tsx[433-458]
- frontend/src/components/pos/CartPanel.tsx[113-170]
- frontend/src/components/pos/CartPanel.tsx[757-831]
- tests/ui-regressions-621-623-626.test.ts[441-456]

## Recommended Fix
Restore a hit area of at least the previous size for each control. For the PAX buttons, either size them to 28px (`h-7 w-7 min-h-7 min-w-7`) or keep the original `relative ... after:content-[''] after:absolute after:-inset-1.5` pseudo-element on the 24px box. For the 28px item controls, keep the visual box and reintroduce a pseudo-element expansion sized to fit the gap: with `gap-1.5` (6px), each side can expand by at most 3px (`after:-inset-[3px]`) without overlapping its neighbour. Alternatively, increase the gap or the box size. Check that expanded areas do not overlap neighbouring buttons, then update the regex assertions in tests/ui-regressions-621-623-626.test.ts that pin these classes.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Dismiss ↗ | View ↗


Grey Divider

Context sources
✅ Compliance rules (platform): 5 rules
✅ Cross-repo context — repo relationships
Review mode: Auto: 🚀 Fast: Localized CSS class edits in one POS component; no logic or security impact.

Grey Divider

Tip of the day
💡 Did you know, you can hide the parts of a finding you never read, like the evidence or the agent prompt

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@khaira777 khaira777 changed the title fix(frontend): prevent cart controls from intercepting neighboring buttons fix(pos): separate cart control touch targets Nov 6, 2026
Replace overlapping after:-inset-* pseudo-elements on CartPanel item and pax controls with real non-overlapping 28px touch target boxes and gap-1.5 action spacing so clicking near button edges never triggers a neighboring control.

Fixes #1471
Match the dine-in PAX decrease and increase buttons to the 28px (h-7 w-7 min-h-7 min-w-7) non-overlapping touch target size used by cart item controls.
@khaira777
khaira777 force-pushed the fm/flocafe-fix-cart-controls-hit-target branch from a5cdbf2 to 5de019b Compare November 7, 2026 03:48
@khaira777 khaira777 changed the title fix(pos): separate cart control touch targets fix(frontend): prevent cart controls from intercepting neighboring buttons Nov 7, 2026
…he `dine_in` `pos-order-details-summary` bar in `frontend/src/components/pos/CartPanel.tsx` so enlarging the PAX stepper buttons from 24px (`h-6`) to 28px (`h-7`) keeps the summary bar at 36px and preserves the `>= 300px` `cart-items-scroll` height on a 1024x600 viewport (which also prevents the retry cascade that exhausted the 60/min category write rate limit in subsequent `layout-integrity.spec.ts` suites)
@khaira777 khaira777 changed the title fix(frontend): prevent cart controls from intercepting neighboring buttons fix(pos): separate cart control touch targets Nov 7, 2026
@khaira777
khaira777 enabled auto-merge (squash) November 7, 2026 04:56
@khaira777
khaira777 merged commit be69405 into main Nov 7, 2026
23 checks passed
@khaira777
khaira777 deleted the fm/flocafe-fix-cart-controls-hit-target branch November 7, 2026 05:04
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.

fix(pos): prevent cart controls from intercepting neighboring buttons

1 participant