Skip to content

Feature: Customer-facing display on a second monitor #362

Open

Description

@khaira777

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=desktop static export and works 100% offline.

Scope / Acceptance Criteria

  • Shared Secondary Display Window Manager (main/display-window.ts, absorbed from #593): Enumerate monitors via screen.getAllDisplays() / screen.getPrimaryDisplay(), subscribe to display-added / display-removed, manage borderless fullscreen BrowserWindow lifecycle 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 | future Menu Board Channel for #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 #1449 payment QR and #364 Phase 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

  1. 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.
  2. Focus preservation: Verify platform-specific showInactive() / focusable: false behavior 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 #364 interactive tip tap; full self-service lives in #367).
  • Video playlist/media signage channels (owned by #594, which will reuse main/display-window.ts).

Activity

  1. added
    enhancement
    area:frontend
    area:backend
    on Aug 17, 2026
  2. added
    ready-for-dev
    priority:high
    and removed
    ready-for-dev
    priority:high
    on Sep 18, 2026
  3. added
    type:feature
    state:needs-design
    on Sep 21, 2026
  4. added
    priority:normal
    on Nov 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:backendarea:frontendenhancementpriority:normalstate:needs-designtype:feature

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions