feat(terminal): the customer display, with an idle screen each venue designs

Plan step 3.4. Owner (2026-11-16): the idle screen is configurable per venue.
- routers/customer_display.py (module customer_display, /api/display): the counter POS
  pushes its state (POST /api/display/state: idle | cart | paid with lines, total, paid,
  change); only the displays linked to that POS get `display.state`; the last state is kept
  in memory for a display that reconnects (GET /api/display/state). pos_counter's device
  scope includes customer_display.state.
- The idle screen: setting customer_display.idle (name, logo, logo + name, blank, one
  image, slideshow, QR code to the online ordering / QR menu / any link; a line of text;
  dark or light); images uploaded to /app/data/display_media (JPG/PNG/WebP/GIF ≤ 5 MB,
  random names, served publicly on the LAN); a change sends `display.settings` to every
  display. New key customer_display.manage (owners, store managers; migration 0022).
- Terminal: CustomerDisplayApp (cart with a large total, "Thank you" with the change for
  12 s, the venue's idle screen, its theme), logic.js (unit-tested); the POS pushes from the
  sale cart and the payment dialog (tables, online orders too) via useDisplay().
  qrcode.react added to the terminal (already in the workspace).
- Manager: Settings → Customer display (style cards, venue name, text, look, slide seconds,
  QR target/link/caption, image upload/pick/order/delete).
- Tests: tests/test_customer_display.py (3), terminal display.test.mjs (3); e2e terminal
  (linked vs unlinked display, < 1 s, paid, QR and slideshow idle screens), manager (the
  settings tab).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-16 08:34:05 +02:00
co-authored by Claude Opus 5.5
parent 18d580d87c
commit 88a9703902
27 changed files with 1073 additions and 25 deletions
+6
View File
@@ -110,5 +110,11 @@
"status_changed": "Η κράτηση άλλαξε από άλλη οθόνη στο μεταξύ (τώρα είναι {{current}}).",
"table_unknown": "Το τραπέζι {{table_id}} δεν βρέθηκε.",
"table_busy": "Αυτό το τραπέζι έχει ήδη ανοιχτή παραγγελία. Διαλέξτε άλλο τραπέζι ή κλείστε πρώτα εκείνη την παραγγελία."
},
"display": {
"media_unknown": "Η εικόνα {{name}} δεν βρέθηκε.",
"media_type": "Ανεβάστε εικόνα JPG, PNG, WebP ή GIF.",
"media_too_big": "Η εικόνα είναι πολύ μεγάλη (έως {{max_mb}} MB).",
"qr_url_missing": "Γράψτε τον σύνδεσμο που ανοίγει ο QR κωδικός."
}
}
+60 -1
View File
@@ -308,7 +308,8 @@
"colours": "Εμφάνιση",
"print-fonts": "Εκτύπωση",
"fiscal": "Ταμειακή",
"development": "Developer"
"development": "Developer",
"customer-display": "Οθόνη πελάτη"
},
"mode": {
"password": "Κωδικός",
@@ -599,5 +600,63 @@
"copied": "Ο σύνδεσμος αντιγράφηκε",
"open": "Άνοιγμα",
"print": "Εκτύπωση"
},
"display": {
"title": "Οθόνη πελάτη",
"intro": "Η οθόνη προς τους πελάτες στο ταμείο δείχνει την πώληση και το σύνολο όσο χτυπάτε, και \"Ευχαριστούμε\" με τα ρέστα μετά την πληρωμή. Εδώ διαλέγετε τι δείχνει στο ενδιάμεσο.",
"style": "Ανάμεσα στις πωλήσεις, δείξε",
"styles": {
"name": {
"name": "Το όνομά σας",
"hint": "Το όνομα του καταστήματος, μεγάλο"
},
"logo": {
"name": "Το λογότυπο",
"hint": "Μια εικόνα που ανεβάζετε"
},
"name_logo": {
"name": "Λογότυπο και όνομα",
"hint": "Το λογότυπο με το όνομα από κάτω"
},
"blank": {
"name": "Τίποτα",
"hint": "Απλή οθόνη"
},
"image": {
"name": "Μια εικόνα",
"hint": "Μία φωτογραφία, σε όλη την οθόνη"
},
"slideshow": {
"name": "Παρουσίαση",
"hint": "Φωτογραφίες η μία μετά την άλλη (προσφορές, πιάτα)"
},
"qr": {
"name": "Κωδικός QR",
"hint": "Ο σύνδεσμος παραγγελιών, το QR μενού ή άλλος σύνδεσμος"
}
},
"venueName": "Όνομα καταστήματος",
"venueNameHint": "Εμφανίζεται στην οθόνη (και σε άλλες οθόνες).",
"message": "Μια γραμμή κειμένου (προαιρετικά)",
"messageHint": "π.χ. \"Καλώς ήρθατε!\" ή \"Δωρεάν Wi-Fi: Taverna\"",
"theme": "Εμφάνιση",
"themes": {
"dark": "Σκούρα",
"light": "Φωτεινή"
},
"slideSeconds": "Δευτερόλεπτα ανά φωτογραφία",
"qrTarget": "Ο κωδικός QR ανοίγει",
"qrTargets": {
"ordering": "Τις online παραγγελίες σας",
"menu": "Το QR μενού σας",
"custom": "Άλλο σύνδεσμο"
},
"qrUrl": "Σύνδεσμος",
"qrCaption": "Κείμενο κάτω από τον κωδικό (προαιρετικά)",
"pickLogo": "Διαλέξτε το λογότυπο",
"pickImage": "Διαλέξτε την εικόνα",
"pickSlides": "Διαλέξτε τις φωτογραφίες, με τη σειρά (ξανά πάτημα για αφαίρεση)",
"upload": "Ανέβασμα εικόνων",
"noImages": "Δεν υπάρχουν εικόνες: ανεβάστε (JPG, PNG, WebP ή GIF, έως 5 MB)."
}
}
+4 -1
View File
@@ -81,9 +81,12 @@
},
"customer_display": {
"name": "Οθόνη πελάτη",
"description": "Οθόνη προς τον πελάτη δίπλα σε ταμείο πάγκου (έρχεται σύντομα).",
"description": "Οθόνη προς τον πελάτη στο ταμείο: η πώληση, το σύνολο, τα ρέστα, και μια οθόνη αναμονής που σχεδιάζετε εσείς.",
"limits": {
"devices": "Οθόνες πελάτη"
},
"permissions": {
"manage": "Ρύθμιση της οθόνης πελάτη (οθόνη αναμονής, εικόνες)"
}
},
"expenses": {
+7
View File
@@ -465,5 +465,12 @@
"cancel": "Ακύρωση",
"noShow": "Δεν ήρθαν"
}
},
"display": {
"total": "Σύνολο",
"thanks": "Ευχαριστούμε!",
"paid": "Πληρώθηκαν {{amount}}",
"change": "Τα ρέστα σας: {{amount}}",
"unlinked": "Δεν έχει συνδεθεί ακόμα με ταμείο (διαχείριση → Συσκευές)"
}
}
+6
View File
@@ -110,5 +110,11 @@
"status_changed": "This booking was changed on another screen in the meantime (it is now {{current}}).",
"table_unknown": "Table {{table_id}} not found.",
"table_busy": "That table already has an open order. Pick another table, or close that order first."
},
"display": {
"media_unknown": "Image {{name}} not found.",
"media_type": "Upload a JPG, PNG, WebP or GIF image.",
"media_too_big": "The image is too big (at most {{max_mb}} MB).",
"qr_url_missing": "Enter the link the QR code opens."
}
}
+60 -1
View File
@@ -308,7 +308,8 @@
"colours": "Appearance",
"print-fonts": "Printing",
"fiscal": "Fiscal device",
"development": "Developer"
"development": "Developer",
"customer-display": "Customer display"
},
"mode": {
"password": "Password",
@@ -599,5 +600,63 @@
"copied": "Link copied",
"open": "Open",
"print": "Print"
},
"display": {
"title": "Customer display",
"intro": "The screen facing your customers at the counter shows the sale and the total while you sell, and \"Thank you\" with the change after payment. Here you choose what it shows in between.",
"style": "Between sales, show",
"styles": {
"name": {
"name": "Your name",
"hint": "The venue's name, large"
},
"logo": {
"name": "Your logo",
"hint": "An image you upload"
},
"name_logo": {
"name": "Logo and name",
"hint": "The logo with the name under it"
},
"blank": {
"name": "Nothing",
"hint": "A plain screen"
},
"image": {
"name": "A picture",
"hint": "One photo, full screen"
},
"slideshow": {
"name": "A slideshow",
"hint": "Photos one after another (promotions, dishes)"
},
"qr": {
"name": "A QR code",
"hint": "Your ordering link, QR menu, or any link"
}
},
"venueName": "Venue name",
"venueNameHint": "Shown on the display (and other screens).",
"message": "A line of text (optional)",
"messageHint": "e.g. \"Welcome!\" or \"Free Wi-Fi: Taverna\"",
"theme": "Look",
"themes": {
"dark": "Dark",
"light": "Light"
},
"slideSeconds": "Seconds per photo",
"qrTarget": "The QR code opens",
"qrTargets": {
"ordering": "Your online ordering",
"menu": "Your QR menu",
"custom": "Another link"
},
"qrUrl": "Link",
"qrCaption": "Text under the code (optional)",
"pickLogo": "Pick your logo",
"pickImage": "Pick the picture",
"pickSlides": "Pick the photos, in order (tap again to remove)",
"upload": "Upload images",
"noImages": "No images yet: upload some (JPG, PNG, WebP or GIF, up to 5 MB)."
}
}
+4 -1
View File
@@ -81,9 +81,12 @@
},
"customer_display": {
"name": "Customer display",
"description": "A screen facing the customer at a counter POS (coming soon).",
"description": "A screen facing the customer at a counter POS: the sale, the total, the change, and an idle screen you design.",
"limits": {
"devices": "Customer displays"
},
"permissions": {
"manage": "Set up the customer display (idle screen, images)"
}
},
"expenses": {
+7
View File
@@ -465,5 +465,12 @@
"cancel": "Cancel",
"noShow": "No-show"
}
},
"display": {
"total": "Total",
"thanks": "Thank you!",
"paid": "Paid {{amount}}",
"change": "Your change: {{amount}}",
"unlinked": "Not linked to a counter yet (manager → Devices)"
}
}