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:
@@ -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' } })
|
||||
|
||||
@@ -88,6 +88,13 @@ try {
|
||||
await p.getByText('Print kitchen tickets').click()
|
||||
r.check('switch: the label toggles it', await p.getByRole('switch', { name: 'Print kitchen tickets' }).getAttribute('aria-checked') === 'false')
|
||||
|
||||
// Stepper (3.2b-2): steps, ends disabled
|
||||
const stepper = p.getByRole('group', { name: 'Check every' })
|
||||
await stepper.getByRole('button', { name: 'More' }).click()
|
||||
r.check('stepper: + moves to the next step', (await stepper.textContent()).includes('45s'))
|
||||
await stepper.getByRole('button', { name: 'More' }).click()
|
||||
r.check('stepper: + is disabled at the last step', (await stepper.textContent()).includes('60s') && await stepper.getByRole('button', { name: 'More' }).isDisabled())
|
||||
|
||||
// InfoTip
|
||||
const tip = p.getByRole('button', { name: 'More info' }).first()
|
||||
await tip.click()
|
||||
|
||||
Reference in New Issue
Block a user