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
+81 -1
View File
@@ -964,6 +964,86 @@
"colour": "Χρώμα",
"dim": "Σκούρεμα φωτογραφίας: {{value}}%",
"columns": "Στήλες",
"accent": "Χρώμα τιμών και επικεφαλίδων"
"accent": "Χρώμα τιμών και επικεφαλίδων",
"menu": {
"what": "Τι δείχνει",
"all": "Όλα τα προϊόντα (και τα νέα)",
"custom": "Επιλεγμένες κατηγορίες και προϊόντα",
"categories": "Ολόκληρες κατηγορίες",
"categoriesHint": "Προϊόντα που προστίθενται αργότερα σε μια επιλεγμένη κατηγορία εμφανίζονται μόνα τους. Μια κατηγορία περιλαμβάνει τις υποκατηγορίες της.",
"products": "Μεμονωμένα προϊόντα (από οποιαδήποτε κατηγορία)",
"searchProduct": "Αναζήτηση προϊόντος για προσθήκη…",
"hidden": "Κρυμμένα από αυτό το μενού",
"showAgain": "εμφάνιση ξανά",
"hide": "Απόκρυψη από αυτό το μενού",
"onTheBoard_one": "Στο μενού: {{count}} προϊόν",
"onTheBoard_other": "Στο μενού: {{count}} προϊόντα",
"orderHint": "Η δική του σειρά: μετακινήστε κατηγορίες και προϊόντα με τα βέλη. Η σειρά των σερβιτόρων και του ταμείου δεν αλλάζει.",
"badge": "Σήμα",
"noBadge": "Χωρίς σήμα",
"empty": "Τίποτα ακόμα: διαλέξτε κατηγορίες ή προϊόντα παραπάνω.",
"options": "Τι δείχνει κάθε γραμμή",
"group": "Ομαδοποίηση ανά κατηγορία",
"headings": "Επικεφαλίδες κατηγοριών",
"photos": "Φωτογραφίες",
"descriptions": "Περιγραφές",
"prices": "Τιμές",
"noPrices": "Χωρίς τιμές",
"soldOut": "Εξαντλημένα",
"strike": "Διαγραμμένα",
"hideSoldOut": "Κρυμμένα",
"perPage": "Προϊόντα ανά σελίδα",
"perPageHint": "Κενό: όσα χωράνε στην τηλεόραση. Ένα μεγάλο μενού γυρίζει σελίδες.",
"auto": "Όσα χωράνε",
"pageSeconds": "Δευτερόλεπτα ανά σελίδα"
},
"badges": {
"new": "Νέο",
"chef": "Πρόταση σεφ",
"offer": "Προσφορά",
"popular": "Δημοφιλές",
"spicy": "Καυτερό",
"vegetarian": "Χορτοφαγικό",
"vegan": "Vegan"
},
"widgets": {
"title": "Στοιχεία",
"none": "Κανένα στοιχείο: προσθέστε ρολόι, λογότυπο, μήνυμα ημέρας…",
"kinds": {
"logo": "Λογότυπο",
"name": "Όνομα καταστήματος",
"date": "Ημερομηνία",
"clock": "Ρολόι",
"message": "Μήνυμα ημέρας",
"qr": "Κωδικός QR",
"weather": "Καιρός"
},
"position": "Πού",
"size": "Μέγεθος",
"sizes": {
"small": "Μικρό",
"medium": "Μεσαίο",
"large": "Μεγάλο"
},
"positions": {
"top-left": "Πάνω αριστερά",
"top-center": "Πάνω κέντρο",
"top-right": "Πάνω δεξιά",
"bottom-left": "Κάτω αριστερά",
"bottom-center": "Κάτω κέντρο",
"bottom-right": "Κάτω δεξιά",
"top-bar": "Μπάρα πάνω",
"bottom-bar": "Μπάρα κάτω"
},
"ownText": "Δικό του κείμενο (προαιρετικό)",
"ownTextHint": "Κενό: το μήνυμα ημέρας του καταστήματος (Προβολή → Οθόνες).",
"dateLong": "Τρίτη, 17 Νοεμβρίου 2026",
"dateShort": "17/11/2026",
"seconds": "Με δευτερόλεπτα",
"weatherDays": "Μέρες",
"days_one": "Σήμερα",
"days_other": "Σήμερα και {{count}} μέρες",
"weatherNeedsInternet": "Ο καιρός χρειάζεται internet: χωρίς αυτό (ή χωρίς πόλη) το στοιχείο κρύβεται."
}
}
}
+81 -1
View File
@@ -964,6 +964,86 @@
"colour": "Colour",
"dim": "Darken the photo: {{value}}%",
"columns": "Columns",
"accent": "Prices and headings colour"
"accent": "Prices and headings colour",
"menu": {
"what": "What it lists",
"all": "Every product (new ones too)",
"custom": "Chosen categories and products",
"categories": "Whole categories",
"categoriesHint": "Products added to a chosen category later appear by themselves. A category includes its sub-categories.",
"products": "Single products (from any category)",
"searchProduct": "Search a product to add…",
"hidden": "Hidden from this board",
"showAgain": "show again",
"hide": "Hide from this board",
"onTheBoard_one": "On the board: {{count}} product",
"onTheBoard_other": "On the board: {{count}} products",
"orderHint": "The board's own order: move categories and products with the arrows. The waiters' and the counter's order doesn't change.",
"badge": "Badge",
"noBadge": "No badge",
"empty": "Nothing on the board yet: pick categories or products above.",
"options": "What each line shows",
"group": "Group by category",
"headings": "Category headings",
"photos": "Photos",
"descriptions": "Descriptions",
"prices": "Prices",
"noPrices": "No prices",
"soldOut": "Sold-out products",
"strike": "Crossed out",
"hideSoldOut": "Hidden",
"perPage": "Products per page",
"perPageHint": "Empty: as many as fit the TV. A long menu turns its pages.",
"auto": "As many as fit",
"pageSeconds": "Seconds per page"
},
"badges": {
"new": "New",
"chef": "Chef's pick",
"offer": "Offer",
"popular": "Popular",
"spicy": "Spicy",
"vegetarian": "Vegetarian",
"vegan": "Vegan"
},
"widgets": {
"title": "Widgets",
"none": "No widgets: add the clock, your logo, the message of the day…",
"kinds": {
"logo": "Logo",
"name": "Venue name",
"date": "Date",
"clock": "Clock",
"message": "Message of the day",
"qr": "QR code",
"weather": "Weather"
},
"position": "Where",
"size": "Size",
"sizes": {
"small": "Small",
"medium": "Medium",
"large": "Large"
},
"positions": {
"top-left": "Top left",
"top-center": "Top centre",
"top-right": "Top right",
"bottom-left": "Bottom left",
"bottom-center": "Bottom centre",
"bottom-right": "Bottom right",
"top-bar": "Bar at the top",
"bottom-bar": "Bar at the bottom"
},
"ownText": "Its own text (optional)",
"ownTextHint": "Empty: the venue's message of the day (Signage → Screens).",
"dateLong": "Tuesday, 17 November 2026",
"dateShort": "17/11/2026",
"seconds": "With seconds",
"weatherDays": "Days",
"days_one": "Today",
"days_other": "Today and {{count}} days",
"weatherNeedsInternet": "The weather needs internet: without it (or without a town set) the widget is hidden."
}
}
}
+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}` }
}