fix(web): setup wizard no longer forces printers to bind to a barrier

"Cilën barrierë shërben kjo pajisje?" is load-bearing for readers and
cameras (which barrier a scan opens + inherited direction) but nothing
consumes it on a printer — print routing is role + failoverRank
(printer-routing.ts). The wizard applied the requirement to every
non-controller device, so adding a printer demanded a meaningless relay
pick that got stored as dead config.

Printers are now exempt: no requirement, the binding panel is hidden,
the binding is not persisted (a stale pre-fix one drops off on next
edit), and the device list shows the printer's ROLE instead of a bogus
amber "unbound". Server never validated it — no API change.

Claude-Session: https://claude.ai/code/session_01Xcm6ikLgGoCxxHrxtjkk5V
This commit is contained in:
2026-07-06 12:36:14 +02:00
parent fcea992e1e
commit ffe8c13a1c
2 changed files with 63 additions and 4 deletions
+21 -4
View File
@@ -463,6 +463,16 @@ function DeviceSummary({ assignment, controllers }: { assignment: Assignment; co
</span>
);
}
// Printers don't bind to a barrier (routing is role + failoverRank) — show the
// role instead of a bogus "unbound" warning.
if (assignment.category === "printer") {
const role = typeof cfg.role === "string" ? cfg.role : null;
return role ? (
<span className="text-term-muted">
{t(role === "booth-receipt" ? "devices.role.booth" : "devices.role.lane")}
</span>
) : null;
}
// Bound device: show controller + relay it points at, with inherited direction.
const controllerId = typeof cfg.controllerId === "string" ? cfg.controllerId : null;
const relay = typeof cfg.relay === "number" ? cfg.relay : null;
@@ -686,7 +696,11 @@ function DeviceForm({
...(i.role === "presence" && i.activeLow ? { activeLow: true } : {}),
...(i.role === "button" && i.cooldownSec ? { cooldownSec: i.cooldownSec } : {}),
}));
} else if (controllerId && boundRelay !== "") {
} else if (!isPrinter && controllerId && boundRelay !== "") {
// Readers/cameras bind to a controller relay (which barrier a scan opens +
// inherited direction). Printers do NOT — routing is role+failoverRank only,
// so no binding is emitted (and a stale one saved before 2026-07-06 drops
// off on the next edit).
out.controllerId = controllerId;
out.relay = boundRelay;
}
@@ -759,7 +773,9 @@ function DeviceForm({
if (!selected) return;
// Bound devices must point at a controller relay (binding is optional in the
// model with a fallback, but the wizard guides the admin to bind explicitly).
if (!isController && (!controllerId || boundRelay === "")) {
// Printers are exempt: nothing consumes a printer's binding — their routing is
// role + failoverRank (see printer-routing.ts).
if (!isController && !isPrinter && (!controllerId || boundRelay === "")) {
setSaveError("Pick the controller and relay this device sits at.");
return;
}
@@ -959,8 +975,9 @@ function DeviceForm({
/>
)}
{/* BOUND device: which controller + relay it sits at. */}
{!isController && (
{/* BOUND device: which controller + relay it sits at. Not printers —
nothing consumes a printer binding (role+rank routes print jobs). */}
{!isController && !isPrinter && (
<BindingPicker
controllers={controllers}
controllerId={controllerId}