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.
This commit is contained in:
@@ -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 @@
|
||||
</label>
|
||||
</div>
|
||||
{/if}
|
||||
{#if failed}
|
||||
{#if overlay && overlay.slabPx === 0}
|
||||
<p class="err">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.</p>
|
||||
{:else if failed}
|
||||
<p class="err">No slab pixels detected. Adjust controls or retake.</p>
|
||||
{:else if overlay}
|
||||
<p>Mask settled: {overlay.slabPx} slab pixels.</p>
|
||||
|
||||
Reference in New Issue
Block a user