fix(web): setup allows adding a printer with no controller configured

Second half of the printer/relay decoupling: the category section's
add-button gate ("add a controller first — a printer points at one of
its relays") blocked every non-access category while zero controllers
existed — hit on the lab bench (USB printer test, no relays on hand).
Printers don't bind (role + failoverRank route jobs), so the gate now
exempts them like the form's requirement already does.

Claude-Session: https://claude.ai/code/session_01Xcm6ikLgGoCxxHrxtjkk5V
This commit is contained in:
2026-07-07 09:54:59 +02:00
parent ee61c24bb9
commit a02957034d
2 changed files with 12 additions and 2 deletions
+4 -2
View File
@@ -257,8 +257,10 @@ function CategorySection({
const [formFor, setFormFor] = useState<Assignment | "new" | null>(null);
const [warnings, setWarnings] = useState<string[]>([]);
// Binding categories need a controller to point at first.
const isBound = category !== "access";
// Binding categories need a controller to point at first. Printers do NOT bind
// (role + failoverRank route print jobs — see printer-routing.ts), so they are
// addable on a controller-less box (e.g. the lab bench testing a USB printer).
const isBound = category !== "access" && category !== "printer";
const blockedNoController = isBound && controllers.length === 0;
const editing = formFor && formFor !== "new" ? formFor : undefined;