From e4a05dd46863f52eeae1b81d3883fb8736d48964 Mon Sep 17 00:00:00 2001 From: Ty Balascio Date: Fri, 25 Sep 2026 09:11:54 -0700 Subject: [PATCH] fix(fe): auto-run the mask when the mask screen is active The mask screen never populated its overlay: pickCalibration set overlay:null and the only thing that computed it (approveMask) was gated behind the Approve button, which is disabled until overlay.slabPx>0 - a chicken-and-egg, so the preview stayed empty and Approve was permanently disabled. Auto-run approveMask() whenever the mask screen is active (and on sheet/sensitivity change) so the overlay and preview render immediately. --- frontend/src/capture/SessionCapture.svelte | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/frontend/src/capture/SessionCapture.svelte b/frontend/src/capture/SessionCapture.svelte index 7d29b65..c68ad85 100644 --- a/frontend/src/capture/SessionCapture.svelte +++ b/frontend/src/capture/SessionCapture.svelte @@ -70,6 +70,13 @@ let fileInput: HTMLInputElement; + // Auto-run the mask when entering the mask screen and whenever the sheet or + // sensitivity changes, so the overlay (and preview) is populated without the + // owner having to press Approve first. + $: if (kind === 'mask' && cap.source && cap.source.widthPx > 0) { + void session.approveMask(); + } + function pickFiles(e: Event) { const input = e.target as HTMLInputElement; if (!input.files) return; @@ -164,7 +171,9 @@ {/if} - {#if failed} + {#if overlay && overlay.slabPx === 0} +

No slab pixels detected — the mask removed everything. Lower the sensitivity, or set the sheet to match what the photo sits on, then retake if the shot is dark.

+ {:else if failed}

No slab pixels detected. Adjust controls or retake.

{:else if overlay}

Mask settled: {overlay.slabPx} slab pixels.