Phase 5: Supervisor and Stall screens, weld map, heat table, clock and CO verification
ci / frontend (push) Successful in 34s
ci / server (push) Successful in 7m15s
ci / image (push) Successful in 39s
ci / e2e (push) Successful in 2m4s

The shop at parity with the old build. Supervisor screen (department chips, CO headline, numbers, Change orders
on hold, station grid with clocks and CO tags, boards) and Stall screen (station picker, hero, My packets,
Submitted). Shop steps on the packet page: assign with station, welder picker and stamp; pull back; Start, Pause,
Resume; Submit with a PIN signature and the missing steps as links; review with Send to Q.C., Return to station
and Skip Q.C. route; a lead's read-only review. Weld map (pdf.js viewer with pan, pinch, zoom, full screen; marks
with leader lines; weld sheet; weld record with field CAS; carried marks). Heat map (heat table placed, dragged,
sized, removed; legacy amber tags; borrowed heat map read-only). Checklist tab with templates from settings.
VOID stamps on voided pages. Change orders: CO-n labels, supervisor verify with signature, approval copies the
heat table to the new sheet and the BOM merge keeps the shop's values. Server clock of record with VISUAL ticket
hours beside it. Presence per packet over SSE. Migration 0006 (bfx, bfy, carried_from, checklist_templates).
New endpoints /api/shop/board, /api/shop/stations, /api/shop/stall, /api/departments/{code}/people.

Tests: policy oracle for every shop action, role and status; clock arithmetic; concurrent inserts; CO apply;
frontend geometry, heat table, clock, checklist, weld sheet, screens; seven Playwright scenarios. Docs updated.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
This commit is contained in:
2026-10-16 22:46:56 -06:00
co-authored by Claude Fable 5.1
parent 39a4eb5213
commit 5a4174e0c2
81 changed files with 11532 additions and 352 deletions
+46
View File
@@ -0,0 +1,46 @@
// The viewer context the drawing overlay reads: pointer to page fractions, mark drags, the page size.
import { createContext, useContext, type PointerEvent as ReactPointerEvent } from "react";
import type { Frac } from "../lib/geometry";
/** The bitmap: at most 2.2 times the PDF size and at most 4200 px wide. */
export function renderScale(pdfWidth: number): number {
return Math.min(2.2, 4200 / Math.max(1, pdfWidth));
}
/** A pointer that moved less than this is a tap. */
export const TAP_PX = 6;
/** A mark drag starts after this. */
export const DRAG_PX = 5;
export interface DragHandlers {
/** The pointer is at f (page fractions, not clamped). */
onMove: (f: Frac) => void;
/** The drag ended at f, or null when it never moved (a tap). */
onEnd: (f: Frac | null) => void;
}
export interface ViewerApi {
/** A client point as page fractions, and whether it lies inside the viewer frame. */
toFrac: (clientX: number, clientY: number) => Frac & { inside: boolean };
/** Starts a mark drag from a pointerdown. Moves and ends follow the window. */
startDrag: (e: ReactPointerEvent, h: DragHandlers) => void;
/** True for a short while after a drag ended, so the click that follows it is ignored. */
justDragged: () => boolean;
}
export interface ViewerInfo extends ViewerApi {
/** Page size in bitmap pixels; 0 until the page is drawn. */
w: number;
h: number;
aspect: number;
}
export const ViewerCtx = createContext<ViewerInfo | null>(null);
/** The viewer the overlay lives in. Marks use it to turn pointers into page fractions. */
export function useViewer(): ViewerInfo {
const v = useContext(ViewerCtx);
if (!v) throw new Error("useViewer must be used inside MapViewer");
return v;
}