Skip to content

feat(pos): redesign cart-first layout with order details drawer and scheduled orders toggle - #1458

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

khaira777 merged 4 commits into
mainfrom
fm/flocafe-cart-responsive-redesign-r1

Conversation

@khaira777

Copy link
Copy Markdown
Contributor

Intent

On the FloCafe POS page, clicking on Delivery or Takeaway expands large order-detail and kitchen-scheduling sections above the cart items, and on small screens those sections push the cart items out of view. Even proposed compact mockups still leave too much lost vertical space at the bottom of the cart and a little bit at the top. Redesign and implement a cart-first responsive layout in FloCafe POS that eliminates wasted space at both the top and bottom of the cart across all order types (Dine in, Takeaway, Delivery, Online), keeps order details accessible via a one-tap summary and slide-over details drawer, preserves all existing order data/validation/checkout behavior, and keeps cart items clearly visible on small and short screens. Also add an enable/disable toggle for Scheduled Orders (like Multi-Counter) so scheduled-order options and POS controls are only visible/configurable when enabled, keeping the POS clean when disabled.

What Changed

  • Replaced inline POS cart order-detail and kitchen-scheduling blocks with a compact one-tap order summary bar (CartPanel.tsx) and a slide-over OrderDetailsDrawer (OrderDetailsDrawer.tsx), reducing cart header/footer chrome and lowering the short-viewport whole-cart scroll breakpoint to 500px (globals.css).
  • Added a scheduled_orders_enabled store setting (default 'false') to /api/settings (main/routes/settings.ts) and Settings > POS (settings/page.tsx, Toggle.tsx), gating the POS topbar scheduled-orders button (PosTopbar.tsx), kitchen scheduling controls, and scheduled_for checkout/cart-fingerprint state (pos/page.tsx).
  • Updated POS architecture and API documentation (docs/) and expanded unit and Playwright E2E coverage for the order details drawer, compact cart layout, and scheduled-orders setting toggle (tests/, frontend/e2e/).

Risk Assessment

✅ Low: The POS cart-first layout redesign, order-details drawer, and scheduled_orders_enabled setting toggle are well-bounded, preserve existing order/payment/scheduling behavior, and have thorough unit, SSR, and E2E coverage.

Testing

Ran the focused SSR and RTL regression suites (test:ui-regressions-621-623-626, test:rtl-dashboard-pos-common), the backend/integration scheduled-orders suite (test:scheduled-orders), built the backend and static frontend, and drove the live Chromium Playwright E2E suites (scheduled-orders.spec.ts, multi-counter-ordering.spec.ts, and the short-viewport cart scroll describe block in layout-integrity.spec.ts) against an isolated E2E server instance, capturing visual screenshot evidence in the evidence directory; all checks and live scenarios passed.

  • Live validation: ✅ go - 5 of 5 scenarios driven live against the product
Scenario Result Live Evidence
With Scheduled Orders disabled by default, the POS hides the topbar Scheduled button and cart scheduling controls across Takeaway and Delivery while keeping the cart header and footer compact. ✅ pass live 00a-pos-scheduled-orders-disabled-clean-cart.png; frontend/e2e/scheduled-orders.spec.ts; tests/issue-360-scheduled-orders.test.ts
Enabling the Scheduled Orders switch in Settings > POS Workflow persists scheduled_orders_enabled=true (while rejecting non-boolean API writes with HTTP 400) and exposes the POS Scheduled button and T… ✅ pass live 00b-settings-pos-scheduled-orders-toggle.png; frontend/e2e/scheduled-orders.spec.ts; tests/issue-360-scheduled-orders.test.ts
On a short 1024x600 screen, switching between Dine in and Delivery keeps the cart items scroll container at >= 300px height with the last cart item and Place Order button visible and reachable inside… ✅ pass live 00c-pos-short-screen-1024x600-delivery-cart.png; frontend/e2e/layout-integrity.spec.ts; frontend/e2e/scheduled-orders.spec.ts
Clicking the one-tap order-details summary strip opens the slide-over OrderDetailsDrawer to configure Delivery address/payment/notes, Online platform/external order ID, or kitchen schedule time, and p… ✅ pass live 01a-pos-order-details-drawer-open.png; 01-pos-send-to-kitchen-at.png; frontend/e2e/scheduled-orders.spec.ts; frontend/e2e/multi-counter-ordering.spec.ts
Adversarial: Entering a past kitchen schedule time in OrderDetailsDrawer displays an inline schedule error in both the drawer and the compact summary strip and disables Place Order until a valid futur… ✅ pass live frontend/e2e/scheduled-orders.spec.ts; tests/issue-360-scheduled-orders.test.ts

