feat: spot redactions now created as analyzed with full data

Co-Authored-By: Claude Opus 4.6 <[email protected]>
This commit is contained in:
Alex-GilbertandClaude Opus 4.6 committed 2026-02-20 12:44:35 -06:00
1 parent 7331fc5936
commit 9b9618d9fa
1 file changed
+20 -3
+20 -3
View File
@@ -361,12 +361,29 @@ canvas.addEventListener("dblclick", async (e) => {
return;
}
const r = await resp.json();
state.redactions[r.id] = {
const redaction = {
id: r.id, x: r.x, y: r.y, w: r.w, h: r.h,
page: state.currentPage,
status: "unanalyzed",
analysis: null, solution: null, preview: null,
status: r.analysis ? "analyzed" : "unanalyzed",
analysis: r.analysis || null,
solution: null,
preview: null,
};
if (r.analysis) {
redaction.overrides = {
fontId: r.analysis.font.id,
fontSize: r.analysis.font.size,
offsetX: r.analysis.offset_x || 0,
offsetY: r.analysis.offset_y || 0,
gapWidth: r.analysis.gap.w,
leftText: r.analysis.segments[0]?.text || "",
rightText: r.analysis.segments[1]?.text || "",
};
}
state.redactions[r.id] = redaction;
renderRedactionList();
renderCanvas();
activateRedaction(r.id);