feat(manager): the menu board editor and widgets (platform-v2 step 5.6b)

- Menu board: everything or chosen whole categories (sub-categories
  included, new products join) plus single products found by search; hide a
  product from the board (and show it again); the board's own order with
  arrows on what the server resolved (categories and products; boardOrder
  writes it); a badge per product; grouping, headings, photos, descriptions,
  whose prices (a sales point or none), sold out crossed out or hidden,
  columns, products per page (or as many as fit), seconds per page; colours,
  font, size, background.
- Widgets (text and menu slides): logo, venue name, date (long / short),
  clock (seconds), message of the day (or its own text), QR code (ordering /
  QR menu / a link + caption), weather (1-3 days, says it needs internet);
  where (corners, bars) and size.
- The preview stays in view while the settings scroll.
- @xenia/signage: the venue clock's Intl call names its time zone where the
  i18n guard reads it.
- tests: manager signage.test.mjs +1; e2e signage.mjs builds a menu board in
  the editor (categories, a single product, the order, a badge, hiding, a
  clock) and checks what was saved and resolved.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-17 22:16:49 +02:00
co-authored by Claude Opus 5.5
parent 152388321e
commit 5f6b51fb8b
11 changed files with 509 additions and 20 deletions
+12
View File
@@ -45,3 +45,15 @@ test('what is sent back, and library items as the slides need them', () => {
assert.deepEqual(mediaEntry({ id: 3, kind: 'video', name: 'v', width: 1, height: 2, duration_ms: 5, urls: { original: '/o' } }).url, '/o')
assert.equal(mediaEntry({ id: 3, kind: 'image', urls: { full: '/f', original: '/o', thumb: '/t' } }).url, '/f')
})
test('the board\'s own order from what it shows; moving categories and products; toggling ids', async () => {
const { boardOrder, moveGroup, moveItem, toggled } = await import('../src/pages/signage/signageLogic.js')
const groups = [{ category: { id: 1 }, items: [{ id: 10 }, { id: 11 }] }, { category: { id: 2 }, items: [{ id: 20 }] }]
assert.deepEqual(boardOrder(groups), { category_order: [1, 2], product_order: [10, 11, 20] })
assert.deepEqual(boardOrder(moveGroup(groups, 1, -1)), { category_order: [2, 1], product_order: [20, 10, 11] })
assert.deepEqual(boardOrder(moveItem(groups, 0, 1, -1)).product_order, [11, 10, 20])
assert.deepEqual(boardOrder([{ category: null, items: [{ id: 5 }] }]), { category_order: [], product_order: [5] })
assert.deepEqual(toggled([3, 1], 2), [1, 2, 3])
assert.deepEqual(toggled([1, 2], 2), [1])
assert.deepEqual(toggled(undefined, 4), [4])
})