POS Delivery cart when Scheduled Orders is disabled (compact summary strip and collapsed order notes)
Settings > POS Workflow > Scheduled Orders toggle enabled
POS short screen (1024x600) Delivery cart keeping cart items clearly visible (>= 300px height)
Slide-over OrderDetailsDrawer open for editing kitchen schedule and order notes
POS Takeaway cart summary strip showing scheduled kitchen release time

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 - 5 of 5 scenarios driven live against the product
Scenario Result Live Evidence
With Scheduled Orders disabled by default, the POS hides the topbar Scheduled button and cart scheduling controls across Takeaway and Delivery while keeping the cart header and footer compact. ✅ pass live 00a-pos-scheduled-orders-disabled-clean-cart.png; frontend/e2e/scheduled-orders.spec.ts; tests/issue-360-scheduled-orders.test.ts
Enabling the Scheduled Orders switch in Settings > POS Workflow persists scheduled_orders_enabled=true (while rejecting non-boolean API writes with HTTP 400) and exposes the POS Scheduled button and T… ✅ pass live 00b-settings-pos-scheduled-orders-toggle.png; frontend/e2e/scheduled-orders.spec.ts; tests/issue-360-scheduled-orders.test.ts
On a short 1024x600 screen, switching between Dine in and Delivery keeps the cart items scroll container at >= 300px height with the last cart item and Place Order button visible and reachable inside… ✅ pass live 00c-pos-short-screen-1024x600-delivery-cart.png; frontend/e2e/layout-integrity.spec.ts; frontend/e2e/scheduled-orders.spec.ts
Clicking the one-tap order-details summary strip opens the slide-over OrderDetailsDrawer to configure Delivery address/payment/notes, Online platform/external order ID, or kitchen schedule time, and p… ✅ pass live 01a-pos-order-details-drawer-open.png; 01-pos-send-to-kitchen-at.png; frontend/e2e/scheduled-orders.spec.ts; frontend/e2e/multi-counter-ordering.spec.ts
Adversarial: Entering a past kitchen schedule time in OrderDetailsDrawer displays an inline schedule error in both the drawer and the compact summary strip and disables Place Order until a valid futur… ✅ pass live frontend/e2e/scheduled-orders.spec.ts; tests/issue-360-scheduled-orders.test.ts
  • npm run test:ui-regressions-621-623-626
  • npm run test:rtl-dashboard-pos-common
  • npm run test:scheduled-orders
  • npm run build && npm run build:frontend
  • 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 EVIDENCE_DIR=~/.no-mistakes/evidence/01M6J3JNHMFG1QS15Y2M4BFX38 npx playwright test scheduled-orders.spec.ts multi-counter-ordering.spec.ts --config=playwright.config.ts --project=chromium
  • 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 layout-integrity.spec.ts -g "checkout controls stay visible while catalog and cart content scroll" --config=playwright.config.ts --project=chromium
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

@coderabbitai

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

Redesign POS cart layout and add a scheduled-orders toggle

✨ Enhancement ⚙️ Configuration changes 🧪 Tests 📝 Documentation 🕐 40+ Minutes

Grey Divider

AI Description

• Move order details into a slide-over drawer, keeping cart items visible on short screens.
• Add a default-off Scheduled Orders setting that hides POS controls and excludes scheduling from
 checkout when disabled.
• Expand regression coverage and document the new cart workflow and setting.
Diagram

graph TD
  SettingsUI["Settings POS"] --> SettingsAPI["Settings API"] --> POSPage["POS page"] --> CartPanel["Cart panel"] --> DetailsDrawer["Details drawer"] --> CartStore["Cart store"]
  POSPage --> Topbar["POS topbar"]
  POSPage --> Checkout["Checkout flows"]
Loading
High-Level Assessment

The compact summary and shared-store drawer fit the cart-first goal without duplicating order state or changing the checkout model. Collapsible inline sections would still displace cart items when opened, so the drawer is the better fit for short viewports.

Files changed (17) +1099 / -272

Enhancement (4) +792 / -250
page.tsxGate POS scheduling and tighten page spacing +64/-19

Gate POS scheduling and tighten page spacing

• Loads the Scheduled Orders setting, suppresses queue polling and scheduled_for submission when disabled, and excludes disabled scheduling from cart fingerprints. Reduces outer padding to give the cart more room.

frontend/src/app/(dashboard)/pos/page.tsx

globals.cssReserve whole-cart scrolling for shorter viewports +1/-1

Reserve whole-cart scrolling for shorter viewports

