feat(terminal): kitchen display on paired screens, live without polling (platform-v2 3.2b)

Port of the manager's KdsPage.jsx into terminal/src/apps/kds, split into pure logic
(layout packing, age, buckets, rounds, totals, status cycle, settings; unit-tested) and
components (card, item, action bars, dialogs, item totals, rails, settings panel).
- Settings are the device's config; the settings panel saves them (managers only),
  zoom changes the size for the session.
- Orders reload on live events and every reconnect; polling only while the live
  connection is down (DeviceProvider exposes liveUp; useLiveEvents helper).
- "Tap to start" unlocks sound; venue clock via useFormat; English-first texts.
- Undo of an item recomputes the order status at once; undo/redo clear the selection.
- Tests: terminal unit +15, terminal.mjs +12 KDS checks (no polling, live order + chime,
  item/undo/prepare/decline, settings permission, change made elsewhere), backend
  regression for an item back to pending.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-14 19:27:11 +02:00
co-authored by Claude Opus 5.5
parent d5c4400fde
commit 5f6d4ab428
24 changed files with 2550 additions and 12 deletions
+10
View File
@@ -143,3 +143,13 @@ def test_settings_changed_from_the_screen(client, screen, make_user, kitchen):
# without a device it's not a screen
assert err(client.patch("/api/devices/me/config", headers={"Authorization": h["Authorization"]},
json={"config": {}})) in ("device.not_paired", "device.required")
def test_item_back_to_pending_reopens_the_order(client, screen, kitchen):
"""Undo on the screen (3.2b): an item done → back to pending puts the order back too."""
h, oid = screen["h"], kitchen["order"].id
item = client.get("/api/kds/orders", headers=h).json()["orders"][0]["items"][0]["id"]
for status, expected in (("done", "preparing"), ("pending", "pending")): # the Bar item is still to do
assert client.put(f"/api/kds/orders/{oid}/items/{item}/kds_status", headers=h, json={"status": status}).status_code == 200
order = next(o for o in client.get("/api/kds/orders", headers=h).json()["orders"] if o["id"] == oid)
assert order["kds_status"] == expected