Compare commits

..

2 Commits

Author SHA1 Message Date
mAi
29e221e080 fix(ui): inspector now updates on device/frame selection
startDrag set state.selection but didn't render until pointerup's onUp
ran — and onUp can throw on `e.currentTarget.classList.remove` if the
event reference is stale after pointer capture release, which leaves
the inspector stuck on 'Nothing selected.'

One-line fix: call render() right after state.selection assignment so
the inspector + halo update from pointerdown, independent of whether
onUp completes cleanly. The drag-completion render at the end of onUp
stays — when both fire it's idempotent (renders are pure functions of
state).
2026-05-15 23:38:12 +02:00
mAi
c7dfbe010c merge: fix +Dev inline-namer blur (sherlock's preventDefault diagnosis)
Primary fix: e.preventDefault() on the pointerdown for both armed-tool
branches in onCanvasPointerDown. Without it, the browser's default
mousedown action blurs the freshly-focused input in promptInline
(the SVG click target isn't focusable), and the blur handler calls
done(null) before m can type.

Secondary fix: clear activeNamer before fo.remove() in done(), to
prevent a re-entrant pageerror when Enter triggers blur synchronously.
2026-05-15 23:18:57 +02:00

View File

@@ -617,6 +617,11 @@ function startDrag(e, kind, id) {
if (state.tool) return; // a tool is armed; don't hijack
e.stopPropagation();
state.selection = { kind, id };
// Render immediately so the inspector reflects the new selection from
// pointerdown — independent of whether the drag-completion render at
// the end of onUp runs. (Previously, the inspector only updated if
// pointerup completed cleanly; any throw in onUp left it stale.)
render();
const svg = /** @type {SVGSVGElement} */ ($("#canvas"));
const start = svgPoint(e);