diff --git a/frontend/src/capture/SessionCapture.svelte b/frontend/src/capture/SessionCapture.svelte index c68ad85..8e200b4 100644 --- a/frontend/src/capture/SessionCapture.svelte +++ b/frontend/src/capture/SessionCapture.svelte @@ -70,10 +70,12 @@ 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) { + // Auto-run the mask so the overlay (and preview) populate without the owner + // pressing Approve first. `controlKey` changes only on sheet/sensitivity + // edits (never on the overlay itself), so this fires on entry and on each + // control change - but not when approveMask settles the overlay (no loop). + $: controlKey = kind === 'mask' && cap.control ? `${cap.control.sheet}:${cap.control.sensitivity}` : null; + $: if (controlKey && cap.source && cap.source.widthPx > 0) { void session.approveMask(); }