diff --git a/apps/web/src/BoothScreen.tsx b/apps/web/src/BoothScreen.tsx index cb41237..da32c39 100644 --- a/apps/web/src/BoothScreen.tsx +++ b/apps/web/src/BoothScreen.tsx @@ -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 (
{/* Barrier glyph: a post + an arm. `currentColor` follows the (possibly blinking) state. */} @@ -171,7 +179,7 @@ function BarrierLight({
{label}
- {issuing ? "…" : clickable ? t("booth.issueEntry") : busy ? "●" : blinking ? "◐" : "○"} + {issuing || opening ? "…" : onIssue && clickable ? t("booth.issueEntry") : busy ? "●" : blinking ? "◐" : "○"}
@@ -250,18 +258,16 @@ function LaneIndicators() { bypassRadar={site?.bypassPresenceRadar ?? false} bypassCamera={site?.bypassPresenceCamera ?? false} /> - - {canForgive && ( - - )} + {/* 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. */} + 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. */} setForgiveOpen(false)} title={t("booth.forgiveDialogTitle")} width="max-w-md"> diff --git a/wiki/decisions/forgiven-exit.md b/wiki/decisions/forgiven-exit.md index 75acb9d..d29c4b8 100644 --- a/wiki/decisions/forgiven-exit.md +++ b/wiki/decisions/forgiven-exit.md @@ -94,9 +94,11 @@ unchanged) and on the ticket being closed. print line `Dalje manuale (N): X`, shown in the X-report, the close confirm and history. - **Web**: in the pay/exit modal a red ghost "Forgive & open" for an OPEN transient that owes money (unpaid or overstay) → reason box → "Confirm — open exit, no payment"; on the booth - header a "Forgive & open exit" next to the exit lane light for the no-ticket case - (a small styled dialog, same chrome as every other form — optional reason, red confirm). Both only render with - `barrier:create` + own open shift. + header the **exit lane light itself is the control** for the no-ticket case (user, + 2026-10-09: "only Hyrje and Dalje Manuale") — same chrome as the entry light, still showing + the lane state, labelled "Dalje manuale" and clickable → a small styled dialog (optional + reason, red confirm). For anyone without `barrier:create` + own open shift it is the plain + "Dalje" light. The modal button likewise only renders with the permission + shift. Live-feed reason texts in en/sq. **Nothing is printed.** - Tests: exit-flow (ticketed + no-session), pay-station (`forgive`), shift-service (totals untouched, own line, history), routes (403 without the permission, 409 no shift, 400 no