• Lowers the whole-cart scroll breakpoint from 680px to 500px so the item area retains height on moderately short screens.

frontend/src/app/globals.css

CartPanel.tsxReplace inline details with a compact cart summary +352/-230

Replace inline details with a compact cart summary

• Moves delivery, online, and scheduling fields into the new drawer while summarizing relevant details above cart items. Compacts header and footer spacing, collapses empty order notes, and retains scheduling errors in the cart when enabled.

frontend/src/components/pos/CartPanel.tsx

OrderDetailsDrawer.tsxAdd order-type-specific details drawer +375/-0

Add order-type-specific details drawer

• Provides dine-in guest count, delivery details and expected collection method, online identifiers, order notes, and optional kitchen scheduling in a slide-over sheet. Edits the existing cart store directly.

frontend/src/components/pos/OrderDetailsDrawer.tsx

Tests (7) +249 / -16
layout-integrity.spec.tsRaise the short-screen cart visibility threshold +3/-3

Raise the short-screen cart visibility threshold

• Requires at least 300px of cart-item scroll area at 1024×600 for standard and delivery carts.

frontend/e2e/layout-integrity.spec.ts

multi-counter-ordering.spec.tsAdapt multi-counter flows to the details drawer +30/-2

Adapt multi-counter flows to the details drawer

• Enables and restores scheduled orders for the scenario, and enters delivery or online details through the new drawer.

frontend/e2e/multi-counter-ordering.spec.ts

scheduled-orders.spec.tsCover the setting and drawer in scheduled-order flows +72/-10

Cover the setting and drawer in scheduled-order flows

• Checks disabled and enabled POS controls, Settings toggle persistence, drawer-based schedule editing, and cart space on a short screen. Restores the setting after the scenario.

frontend/e2e/scheduled-orders.spec.ts

Toggle.tsxSupport a test identifier on settings toggles +6/-1

Support a test identifier on settings toggles

• Adds an optional data-testid prop for locating the Scheduled Orders switch in E2E tests.

frontend/src/components/settings/Toggle.tsx

issue-360-scheduled-orders.test.tsTest scheduled-orders setting validation +37/-0

Test scheduled-orders setting validation

• Verifies the false default, rejection of invalid values, and persistence after enabling the setting.

tests/issue-360-scheduled-orders.test.ts

rtl-dashboard-pos-common.test.tsInclude the drawer in dashboard component coverage +1/-0

Include the drawer in dashboard component coverage

• Adds OrderDetailsDrawer to the POS component files covered by the common RTL test suite.

tests/rtl-dashboard-pos-common.test.ts

ui-regressions-621-623-626.test.tsAssert compact cart and drawer rendering +100/-0

Assert compact cart and drawer rendering

• Checks summary content, collapsed notes, conditional scheduling controls, and delivery fields in the drawer through rendered markup.

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

Documentation (3) +7 / -4
frontend.mdDescribe delivery details in the cart drawer +2/-1

Describe delivery details in the cart drawer

• Updates the delivery-printing context to reflect that delivery details and address appear in the cart summary and drawer.

docs/architecture/frontend.md

order-lifecycle.mdDocument scheduled-orders visibility +4/-2

Document scheduled-orders visibility

• Explains that the POS scheduling controls and queue depend on a default-off setting, while order-type restrictions remain in place.

docs/architecture/order-lifecycle.md

api.mdList the new writable setting +1/-1

List the new writable setting

• Adds scheduled_orders_enabled to the documented settings API allow-list.

docs/reference/api.md

Other (3) +51 / -2
page.tsxAdd the Scheduled Orders POS toggle +44/-0

Add the Scheduled Orders POS toggle

• Reads and saves the default-off setting from Settings > POS with optimistic feedback and write-state handling.

frontend/src/app/(dashboard)/settings/page.tsx

PosTopbar.tsxHide the scheduled-orders button when disabled +3/-1

Hide the scheduled-orders button when disabled

• Shows the scheduled-orders queue button only when the store setting is enabled.

frontend/src/components/pos/PosTopbar.tsx

settings.tsRegister the default-off Scheduled Orders setting +4/-1

Register the default-off Scheduled Orders setting

• Adds scheduled_orders_enabled to optional setting defaults and permitted wildcard keys, with Boolean-value validation on writes.

main/routes/settings.ts

@qodo-code-review

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

Copy link
Copy Markdown

Code Review by Qodo

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

Grey Divider


Action required

1. Pending scheduled orders vanish from the POS by default ✓ Resolved

Resolving commit: 71425b8

