diff --git a/unredact/static/index.html b/unredact/static/index.html
index 8094e35..79bc3e6 100644
--- a/unredact/static/index.html
+++ b/unredact/static/index.html
@@ -132,7 +132,6 @@
-
diff --git a/unredact/static/inline-edit.js b/unredact/static/inline-edit.js
deleted file mode 100644
index b82493f..0000000
--- a/unredact/static/inline-edit.js
+++ /dev/null
@@ -1,102 +0,0 @@
-// @ts-check
-/**
- * Inline text editing — HTML inputs positioned on the canvas at
- * the left/right text locations so users edit directly on the document.
- */
-import { state } from './state.js';
-import { renderCanvas } from './canvas.js';
-
-const layer = document.getElementById("inline-edit-layer");
-
-let leftInput = null;
-let rightInput = null;
-
-/**
- * Show inline text inputs for the active redaction.
- * @param {string} id - Redaction ID
- */
-export function showInlineEdit(id) {
- hideInlineEdit();
-
- const r = state.redactions[id];
- if (!r?.analysis || !r?.overrides) return;
-
- const a = r.analysis;
- const o = r.overrides;
- const fontSize = o.fontSize || a.font.size;
- const offsetX = o.offsetX || 0;
- const offsetY = o.offsetY || 0;
- const lineX = a.line.x + offsetX;
- const lineY = a.line.y + offsetY;
- const gapWidth = o.gapWidth || a.gap.w;
-
- const leftText = o.leftText || "";
- const rightText = o.rightText || "";
-
- // Left input: positioned at the start of the line, width up to the gap
- const leftWidth = Math.max(30, r.x - lineX);
- leftInput = _createInput(leftText, lineX, lineY, leftWidth, a.line.h, fontSize);
- leftInput.style.textAlign = "right";
- leftInput.addEventListener("input", () => {
- r.overrides.leftText = leftInput.value;
- renderCanvas();
- _syncTextEditBar(r);
- });
-
- // Right input: positioned after the gap
- const rightX = r.x + gapWidth;
- const rightW = Math.max(50, (a.line.x + a.line.w) - rightX + 20);
- rightInput = _createInput(rightText, rightX, lineY, rightW, a.line.h, fontSize);
- rightInput.addEventListener("input", () => {
- r.overrides.rightText = rightInput.value;
- renderCanvas();
- _syncTextEditBar(r);
- });
-
- layer.appendChild(leftInput);
- layer.appendChild(rightInput);
-}
-
-/** Remove all inline edit inputs. */
-export function hideInlineEdit() {
- if (leftInput) { leftInput.remove(); leftInput = null; }
- if (rightInput) { rightInput.remove(); rightInput = null; }
-}
-
-/** Update input values from state (e.g., after text reset or popover bar edit). */
-export function syncInlineEdit(id) {
- const r = state.redactions[id];
- if (!r?.overrides) return;
- if (leftInput) leftInput.value = r.overrides.leftText;
- if (rightInput) rightInput.value = r.overrides.rightText;
-}
-
-function _syncTextEditBar(r) {
- // Keep the bottom text edit bar in sync
- const leftEl = document.getElementById("left-text-input");
- const rightEl = document.getElementById("right-text-input");
- if (leftEl) leftEl.value = r.overrides.leftText;
- if (rightEl) rightEl.value = r.overrides.rightText;
-}
-
-function _createInput(value, x, y, w, h, fontSize) {
- const input = document.createElement("input");
- input.type = "text";
- input.value = value;
- Object.assign(input.style, {
- position: "absolute",
- left: x + "px",
- top: y + "px",
- width: Math.max(30, w) + "px",
- height: h + "px",
- fontSize: fontSize + "px",
- background: "rgba(255,255,255,0.7)",
- border: "1px solid rgba(0,180,0,0.5)",
- padding: "0 2px",
- pointerEvents: "auto",
- boxSizing: "border-box",
- outline: "none",
- fontFamily: "sans-serif",
- });
- return input;
-}
diff --git a/unredact/static/main.js b/unredact/static/main.js
index 1093e35..d397931 100644
--- a/unredact/static/main.js
+++ b/unredact/static/main.js
@@ -12,7 +12,7 @@ import { renderCanvas } from './canvas.js';
import { applyTransform, screenToDoc, hitTestRedaction, initViewport } from './viewport.js';
import { openPopover, closePopover, setOnPopoverClose, updatePosDisplay, initPopover } from './popover.js';
import { stopSolve, acceptSolution, initSolver } from './solver.js';
-import { showInlineEdit, hideInlineEdit, syncInlineEdit } from './inline-edit.js';
+
// ── Font loading ──
@@ -329,7 +329,6 @@ function activateRedaction(id) {
if (r.status === "analyzed" || r.status === "solved") {
openPopover(id);
- showInlineEdit(id);
}
}
@@ -581,21 +580,11 @@ document.addEventListener("keydown", (e) => {
e.preventDefault();
exportAnnotations();
}
- if ((e.key === "Delete" || e.key === "Backspace") && state.activeRedaction) {
- // Don't delete if user is typing in an input
- if (e.target.tagName === "INPUT" || e.target.tagName === "TEXTAREA") return;
- delete state.redactions[state.activeRedaction];
- state.activeRedaction = null;
- closePopover();
- renderRedactionList();
- renderCanvas();
- showToast("Redaction deleted");
- }
});
// ── Initialize all modules ──
-setOnPopoverClose(() => { stopSolve(); hideInlineEdit(); });
+setOnPopoverClose(stopSolve);
initViewport();
initPopover();
initSolver();
diff --git a/unredact/static/popover.js b/unredact/static/popover.js
index 7f141b4..2d03968 100644
--- a/unredact/static/popover.js
+++ b/unredact/static/popover.js
@@ -14,7 +14,6 @@ import {
solveMode, filterLabel,
} from './dom.js';
import { renderCanvas } from './canvas.js';
-import { syncInlineEdit } from './inline-edit.js';
/** @type {(() => void)|null} */
let _onClose = null;
@@ -141,7 +140,7 @@ export function initPopover() {
if (!r?.overrides) return;
r.overrides.leftText = leftTextInput.value;
renderCanvas();
- syncInlineEdit(state.activeRedaction);
+
});
rightTextInput.addEventListener("input", () => {
@@ -149,7 +148,7 @@ export function initPopover() {
if (!r?.overrides) return;
r.overrides.rightText = rightTextInput.value;
renderCanvas();
- syncInlineEdit(state.activeRedaction);
+
});
textReset.addEventListener("click", () => {
@@ -161,7 +160,7 @@ export function initPopover() {
leftTextInput.value = r.overrides.leftText;
rightTextInput.value = r.overrides.rightText;
renderCanvas();
- syncInlineEdit(state.activeRedaction);
+
});
solveTolerance.addEventListener("input", () => {
diff --git a/unredact/static/style.css b/unredact/static/style.css
index 3af81b7..e37d84a 100644
--- a/unredact/static/style.css
+++ b/unredact/static/style.css
@@ -280,13 +280,6 @@ main {
pointer-events: auto;
}
-#inline-edit-layer {
- position: absolute;
- top: 0;
- left: 0;
- pointer-events: none;
- transform-origin: 0 0;
-}
.loading {
color: var(--accent);