feat(ui): board design language as global tokens; KDS on tokens and shared components (platform-v2 3.2b-2)

- @xenia/ui: --x-board-* tokens (the kitchen display's look: dark board, light cards,
  status colours, card radius/shadows, number font), Tailwind board.* colours, contrast
  test for the board pairs; near-identical shades merged.
- New shared Stepper component (gallery + ui.mjs), labels ui.decrease / ui.increase.
- KDS: theme.js maps to the board tokens, no colour literals left (only stored setting
  values); decline / call waiter / settings use Dialog, Button, Switch, Select, Stepper;
  toasts are @xenia/ui toasts (ToastProvider at the terminal root).
- Terminal: apps can set their theme (APP_THEMES, KDS dark) while they run.
- CS-16: board screens and "no hard-coded colours in app code".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-14 20:02:35 +02:00
co-authored by Claude Opus 5.5
parent 5f6d4ab428
commit 77e0adbe9c
26 changed files with 485 additions and 383 deletions
+7 -2
View File
@@ -199,6 +199,8 @@ try {
r.check('3.2b: a long press shows the quick actions', await shown(page, 'quick-decline', 3000))
await page.getByTestId('quick-decline').click()
await page.locator('[data-reason="out_of_stock"]').click()
await sleep(400) // let colour transitions finish
await page.screenshot({ path: path.join(OUT, 'terminal-kds-decline.png') })
await page.getByTestId('decline-confirm').click()
await sleep(800)
const declined = (await api('GET', `/api/kds/orders?zone_id=${grill.id}`, { token: boss })).orders.find(o => o.id === opened.id)
@@ -209,8 +211,11 @@ try {
await page.getByTestId('kds-settings').click()
r.check('3.2b: the screen\'s settings: a chef sees them, with "only a manager"', await shown(page, 'kds-settings-panel', 3000)
&& await page.getByTestId('settings-no-permission').count() === 1 && await page.getByTestId('settings-save').isDisabled())
await page.keyboard.press('Escape').catch(() => {})
await page.getByTestId('kds-settings-panel').getByRole('button', { name: 'Close' }).click()
await page.getByTestId('settings-tab-age').click()
await sleep(400) // let colour transitions finish
await page.screenshot({ path: path.join(OUT, 'terminal-kds-settings.png') })
await page.keyboard.press('Escape')
r.check('3.2b-2: the settings are a shared dialog (Escape closes it)', await page.getByTestId('kds-settings-panel').waitFor({ state: 'detached', timeout: 3000 }).then(() => true).catch(() => false))
// a change made elsewhere (another screen, the waiter) reaches this screen live
await api('PUT', `/api/kds/orders/${second.id}/kds_status`, { token: boss, body: { status: 'pending' } })