Skip to content

feat(pos): compact 2-tier cart panel layout - #1438

Merged
khaira777 merged 3 commits into
mainfrom
fm/flocafe-pos-cart-redesign-r1
Nov 3, 2026
Merged

khaira777 merged 3 commits into
mainfrom
fm/flocafe-pos-cart-redesign-r1

Conversation

@khaira777

@khaira777 khaira777 commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Intent

Redesign the POS CartPanel (frontend/src/components/pos/CartPanel.tsx) to the compact 2-tier layout (Redesign 2 from ~/Downloads/imagerd2.png, paired with the two refinements from Redesign 1 ~/Downloads/Cart panel – dense [email protected]) so that 5-6+ cart items are visible at once on a standard desktop viewport instead of ~2 items, while keeping touch-friendly POS controls, full feature parity, and passing all layout-integrity and RTL checks (tracked in #1436).
Follow the full Obra Superpowers engineering workflow (research, spec/plan in ~/tools/firstmate/data/flocafe-pos-cart-redesign-r1/spec.md, implementation, comprehensive Playwright visual screenshot verification across viewports/order types/addons/notes/RTL, and no-mistakes validation pipeline).
Keep PR title <= 50 chars, single-line PR body paragraphs, and include Fixes #1436.

What Changed

  • Restructured CartPanel items into a compact 2-tier row layout displaying the item name, line total, and multi-quantity unit price on the top row, with inline dot-separated add-ons/instructions, price-override indicator, icon action buttons, and a bordered quantity pill on the second row.
  • Compacted the cart header and dine-in guest counter (pax) pill, tightened list spacing, and expanded icon button hit areas via after:-inset-2 pseudo-elements for touch ergonomics.
  • Replaced the multi-line order notes textarea in the cart footer with a single-line input featuring an inline note icon and character counter, and consolidated the item count and subtotal onto a single wrapping summary row.

Fixes #1436

Risk Assessment

✅ Low: The change is a well-bounded UI layout redesign in CartPanel.tsx that preserves all data-testids, accessibility labels, action handlers, logical RTL CSS properties, and pricing calculations.

Testing

Ran RTL and cart unit suites (test:rtl-dashboard-pos-common, test:cart-price-override, test:cart-variant-identity), built the backend and static desktop frontend, and drove 33 live Playwright E2E scenarios across layout-integrity.spec.ts, pos-keyboard-shortcuts.spec.ts, multi-counter-ordering.spec.ts, server-app-ordering.spec.ts, and a targeted visual verification run capturing 8 screenshots in the evidence directory; all checks and scenarios passed.

  • Live validation: ✅ go - 6 of 6 scenarios driven live against the product
Scenario Result Live Evidence
Cashier adds 7 items to the POS cart on a 1440x900 desktop viewport in Dine-in mode and sees all 7 items simultaneously without scrolling alongside a de-boxed Pax stepper pill ✅ pass live ~/.no-mistakes/evidence/01M6HDZAWSMZXDD6HSRCKCFZWM/cart-redesign-1440x900-dine-in.png
Cashier customizes a cart item with multiple addons, special instructions, quantity > 1, and a manager/owner price override, and sees the 2-tier row with unit-price caption, bold line total, amber ove… ✅ pass live ~/.no-mistakes/evidence/01M6HDZAWSMZXDD6HSRCKCFZWM/cart-panel-closeup-1440x900.png
Adversarial selector & visual order guard: clicking the first button[aria-label="Remove"] on a multi-quantity cart row removes the entire line in 1 click (Trash2 is first in DOM order) while Trash2 vi… ✅ pass live cd frontend &amp;&amp; npx playwright test e2e/pos-keyboard-shortcuts.spec.ts e2e/multi-counter-ordering.spec.ts --project=chromium and ~/.no-mistakes/evidence/01M6HDZAWSMZXDD6HSRCKCFZWM…
Cashier enters an order note in the compact single-line Order Notes input with inline StickyNote icon and 21/200 counter, and sees Items count and Subtotal merged onto a single footer summary row ✅ pass live ~/.no-mistakes/evidence/01M6HDZAWSMZXDD6HSRCKCFZWM/cart-panel-closeup-1440x900.png and cd frontend &amp;&amp; npx playwright test e2e/server-app-ordering.spec.ts --project=chromium
Cashier switches across Dine-in, Takeaway (scheduled), Delivery, and Online order types and resizes across 1440x900, 1024x600, 844x390, 512x384, and 390x844 mobile drawer while cart-items-scroll remai… ✅ pass live cd frontend &amp;&amp; npx playwright test e2e/layout-integrity.spec.ts -g &#34;POS &#34; --project=chromium and ~/.no-mistakes/evidence/01M6HDZAWSMZXDD6HSRCKCFZWM/cart-redesign-1024x600.png and…
Cashier switches POS language to Persian (fa, dir="rtl") and uses the redesigned CartPanel with mirrored logical alignment, inline-start note icon, inline-end counter, and inline-end Trash2 button ✅ pass live npm run test:rtl-dashboard-pos-common and ~/.no-mistakes/evidence/01M6HDZAWSMZXDD6HSRCKCFZWM/cart-redesign-rtl-fa-1440x900.png

POS CartPanel 1440x900 Dine-In (7 items visible at once with addons, notes, unit price caption, and price override)
CartPanel closeup at 1440x900 showing compact 2-tier rows, de-boxed Pax stepper, single-line Order Notes, and merged Items + Subtotal row
POS CartPanel Takeaway mode with scheduled order section at 1440x900
POS CartPanel Delivery mode with address, expected payment, courier note, and schedule section at 1440x900
POS CartPanel Online mode with platform and external order ID inputs at 1440x900
POS CartPanel on compact 1024x600 desktop viewport
POS CartPanel RTL layout in Persian (fa) at 1440x900
POS CartPanel mobile bottom drawer on 390x844 viewport

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 - 6 of 6 scenarios driven live against the product
Scenario Result Live Evidence
Cashier adds 7 items to the POS cart on a 1440x900 desktop viewport in Dine-in mode and sees all 7 items simultaneously without scrolling alongside a de-boxed Pax stepper pill ✅ pass live ~/.no-mistakes/evidence/01M6HDZAWSMZXDD6HSRCKCFZWM/cart-redesign-1440x900-dine-in.png
Cashier customizes a cart item with multiple addons, special instructions, quantity > 1, and a manager/owner price override, and sees the 2-tier row with unit-price caption, bold line total, amber ove… ✅ pass live ~/.no-mistakes/evidence/01M6HDZAWSMZXDD6HSRCKCFZWM/cart-panel-closeup-1440x900.png
Adversarial selector & visual order guard: clicking the first button[aria-label="Remove"] on a multi-quantity cart row removes the entire line in 1 click (Trash2 is first in DOM order) while Trash2 vi… ✅ pass live cd frontend &amp;&amp; npx playwright test e2e/pos-keyboard-shortcuts.spec.ts e2e/multi-counter-ordering.spec.ts --project=chromium and ~/.no-mistakes/evidence/01M6HDZAWSMZXDD6HSRCKCFZWM…
Cashier enters an order note in the compact single-line Order Notes input with inline StickyNote icon and 21/200 counter, and sees Items count and Subtotal merged onto a single footer summary row ✅ pass live ~/.no-mistakes/evidence/01M6HDZAWSMZXDD6HSRCKCFZWM/cart-panel-closeup-1440x900.png and cd frontend &amp;&amp; npx playwright test e2e/server-app-ordering.spec.ts --project=chromium
Cashier switches across Dine-in, Takeaway (scheduled), Delivery, and Online order types and resizes across 1440x900, 1024x600, 844x390, 512x384, and 390x844 mobile drawer while cart-items-scroll remai… ✅ pass live cd frontend &amp;&amp; npx playwright test e2e/layout-integrity.spec.ts -g &#34;POS &#34; --project=chromium and ~/.no-mistakes/evidence/01M6HDZAWSMZXDD6HSRCKCFZWM/cart-redesign-1024x600.png and…
Cashier switches POS language to Persian (fa, dir="rtl") and uses the redesigned CartPanel with mirrored logical alignment, inline-start note icon, inline-end counter, and inline-end Trash2 button ✅ pass live npm run test:rtl-dashboard-pos-common and ~/.no-mistakes/evidence/01M6HDZAWSMZXDD6HSRCKCFZWM/cart-redesign-rtl-fa-1440x900.png
  • npm run test:rtl-dashboard-pos-common
  • npm run test:cart-price-override
  • npm run test:cart-variant-identity
  • npm run build && npm run build:frontend
  • cd frontend && npx playwright test e2e/layout-integrity.spec.ts -g "POS " --project=chromium
  • cd frontend && npx playwright test e2e/pos-keyboard-shortcuts.spec.ts e2e/multi-counter-ordering.spec.ts --project=chromium
  • cd frontend && npx playwright test e2e/server-app-ordering.spec.ts --project=chromium
  • cd frontend && npx playwright test e2e/cart-redesign-verification.spec.ts --project=chromium
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

@coderabbitai

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

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Compact POS cart into a two-tier layout

✨ Enhancement 🕐 20-40 Minutes

Grey Divider

AI Description

• Condenses cart rows so more items remain visible on desktop without removing item controls.
• Shows addon-inclusive line totals alongside inline addons, instructions, and grouped actions.
• Reduces header and footer height with a compact PAX stepper, notes input, and summary.
Diagram

graph TD
  Store["Cart store"] --> Panel(["Cart panel"]) --> Rows["Two-tier rows"] --> Prices["Price helpers"]
  Panel --> Header["Compact header"]
  Panel --> Footer["Compact footer"]
Loading
High-Level Assessment

Keeping this bounded redesign in CartPanel is appropriate: it preserves the existing cart state, actions, and price helpers without introducing a new UI abstraction for a single layout change. Extracting components was considered but would add indirection without a clear reuse need.

Files changed (1) +178 / -147

Enhancement (1) +178 / -147
CartPanel.tsxMake POS cart rows, header, and footer more compact +178/-147

Make POS cart rows, header, and footer more compact

• Reworks item rows into two tiers with addon-inclusive unit and line prices, inline addons and instructions, and grouped quantity, edit, override, and remove controls. Shrinks header and list spacing, changes PAX controls to a pill group, and replaces multiline order notes and stacked totals with compact footer elements.

frontend/src/components/pos/CartPanel.tsx

@qodo-code-review

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

Copy link
Copy Markdown

Code Review by Qodo

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

Grey Divider


Remediation recommended

1. Cashiers get undersized cart action targets 📎 Requirement gap ≡ Correctness
Description
CartPanel’s compact button classes override the shared .touch-target minimum with 24px dimensions
on item and quantity controls, while the order-type tabs use h-8 min-h-8 instead of the specified
min-h-9. The smaller hit areas affect price override, edit, remove and PAX controls as well as
order-type selection in both the desktop cart and mobile drawer.
Code

frontend/src/components/pos/CartPanel.tsx[R714-718]

+                        type="button"
+                        onClick={() => cart.removeItem(item.id)}
+                        className="order-last touch-target h-6 w-6 min-h-6 min-w-6 shrink-0 rounded-md text-muted-foreground transition-colors hover:bg-red-50 hover:text-red-500 dark:hover:bg-red-950/40 dark:hover:text-red-400 active:bg-red-50 dark:active:bg-red-950/40"
+                        aria-label={t('remove')}
+                        title={t('remove')}
Relevance

●●● Strong

Similar CartPanel touch-target and localized control sizing feedback was accepted, matching the PR’s
touch-friendly intent.

PR-#727

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The shared .touch-target rule defines a 44px minimum width and height, but the cart controls
retain that class while explicitly setting h-6 w-6 min-h-6 min-w-6, producing 24px targets. The
order-type tabs likewise retain the touch-target label while setting h-8 min-h-8, which is shorter
than the specified min-h-9 segmented bar; the POS also renders these controls in a mobile drawer.

Compact two-tier cart items with full controls
frontend/src/components/pos/CartPanel.tsx[714-746]
frontend/src/app/globals.css[73-80]
frontend/src/app/globals.css[72-80]
frontend/src/components/pos/CartPanel.tsx[113-135]
frontend/src/components/pos/CartPanel.tsx[714-745]
frontend/src/app/(dashboard)/pos/page.tsx[3631-3640]
frontend/src/components/pos/CartPanel.tsx[386-386]

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

## Issue description
Compact sizing overrides reduce the interactive areas of cart item, quantity and PAX controls below the shared 44×44px touch-target size. Order-type tabs also use `h-8 min-h-8` instead of the specified `min-h-9` segmented-bar height.

## Fix Focus Areas
- frontend/src/components/pos/CartPanel.tsx[116-168]
- frontend/src/components/pos/CartPanel.tsx[386-430]
- frontend/src/components/pos/CartPanel.tsx[714-746]
- frontend/src/app/globals.css[73-80]

## Recommended Fix
Remove the `h-6`, `w-6`, `min-h-6` and `min-w-6` overrides from item, quantity and PAX buttons, or preserve their compact appearance with spacing or a larger transparent hit area that maintains at least 44×44px interactive bounds. Change the order-type tabs to retain `touch-target` and use at least `min-h-9` for the segmented bar while preserving compact horizontal padding; verify rendered button bounds in both the sidebar and mobile drawer.

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

Dismiss ↗ | View ↗


2. Large subtotals push the footer wide ✓ Resolved
Description
The merged summary places the item count beside a non-wrapping subtotal label and amount without a
shrink or wrap strategy. On the fixed-width cart, a long localized subtotal and large formatted
amount can consume the row's available width before the item count is added, pushing summary content
outside the panel where the previous separate rows could fit.
Code

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

+        <div className="mb-2 flex items-baseline justify-between gap-2">
Relevance

●● Moderate

Potential localized currency overflow is plausible, but no close historical precedent confirms
acceptance of this footer layout concern.

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The cart is 320 pixels wide and the new footer has horizontal padding, leaving 296 pixels for a
single flex row. That row now contains both the item count and the subtotal group; the German
subtotal translation is longer than the English label, and the formatted amount depends on tenant
currency.

frontend/src/app/(dashboard)/pos/page.tsx[3572-3575]
frontend/src/components/pos/CartPanel.tsx[757-760]
frontend/src/components/pos/CartPanel.tsx[781-793]
frontend/src/lib/i18n/messages/de.json[158-158]
frontend/src/hooks/useFormatCurrency.ts[4-13]

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 new single-row summary can exceed the narrow cart width when translated labels or currency amounts are long.
## Fix Focus Areas
- frontend/src/components/pos/CartPanel.tsx[781-793]
## Recommended Fix
Allow the item count and subtotal group to wrap or stack when their combined content does not fit. Keep both values visible and test the fixed-width cart with a long translation and a large formatted amount.

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


Grey Divider

Context sources
✅ Compliance rules (platform): 5 rules
✅ Cross-repo context — repo relationships
Review mode: Auto: ⚖️ Balanced: Behavioral UI redesign has multiple interaction, pricing, responsive, and RTL risks.

Grey Divider

Tip of the day
💡 Did you know, you can tweak Display settings with a live preview to see your comment before it ships

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

Redesign the POS CartPanel to a compact 2-tier item layout with inline de-boxed Pax stepper, unit-price caption, inline dot-separated addons and special instructions, compact action cluster, single-line order notes input, and merged items/subtotal footer row so 5-6+ items fit on desktop viewports.

Fixes #1436
@khaira777
khaira777 force-pushed the fm/flocafe-pos-cart-redesign-r1 branch from 661bbbe to 2a73555 Compare November 3, 2026 19:42
@khaira777
khaira777 merged commit 10facbc into main Nov 3, 2026
23 checks passed
@khaira777
khaira777 deleted the fm/flocafe-pos-cart-redesign-r1 branch November 3, 2026 20:11
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.

feat(pos): compact 2-tier cart panel layout to show 5-6+ items at once

1 participant