fix(fe): mask auto-run keyed on control, no settle loop

Key the auto-run off a controlKey (sheet:sensitivity) so it fires on mask
entry and on each sheet/sensitivity edit, but never re-fires when approveMask
settles the overlay - preventing both the empty-preview bug and an infinite
settle loop.
This commit is contained in:
2026-09-25 09:15:20 -07:00
parent e4a05dd468
commit 703655a763
+6 -4
View File
@@ -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();
}