Resolution reason
The POS now continues polling scheduled orders regardless of the creation setting and keeps the
scheduled-orders button visible when scheduled or blocked orders exist. Scheduling creation remains
gated, with the backend returning a clear 409 error when disabled.
Description
The new scheduled_orders_enabled setting defaults to 'false', and while it is off
refreshScheduledOrders stops fetching and the topbar scheduled-orders button (the only way to open
ScheduledOrdersDrawer) is hidden. On upgrade, any store that already has orders with
release_status scheduled or blocked loses the queue, the badge counts, and the
Release/Reschedule actions. Blocked orders are skipped by the automatic sweep and can only be
released by hand, so they stay stuck with no warning in the POS.

2. A setting change can duplicate an order ✓ Resolved

Resolving commit: 71425b8

Resolution reason
Added schedule-toggle-aware fingerprint matching so unresolved postpaid and prepaid attempts remain
recoverable when scheduling is disabled. The original scheduled time and stored attempt/idempotency
key are preserved instead of creating a replacement submission.
Description
buildCartFingerprint substitutes an empty schedule whenever the current scheduledOrdersEnabled
flag is false, even if an unresolved checkout attempt was saved with a schedule. If the setting is
disabled before that attempt is recovered, postpaid and prepaid checkout no longer match its stored
fingerprint and can submit the cart with a new idempotency key.


Remediation recommended

3. Some cashiers lose scheduled ordering ✓ Resolved

Resolving commit: 71425b8

Resolution reason
Added a dedicated scheduled_orders_enabled read endpoint that permits settings.view, orders.read, or
orders.create, allowing order-taking roles to read the feature flag while leaving writes separately
restricted.
Description
POSPage reads scheduled_orders_enabled through the generic settings endpoint, which requires
settings.view, and treats a rejected read as a disabled feature. A cashier permitted to create
orders but denied settings access therefore cannot use scheduling or its queue even when the store
has enabled them.

4. A tenant switch shows the prior queue ✓ Resolved

Resolving commit: 71425b8

Resolution reason
The POS now immediately resets scheduled-order state when the tenant changes, including the enabled
flag, drawer visibility, orders, cursor, and counts. Queue refresh and pagination requests also
capture the originating store ID and ignore responses from a different store, preventing stale data
from repopulating the queue.
Description
POSPage retains scheduledOrdersEnabled and the scheduled-order list when currentStoreId
changes, clearing them only after a new setting read reports that scheduling is disabled. If staff
switch from an enabled store while its queue is open, the previous store's drawer and orders can
remain visible until that read finishes, and the old polling callback can still update the list.

5. Turning scheduling off does not stop scheduled orders ✓ Resolved

Resolving commit: 71425b8

Resolution reason
Order creation now checks scheduled_orders_enabled for new scheduled orders and returns HTTP 409
with SCHEDULED_ORDERS_DISABLED when scheduling is disabled; the error code is also exposed in the
API response.
Description
scheduled_orders_enabled is only checked in the frontend; the PUT handler simply stores the value.
The order-create routes still accept scheduled_for when the flag is off, unlike
multi_counter_enabled, which rejects new deferred tickets with MULTI_COUNTER_DISABLED. Any other
client or stale POS tab (the flag is only read when the store changes) can keep creating deferred
kitchen orders that the POS no longer shows.

View medium (1)
6. The test leaves scheduling disabled ✓ Resolved

Resolving commit: 71425b8

Resolution reason
The test now reads and retains the prior scheduled_orders_enabled value before setup, then restores
that exact value during teardown and verifies that restoration succeeded.
Description
scheduled-orders.spec.ts forces scheduled_orders_enabled to false in setup and unconditionally
writes false again in teardown instead of restoring its prior value. Running the test against a
store where scheduling was enabled changes that store's configuration after the test, including when
the test fails partway through.

Grey Divider

Context sources
✅ Compliance rules (platform): 5 rules
✅ Cross-repo context — repo relationships
  Explored: repo: FreeOpenSourcePOS/docs.flopos.com (sha: abe7cff3) — View relationship
Review mode: Auto: 🧠 Deep: Broad POS behavior changes span UI, settings, checkout, scheduling, and many independent paths.

Grey Divider

Tip of the day
💡 Did you know, you can commit Qodo's fix in one click with committable suggestions (GitHub & GitLab)

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

Comment thread frontend/e2e/scheduled-orders.spec.ts Resolved
Comment thread main/routes/settings.ts Resolved
Comment thread main/routes/settings.ts Resolved
@khaira777
khaira777 merged commit 013e2f7 into main Nov 4, 2026
23 checks passed
@khaira777
khaira777 deleted the fm/flocafe-cart-responsive-redesign-r1 branch November 4, 2026 04:19
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