feat(booth): the exit lane light is the manual-exit control — two tiles, Hyrje and Dalje Manuale
Build & push images / images (push) Successful in 3m20s

BarrierLight gains onOpen/opening (not presence-gated). For an operator with
barrier:create + own shift the exit tile is labelled 'manual exit', clickable and
opens the manual-exit dialog while still showing the lane state; for everyone else it
stays the plain 'Dalje' light. The separate ghost button is removed. Wiki as-built note.
This commit is contained in:
2026-10-09 09:17:16 +02:00
parent 3f903cdbdd
commit 2ac26b5825
2 changed files with 27 additions and 19 deletions
+22 -16
View File
@@ -131,6 +131,8 @@ function BarrierLight({
issuing,
bypassRadar,
bypassCamera,
onOpen,
opening,
}: {
label: string;
busy: boolean;
@@ -142,6 +144,11 @@ function BarrierLight({
/** Admin bypass of a faulty device: a bypassed signal counts as present (server re-checks). */
bypassRadar?: boolean;
bypassCamera?: boolean;
/** When set (exit light + barrier:create + own shift), clicking opens the manual-exit
* dialog — NOT presence-gated (the car may be anywhere in the lane, or the lane may be
* empty while the operator prepares). The light keeps showing the lane state. */
onOpen?: () => void;
opening?: boolean;
}) {
const { t } = useTranslation();
// Blink only when the radar sees something the camera hasn't confirmed.
@@ -152,14 +159,15 @@ function BarrierLight({
const radarOk = radar || !!bypassRadar;
const cameraOk = busy || !!bypassCamera;
const canIssue = !!onIssue && radarOk && cameraOk && !issuing;
const clickable = !!onIssue && radarOk && cameraOk;
const clickable = (!!onIssue && radarOk && cameraOk) || !!onOpen;
const onClick = canIssue ? onIssue : onOpen && !opening ? onOpen : undefined;
return (
<div
className={`flex items-center gap-2 rounded-term border px-3 py-2 ${blinking ? "lane-blink" : solid} ${
clickable ? "cursor-pointer hover:brightness-125" : ""
}`}
title={clickable ? t("booth.issueEntryTitle") : label}
onClick={canIssue ? onIssue : undefined}
title={onOpen ? t("booth.forgiveExitTitle") : clickable ? t("booth.issueEntryTitle") : label}
onClick={onClick}
role={clickable ? "button" : undefined}
>
{/* Barrier glyph: a post + an arm. `currentColor` follows the (possibly blinking) state. */}
@@ -171,7 +179,7 @@ function BarrierLight({
<div className="leading-tight">
<div className="text-[0.625rem] uppercase tracking-wider text-term-muted">{label}</div>
<div className="text-xs font-bold">
{issuing ? "…" : clickable ? t("booth.issueEntry") : busy ? "●" : blinking ? "◐" : "○"}
{issuing || opening ? "…" : onIssue && clickable ? t("booth.issueEntry") : busy ? "●" : blinking ? "◐" : "○"}
</div>
</div>
</div>
@@ -250,18 +258,16 @@ function LaneIndicators() {
bypassRadar={site?.bypassPresenceRadar ?? false}
bypassCamera={site?.bypassPresenceCamera ?? false}
/>
<BarrierLight label={t("booth.laneExit")} busy={lanes?.exit ?? false} radar={radar?.exit ?? false} />
{canForgive && (
<button
type="button"
onClick={() => setForgiveOpen(true)}
disabled={forgive.isPending}
className="btn btn-ghost btn-sm text-term-red"
title={t("booth.forgiveExitTitle")}
>
{t("booth.forgiveExit")}
</button>
)}
{/* The exit light IS the manual-exit control for whoever may use it (barrier:create +
own shift): same chrome as the entry light, still showing the lane state, labelled
"manual exit" and clickable. For everyone else it is the plain exit lane light. */}
<BarrierLight
label={canForgive ? t("booth.forgiveExit") : t("booth.laneExit")}
busy={lanes?.exit ?? false}
radar={radar?.exit ?? false}
onOpen={canForgive ? () => setForgiveOpen(true) : undefined}
opening={forgive.isPending}
/>
{/* Forgiven-exit dialog (no ticket): what it does, an optional reason, a deliberate red
confirm. Enter in the field confirms; Escape / ✕ / Cancel abort. */}
<Modal open={forgiveOpen} onClose={() => setForgiveOpen(false)} title={t("booth.forgiveDialogTitle")} width="max-w-md">