fix(review): #90 persist the dimension-overlay copy with its role
The Capture→Review upload filtered out the overlay (role !== 'overlay') and sent no role field, so the dimension-overlay copy was never stored and every photo defaulted to role=batch. Review then fell back to a stored /processed URL that had no dimensions drawn — the owner saw the overlay thumbnail without its measurements. Now upload the full lineup with the correct role, keeping the overlay's dimension-drawn blob as both original and processed.
This commit is contained in:
@@ -105,16 +105,22 @@
|
||||
content_source: 'manual',
|
||||
client_rev: 0,
|
||||
});
|
||||
const pngItems = capture.lineup.filter(
|
||||
(it) => it.kind === 'png' && it.role !== 'overlay',
|
||||
);
|
||||
// #90 / REVIEW-5: persist the full lineup with correct roles so the Review
|
||||
// strip matches in-memory blobs by role. The overlay is the dimension-drawn
|
||||
// copy — it must be persisted (its blob already has the dimensions) and is
|
||||
// the photo the owner sees with the measurement overlay. Excluding it (the
|
||||
// old `role !== 'overlay'` filter) dropped the dimension copy from Review.
|
||||
const pngItems = capture.lineup.filter((it) => it.kind === 'png');
|
||||
for (let i = 0; i < pngItems.length; i++) {
|
||||
const it = pngItems[i];
|
||||
await uploadPhoto(id, {
|
||||
photoId: uuid(),
|
||||
seq: i + 1,
|
||||
isCalibration: it.role === 'calibration',
|
||||
role: it.role,
|
||||
original: it.blob,
|
||||
// The calibration/batch PNGs have no separate processed variant; the
|
||||
// overlay blob already carries the drawn dimensions.
|
||||
processed: it.blob,
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user