Second sub-phase of NIX-OS-69. Builds on 69.1 (table + DAO + POS hook) by shipping the
visible Kitchen Display: a public route at /cafe/kitchen/[shopId]?t={secret},
GET/POST API endpoints, optimistic-UI client with 5s polling and Start/Ready/Served
buttons, and a clickable POS TopBar ChefHat pill that opens the display in
a new window.
tsx: secret
validation (wrong → null, right → shop), full state machine
(new → preparing → ready → served) with started_at /
ready_at / served_at stamping, served orders drop out of the
active list, advance handler returns 404 / 400 / 409 / 200 in the right cases, GET handler
filters served orders out. Authed routes (/cafe/pos,
/cafe/pos/register/6) still 307 — no regression.
/login, /display/*,
/kitchen/*) return 500 from webpack HMR staleness on this machine
— documented in project_dev_server_bypass_routes_500.md. Authed
routes that go through the normal redirect work fine. The route handlers were exercised
in-process via tsx instead, and Gate 2 prod will cover the real HTTP
contract end-to-end.
app/(public-kitchen)/layout.tsx — minimal
full-height shell, no NIX chrome.app/(public-kitchen)/kitchen/[shopId]/page.tsx
— validates the shop secret server-side, server-renders the initial order
list (so a cold worker shows current state immediately), passes data to the
client.kitchen-client.tsx — three columns
(New / Preparing / Ready), per-order card with line items + customer + note +
elapsed-time chip, big touch buttons (Start / Ready / Served), 5s polling, optimistic
state transitions with rollback on failure./cafe/api/kitchen/[shopId]/orders?t={secret} —
active orders only (FIFO)./cafe/api/kitchen/[shopId]/advance?t={secret} —
validates secret + shop scope + linear transition (new→preparing,
preparing→ready, ready→served). Cross-shop
tampering returns 404 (no ID enumeration leak).ChefHat pill from 69.1 is now a
clickable button that window.opens the Kitchen Display URL with the
shop's lazy-created secret./kitchen/* + /api/kitchen/*
added to the bypass set (mirrors the Customer Display pattern from R1.7).Loading…
Loading…
Loading…
Loading…