diff --git a/local_backend/tests/test_kds_device.py b/local_backend/tests/test_kds_device.py
index 3ee6ecc..2605f1f 100644
--- a/local_backend/tests/test_kds_device.py
+++ b/local_backend/tests/test_kds_device.py
@@ -143,3 +143,13 @@ def test_settings_changed_from_the_screen(client, screen, make_user, kitchen):
# without a device it's not a screen
assert err(client.patch("/api/devices/me/config", headers={"Authorization": h["Authorization"]},
json={"config": {}})) in ("device.not_paired", "device.required")
+
+
+def test_item_back_to_pending_reopens_the_order(client, screen, kitchen):
+ """Undo on the screen (3.2b): an item done → back to pending puts the order back too."""
+ h, oid = screen["h"], kitchen["order"].id
+ item = client.get("/api/kds/orders", headers=h).json()["orders"][0]["items"][0]["id"]
+ for status, expected in (("done", "preparing"), ("pending", "pending")): # the Bar item is still to do
+ assert client.put(f"/api/kds/orders/{oid}/items/{item}/kds_status", headers=h, json={"status": status}).status_code == 200
+ order = next(o for o in client.get("/api/kds/orders", headers=h).json()["orders"] if o["id"] == oid)
+ assert order["kds_status"] == expected
diff --git a/packages/i18n/locales/el/terminal.json b/packages/i18n/locales/el/terminal.json
index aaff36f..27f0aa4 100644
--- a/packages/i18n/locales/el/terminal.json
+++ b/packages/i18n/locales/el/terminal.json
@@ -33,5 +33,126 @@
"placeholder": "Αυτή η οθόνη τρέχει: {{app}}. Οι οθόνες της ετοιμάζονται.",
"unknownTitle": "Άγνωστη εφαρμογή",
"unknown": "Αυτή η οθόνη έχει οριστεί να τρέχει «{{app}}», που αυτό το τερματικό δεν έχει ακόμη. Ενημερώστε τον διακομιστή του καταστήματος."
+ },
+ "kds": {
+ "loading": "Φόρτωση…",
+ "empty": "Δεν υπάρχουν παραγγελίες για τα επιλεγμένα φίλτρα",
+ "cancel": "Ακύρωση",
+ "close": "Κλείσιμο",
+ "age": {
+ "new": "νέα",
+ "minutes": "{{m}}m",
+ "hours": "{{h}}h {{m}}m",
+ "ago": "πριν {{time}}"
+ },
+ "card": {
+ "items_one": "{{count}} είδος",
+ "items_other": "{{count}} είδη",
+ "status": {
+ "pending": "Αναμονή",
+ "preparing": "▶ Προετοιμασία",
+ "done": "✓ Έτοιμη"
+ },
+ "batch": "Παρτίδα {{n}}",
+ "noCourse": "Χωρίς πιάτο"
+ },
+ "channel": {
+ "here": "Εδώ",
+ "takeaway": "Takeaway",
+ "delivery": "Delivery"
+ },
+ "tabs": {
+ "all": "Όλα"
+ },
+ "actions": {
+ "prepare": "Σε εκτέλεση",
+ "complete": "Ολοκλήρωση",
+ "reset": "Επαναφορά",
+ "print": "Εκτύπωση",
+ "callWaiter": "Κάλεσε σερβιτόρο"
+ },
+ "quick": {
+ "prep": "Εκτέλεση",
+ "ready": "Έτοιμη",
+ "undo": "Αναίρεση",
+ "decline": "Απόρριψη",
+ "close": "Κλείσιμο"
+ },
+ "decline": {
+ "order": "Απόρριψη παραγγελίας",
+ "item": "Απόρριψη αντικειμένου",
+ "reasons": {
+ "out_of_stock": "Εξαντλήθηκε",
+ "too_many_orders": "Υπερβολικά πολλές παραγγελίες",
+ "other": "Άλλος λόγος"
+ },
+ "notePlaceholder": "Προσθέστε σημείωση (προαιρετικό)…"
+ },
+ "summary": {
+ "title": "Σύνοψη αντικειμένων",
+ "subtitle": "Αναμονή + προετοιμασία · {{count}} είδη",
+ "empty": "Κανένα αντικείμενο",
+ "button": "Σύνοψη"
+ },
+ "rail": {
+ "future": "Αργότερα",
+ "pending": "Αναμονή",
+ "preparing": "Εκτέλεση",
+ "done": "Έτοιμες",
+ "undo": "Αναίρεση",
+ "redo": "Επανάληψη",
+ "call": "Κλήση",
+ "sound": "Ήχος",
+ "muted": "Σίγαση",
+ "settings": "Ρυθμίσεις"
+ },
+ "zoom": {
+ "smaller": "Μικρότερο",
+ "larger": "Μεγαλύτερο"
+ },
+ "call": {
+ "title": "Κάλεσε σερβιτόρο",
+ "needsHelp": "Η {{zone}} θέλει βοήθεια",
+ "none": "Κανένας σερβιτόρος σε βάρδια",
+ "all": "Όλοι οι σερβιτόροι",
+ "send": "Κάλεσε",
+ "sendCount": "Κάλεσε ({{count}})",
+ "sending": "Αποστολή…"
+ },
+ "start": {
+ "title": "Πατήστε για έναρξη",
+ "body": "Η οθόνη χρειάζεται ένα πάτημα για να μπορεί να παίζει τον ήχο των νέων παραγγελιών."
+ },
+ "settings": {
+ "title": "Ρυθμίσεις οθόνης",
+ "save": "Αποθήκευση",
+ "seconds": "{{s}}δ",
+ "noPermission": "Μόνο ένας διαχειριστής μπορεί να αλλάξει τις ρυθμίσεις αυτής της οθόνης. Ζητήστε του να συνδεθεί εδώ.",
+ "tabs": {
+ "zone": "Ζώνη",
+ "behaviour": "Λειτουργία",
+ "board": "Εμφάνιση",
+ "age": "Χρόνος αναμονής",
+ "notifications": "Ειδοποιήσεις"
+ }
+ },
+ "toast": {
+ "newOrders_one": "{{count}} νέα παραγγελία",
+ "newOrders_other": "{{count}} νέες παραγγελίες",
+ "done": "✓ Ολοκληρώθηκε",
+ "preparing": "▶ Σε εκτέλεση",
+ "pending": "↩ Επαναφορά",
+ "waiterCalled": "Ειδοποίηση σερβιτόρου στάλθηκε",
+ "called": "Ειδοποίηση στάλθηκε",
+ "sendFailed": "Αποτυχία αποστολής",
+ "itemDeclined": "Αντικείμενο απορρίφθηκε",
+ "orderDeclined": "Παραγγελία απορρίφθηκε",
+ "declineFailed": "Σφάλμα απόρριψης",
+ "printSent": "Εκτύπωση εστάλη",
+ "printFailed": "Σφάλμα εκτύπωσης",
+ "undone": "Αναίρεση",
+ "redone": "Επανάληψη",
+ "settingsSaved": "Οι ρυθμίσεις αποθηκεύτηκαν"
+ }
}
}
diff --git a/packages/i18n/locales/en/terminal.json b/packages/i18n/locales/en/terminal.json
index 8521ed0..2c280fe 100644
--- a/packages/i18n/locales/en/terminal.json
+++ b/packages/i18n/locales/en/terminal.json
@@ -33,5 +33,126 @@
"placeholder": "This screen runs {{app}}. Its screens are being built.",
"unknownTitle": "Unknown app",
"unknown": "This screen is set to run \"{{app}}\", which this terminal doesn't have yet. Update the venue server."
+ },
+ "kds": {
+ "loading": "Loading…",
+ "empty": "No orders for the selected filters",
+ "cancel": "Cancel",
+ "close": "Close",
+ "age": {
+ "new": "new",
+ "minutes": "{{m}}m",
+ "hours": "{{h}}h {{m}}m",
+ "ago": "{{time}} ago"
+ },
+ "card": {
+ "items_one": "{{count}} item",
+ "items_other": "{{count}} items",
+ "status": {
+ "pending": "To do",
+ "preparing": "▶ Prep",
+ "done": "✓ Done"
+ },
+ "batch": "Round {{n}}",
+ "noCourse": "No course"
+ },
+ "channel": {
+ "here": "Here",
+ "takeaway": "Takeaway",
+ "delivery": "Delivery"
+ },
+ "tabs": {
+ "all": "All"
+ },
+ "actions": {
+ "prepare": "In progress",
+ "complete": "Done",
+ "reset": "Back",
+ "print": "Print",
+ "callWaiter": "Call waiter"
+ },
+ "quick": {
+ "prep": "Prep",
+ "ready": "Ready",
+ "undo": "Undo",
+ "decline": "Decline",
+ "close": "Close"
+ },
+ "decline": {
+ "order": "Decline order",
+ "item": "Decline item",
+ "reasons": {
+ "out_of_stock": "Out of stock",
+ "too_many_orders": "Too many orders",
+ "other": "Other reason"
+ },
+ "notePlaceholder": "Add a note (optional)…"
+ },
+ "summary": {
+ "title": "Item totals",
+ "subtitle": "To do + in progress · {{count}} kinds",
+ "empty": "No items",
+ "button": "Totals"
+ },
+ "rail": {
+ "future": "Later",
+ "pending": "To do",
+ "preparing": "Prep",
+ "done": "Done",
+ "undo": "Undo",
+ "redo": "Redo",
+ "call": "Call",
+ "sound": "Sound",
+ "muted": "Muted",
+ "settings": "Settings"
+ },
+ "zoom": {
+ "smaller": "Smaller text",
+ "larger": "Larger text"
+ },
+ "call": {
+ "title": "Call a waiter",
+ "needsHelp": "{{zone}} needs help",
+ "none": "No waiter is on shift",
+ "all": "All waiters",
+ "send": "Call",
+ "sendCount": "Call ({{count}})",
+ "sending": "Sending…"
+ },
+ "start": {
+ "title": "Tap to start",
+ "body": "The screen needs one tap before it can play the sound for new orders."
+ },
+ "settings": {
+ "title": "Screen settings",
+ "save": "Save",
+ "seconds": "{{s}}s",
+ "noPermission": "Only a manager can change this screen's settings. Ask one to sign in here.",
+ "tabs": {
+ "zone": "Prep zone",
+ "behaviour": "Behaviour",
+ "board": "Board",
+ "age": "Waiting time",
+ "notifications": "Notifications"
+ }
+ },
+ "toast": {
+ "newOrders_one": "{{count}} new order",
+ "newOrders_other": "{{count}} new orders",
+ "done": "✓ Done",
+ "preparing": "▶ In progress",
+ "pending": "↩ Back to to do",
+ "waiterCalled": "Waiter notified",
+ "called": "Sent",
+ "sendFailed": "Couldn't send it",
+ "itemDeclined": "Item declined",
+ "orderDeclined": "Order declined",
+ "declineFailed": "Couldn't decline it",
+ "printSent": "Sent to the printer",
+ "printFailed": "Couldn't print",
+ "undone": "Undone",
+ "redone": "Redone",
+ "settingsSaved": "Settings saved"
+ }
}
}
diff --git a/terminal/eslint.config.js b/terminal/eslint.config.js
index 8f4d803..3c0e32c 100644
--- a/terminal/eslint.config.js
+++ b/terminal/eslint.config.js
@@ -25,7 +25,7 @@ export default defineConfig([
},
},
rules: {
- 'no-unused-vars': ['error', { varsIgnorePattern: '^[A-Z_]' }],
+ 'no-unused-vars': ['error', { varsIgnorePattern: '^[A-Z_]', argsIgnorePattern: '^[A-Z_]' }], // components passed as props (Icon)
// Loading data in an effect (`useEffect(() => { load() }, [load])`, setState after the
// await) is flagged too; it's what the screens do, so a warning, as in the manager.
'react-hooks/set-state-in-effect': 'warn',
diff --git a/terminal/src/apps/kds/KdsApp.jsx b/terminal/src/apps/kds/KdsApp.jsx
index 1342955..9fbaec3 100644
--- a/terminal/src/apps/kds/KdsApp.jsx
+++ b/terminal/src/apps/kds/KdsApp.jsx
@@ -1,6 +1,369 @@
-// Placeholder until step 3.2 builds this app (plan phase 3). Lazily loaded (apps/registry.js).
-import AppPlaceholder from '../AppPlaceholder'
+// The kitchen display on a paired screen (plan step 3.2b; ported from the manager's
+// KdsPage.jsx, which goes in 3.2d). The same board, actions and sounds as before:
+// - side rail: status filters with counts (future / to do / in progress / done; several at
+// once or one at a time: setting categories_as_filters), undo/redo, call waiters, sound
+// on/off for this session, settings;
+// - top bar: here / takeaway / delivery tabs, item totals button, the venue's clock, zoom
+// (this session only; the saved size is the font_scale setting);
+// - the board: cards packed in columns without vertical scrolling (logic/layout.js), tap a
+// card to select it, tap its items to move them on, long press to decline;
+// - item totals panel, decline / call-waiter dialogs, toasts.
+// Settings are the device's (3.2a): GET /api/devices/me → me.config, live on device.updated.
+// Orders come from the backend for this screen's zone and stay fresh through the live
+// connection (useKdsData). Sound needs one tap after the screen starts (browser rule).
+import { useCallback, useEffect, useMemo, useRef, useState } from 'react'
+import { CookingPot } from 'lucide-react'
+import { useLanguage, useTranslation } from '@xenia/i18n'
+import client from '../../api/client'
+import { useDevice } from '../../device/context'
+import { chime, soundUnlocked, unlockSound } from './chime'
+import { CallWaiterDialog, DeclineDialog, Toasts } from './components/Dialogs'
+import MeasureLayer from './components/MeasureLayer'
+import OrderCard from './components/OrderCard'
+import { SideRail, TopBar } from './components/Rails'
+import SettingsPanel from './components/SettingsPanel'
+import SummaryPanel from './components/SummaryPanel'
+import {
+ ageLabel, ageOrderFor, ageState, bucketCounts, nextItemStatus, readyNotice, tabCounts, visibleOrders,
+ withItemStatus, withOrderStatus,
+} from './logic/board'
+import { layoutBoard } from './logic/layout'
+import { boardSettings, senderName, zoomStep } from './logic/settings'
+import { KDS, KEYFRAMES } from './theme'
+import useKdsData from './useKdsData'
+
+const HISTORY = 10
+const TOAST_MS = 2200
export default function KdsApp() {
- return