Repository navigation
Open
Labels
area:backendBackend (Express/SQLite)area:frontendFrontend (React/Next.js)enhancementNew feature or requestpriority:normalNormal priority against the backlogstate:needs-designNeeds a design/scope decision before work startstype:featureNew capability or enhancement request
Description
Problem
Dual-screen POS terminals need a dedicated customer-facing display running natively in a second Electron BrowserWindow on an attached external monitor showing a live, sanitized view of the active cart, subtotal, tax, discount, and payable total - plus automatic launch alongside the POS window at OS boot (reported in Nov 2026 merchant support). FloCafe also needs one shared Electron secondary-monitor manager (main/display-window.ts, consolidated from #593) so Customer Display (live cart or order-status board) and future Digital Signage (#594) never duplicate display-window lifecycle code.
Codebase Anchor
- Already shipped order-status display (
#1530/#1531):frontend/src/app/customer-display/page.tsx,frontend/src/components/settings/CustomerDisplayCard.tsx,main/routes/customer-display-feed.ts,main/services/customer-display-config.ts,main/services/customer-display-tokens.ts(rolling page indicator, timer bar, order-type filter, POS ready/picked-up controls). - Electron lifecycle & IPC:
main/index.ts,main/ipc.ts,main/preload.ts,main/window-options.ts,main/window-recovery.ts. - POS Cart state:
frontend/src/store/cart.ts,frontend/src/components/pos/PaymentModal.tsx.
Core Invariants & Constraints
- Strict sanitization & zero PII: The secondary window receives only sanitized display payloads (
{ businessName, items, subtotal, tax, discount, charges, total, paymentQr?, tipPrompt?, status }) - never staff JWTs, admin controls, customer phone/address PII, or unrestricted IPC bridges. - Crash & hot-unplug isolation: Unplugging or powering off the secondary HDMI/USB display (
screen.on('display-removed')) or a renderer crash on the customer window must clean up gracefully without interrupting or stealing focus from the primary cashier POS window. - Desktop static export compatibility: Secondary window route loads cleanly under
NEXT_BUILD_MODE=desktopstatic export and works 100% offline.
Scope / Acceptance Criteria
- Shared Secondary Display Window Manager (
main/display-window.ts, absorbed from#593): Enumerate monitors viascreen.getAllDisplays()/screen.getPrimaryDisplay(), subscribe todisplay-added/display-removed, manage borderless fullscreenBrowserWindowlifecycle positioned at target display bounds, and expose safe preload IPC channels (display:list,display:open,display:close,display:push-cart). - Settings UI (
CustomerDisplayCard.tsx): Add "Secondary Monitor Display" controls: Enable toggle, Target Monitor selector, Content Mode (Live Cart & Total|Order Status Board| futureMenu Board Channelfor#594), Test Display button, and "Open automatically on app startup / OS boot" toggle (so dual-screen terminals launch both operator and customer windows together cleanly). - Live Cart & Checkout Sync: Push sanitized cart/checkout state over main-process IPC (
POS BrowserWindow -> main -> CustomerDisplay BrowserWindow) with idle welcome/branding screen when cart is empty, and extensible slots for#1449payment QR and#364Phase 2 tip prompt. - Add Electron main-process unit tests for display bounds selection, disconnect cleanup, and payload sanitization wired into
package.json.
Concrete Design Decisions to Lock Before Coding
- OS boot auto-launch integration: Confirm whether Settings should also expose Electron's
app.setLoginItemSettings("Launch FloCafe at login") paired with "Auto-open customer display on startup", or keep OS login-item config separate. - Focus preservation: Verify platform-specific
showInactive()/focusable: falsebehavior on Windows, macOS, and Linux so opening/updating the customer screen never steals keyboard/barcode-scanner focus from the cashier.
Out of Scope
- Interactive touch input on the secondary monitor (Phase 2 for
#364interactive tip tap; full self-service lives in#367). - Video playlist/media signage channels (owned by
#594, which will reusemain/display-window.ts).
Metadata
Metadata
Assignees
Labels
area:backendBackend (Express/SQLite)area:frontendFrontend (React/Next.js)enhancementNew feature or requestpriority:normalNormal priority against the backlogstate:needs-designNeeds a design/scope decision before work startstype:featureNew capability or enhancement request
Activity