feat(photos): keep M1 mask/axis/measure on calibration pick (#61)

Document single-source M1 path after pickCalibration: Mask/Axis/Measure/
Calculate use the chosen Source only; batch siblings stay draft-untouched
until #62 apply. Tag encode-fallback inventory Blob as image/png (CAPTURE.md).
This commit is contained in:
2026-09-15 21:14:16 +00:00
parent d2ffa4cad2
commit 8ff008f85c
+5 -1
View File
@@ -405,6 +405,7 @@ export function createCaptureSession(opts: SessionOpts = {}): CaptureSession {
void persist(); void persist();
}, },
// #61: enter M1 Mask on the chosen calibration Source only — never loop batch.
pickCalibration(index: number) { pickCalibration(index: number) {
if (state.k !== 'pickCalibration') return; if (state.k !== 'pickCalibration') return;
if (index < 0 || index >= state.photos.length) return; if (index < 0 || index >= state.photos.length) return;
@@ -434,6 +435,7 @@ export function createCaptureSession(opts: SessionOpts = {}): CaptureSession {
runPass(); runPass();
}, },
// #61: Axis uses the same calibration source; draft.batch siblings stay untouched.
approveMask() { approveMask() {
if (state.k !== 'mask' || !state.overlay || state.overlay.slabPx === 0) return; if (state.k !== 'mask' || !state.overlay || state.overlay.slabPx === 0) return;
teardownWorker(); teardownWorker();
@@ -471,6 +473,7 @@ export function createCaptureSession(opts: SessionOpts = {}): CaptureSession {
void persist(); void persist();
}, },
// #61: M1 Calculate on the calibration source only (batch apply is #62).
async calculate() { async calculate() {
if (state.k !== 'measure') return; if (state.k !== 'measure') return;
const { source, approvedMask, axis, lengthEighths, thicknessEighths } = state; const { source, approvedMask, axis, lengthEighths, thicknessEighths } = state;
@@ -487,7 +490,8 @@ export function createCaptureSession(opts: SessionOpts = {}): CaptureSession {
pngBlob = r.blob; pngBlob = r.blob;
belowFloor = r.sourceBelowFloor; belowFloor = r.sourceBelowFloor;
} catch { } catch {
pngBlob = new Blob(); // CAPTURE.md: inventory is image/png even when encode is unavailable.
pngBlob = new Blob([], { type: 'image/png' });
} }
bitmap.close(); bitmap.close();
if (pngUrl) URL.revokeObjectURL(pngUrl); if (pngUrl) URL.revokeObjectURL(pngUrl);