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
+4 -4
View File
@@ -5,10 +5,10 @@
/** The venue's local clock at `date`: { weekday (0 = Monday), minutes, date: "YYYY-MM-DD" }. */
export function localNow(timeZone, date = new Date()) {
const parts = Object.fromEntries(new Intl.DateTimeFormat('en-GB', {
timeZone: timeZone || undefined, year: 'numeric', month: '2-digit', day: '2-digit', hour: '2-digit', minute: '2-digit',
weekday: 'short', hourCycle: 'h23',
}).formatToParts(date).map(p => [p.type, p.value]))
// the venue's zone (the schedule's), not the TV's: a TV set to another zone still switches on time
const opts = { year: 'numeric', month: '2-digit', day: '2-digit', hour: '2-digit', minute: '2-digit', weekday: 'short', hourCycle: 'h23' }
const parts = Object.fromEntries(new Intl.DateTimeFormat('en-GB', { timeZone: timeZone || undefined, ...opts })
.formatToParts(date).map(p => [p.type, p.value]))
const weekday = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'].indexOf(parts.weekday)
return { weekday, minutes: Number(parts.hour) * 60 + Number(parts.minute), date: `${parts.year}-${parts.month}-${parts.day}` }
}