Skip to content
Merged
8 changes: 6 additions & 2 deletions docs/architecture/frontend.md
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,11 @@ against `en.json`, the derived print-label table, and a `tsc` pass over the fron
orders in a Preparing column (`pending`, `preparing`) and a Ready column (`ready`). It re-reads
`GET /settings/customer-display` on every poll, so changes made in Settings > Kitchen Display apply
without reloading the board. The tenant-wide config sets which statuses show, the refresh interval,
and whether the last-updated time is shown. The same settings card shows the display URL with copy
and whether the last-updated time is shown. At desktop widths, each column renders complete bill or
order numbers in readable rows and independently rotates measured pages every ten seconds when
needed. Newly ready orders take priority on the next rotation, interleaved with existing pages. At
narrow widths the rows remain in one scrollable flow. A failed poll retains the last successful
orders and reports that the feed is stale. The same settings card shows the display URL with copy
and open actions. Strings come from the `customerDisplay` message namespace.

An owner or manager can also pair a standalone device (a TV or tablet browser) from the same card.
Expand All @@ -475,7 +479,7 @@ offers only the local preview; if address lookup fails, it shows an error and re
moves the token from the URL fragment into `localStorage` and polls
`GET /api/customer-display/feed` with it instead of using a staff session, so it needs no login and
can read nothing but order numbers and statuses. When the feed answers `401` (the token was
revoked), the board clears the stored token and shows an unpaired screen.
revoked), the board clears the stored token and orders, then shows an unpaired screen.

## Tech stack

Expand Down
14 changes: 12 additions & 2 deletions frontend/e2e/customer-display-pairing-addresses.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,20 @@ test('customer display pairing uses the selected POS address and reuses its toke
});
await devicePage.goto(pairingUrl);
await expect(devicePage.getByText('E2E Cafe', { exact: true })).toBeVisible();
await expect(devicePage.getByText('A-42', { exact: true })).toBeVisible();
await expect(
devicePage
.getByTestId('customer-display-ready-scroll')
.getByText('A-42', { exact: true })
.filter({ visible: true }),
).toBeVisible();
await expect(devicePage).toHaveURL(`${localOrigin}/customer-display/`);
await devicePage.reload();
await expect(devicePage.getByText('A-42', { exact: true })).toBeVisible();
await expect(
devicePage
.getByTestId('customer-display-ready-scroll')
.getByText('A-42', { exact: true })
.filter({ visible: true }),
).toBeVisible();
expect(feedRequests).toBeGreaterThanOrEqual(2);
revoked = true;
await expect(
Expand Down
Loading
Loading