Repository navigation
Description
Summary
Resizing an image by its left-hand (west) corner handles moves the width in the
wrong direction: pulling the left edge outward (left) shrinks the image, and
pushing it inward (right) grows it. The east handles (ne/se) behave
correctly. The persisted width/height attrs on mouse-up inherit the inverted
size, so the wrong size is also what gets saved.
Evidence (verified on main 95bfedb, this run)
pkgs/id/web/src/image-node-view.ts:
:164—private startResize(e: MouseEvent, _corner: string)— the corner
argument is received and deliberately discarded (_corner).:180-185—onResizeMovealways computes
newWidth = Math.max(50, this.startWidth + dx)regardless of which handle
started the drag.- Handles nw/sw are positioned on the left edge
(pkgs/id/web/src/editor-compat.css:1301-1320,left: -5px,
cursor: nw-resize/sw-resize), so for them a leftward drag (negative
dx) is the outward/widening motion — the formula treats it as shrinking.
Probe (targeted vitest, real ImageNodeView + real EditorView/richSchema,
happy-dom; start width falls back to 200px; probe removed after the run, log in
the creator's probe archive):
- se handle, drag right +50px → width
250px(correct control) - nw handle, drag left −50px (outward) → width
150px(expected 250px) - nw handle, drag right +50px (inward) → width
250px(expected 150px) - sw handle, drag left −50px (outward) → width
150px(expected 250px)
ImageNodeView has no test file today (pkgs/id/web/src/image-node-view.ts
is the only editor component of its size without one), which is how this
shipped unnoticed.
Why it matters
Half of the four resize handles do the opposite of what the user drags. Image
sizing is a core rich-editing gesture; users grabbing the natural left edge
get a fighting-the-mouse experience and can persist a wrong size on mouse-up
(onResizeEnd commits offsetWidth/offsetHeight via updateAttrs).
Acceptance criteria
- Dragging nw/sw handles outward widens the image and inward shrinks it;
ne/se behaviour unchanged; aspect ratio still maintained. - The direction is derived from the corner passed to
startResize
(west corners invert the sign ofdx); the min-width (50px) and
editor max-width clamps still apply after the sign fix. - New
image-node-view.test.ts(or equivalent) covers all four corners'
drag directions with a realEditorView, including the committed
width/height attrs on mouse-up. - Web unit tests + typecheck pass.
Notes
Fix is small and self-contained in image-node-view.ts. Siblings in the same
component family, distinct defects: #1381 (image browser teardown), #1379 /
#1323 / #1321 (image upload handlers).
Activity
developing-today commentedon Oct 27, 2026
CODE-482
dezren39 commentedon Oct 27, 2026
state: filed
agent: new-issue-creator-code-b
Found via: filed this run — targeted vitest probe (real ImageNodeView + EditorView/richSchema, happy-dom) on main 95bfedb: se control drag +50px → 250px (correct); nw outward −50px → 150px, nw inward +50px → 250px, sw outward −50px → 150px (all inverted). Root cause: startResize discards the corner (image-node-view.ts:164,
_corner) and onResizeMove always uses startWidth + dx (:185). Probe removed after the run; log: hidden_files/probe-2026-10-27-creator-b3/out.log. Enqueued as a small_fix packet to repo-health-code-pilot.dezren39 commentedon Oct 27, 2026
state: filed
agent: new-issue-creator-code-b
Found via: filed this run — targeted vitest probe (real ImageNodeView + EditorView/richSchema, happy-dom) on main 95bfedb: se control drag +50px → 250px (correct); nw outward −50px → 150px, nw inward +50px → 250px, sw outward −50px → 150px (all inverted). Root cause: startResize discards the corner (image-node-view.ts:164,
_corner) and onResizeMove always uses startWidth + dx (:185). Probe removed after the run; log: hidden_files/probe-2026-10-27-creator-b3/out.log. Enqueued as a small_fix packet to repo-health-code-pilot.49 remaining items
dezren39 commentedon Oct 28, 2026
{"schema":"agent-note:v1","event":"parked","task_id":1362,"worker":"repo-worker-code","lane":"A","note":"Re-parked 20m: PR #1592 visible checks pass; the guard aggregate remains queued behind the stalled flake sub-jobs (#1599). Resume merges on green and completes fixed_merged."}
dezren39 commentedon Oct 28, 2026
🤖 Agent note · parked
bf7b9719: the guard PR check list job has now passed, and 11 checks pass with 0 failures — but 19 nix flake sub-jobs are still pending/queued (fleet runner stall ci: Actions check runs stuck in queued across PRs — no runner pickup since ~05:00Z 2026-10-28 #1599), including test-web-unit and test-web-typecheck, which are this PR's defining checks.bf7b9719, then complete task 1362 as fixed_merged. No code change this resume; the implementation was already complete.dezren39 commentedon Oct 28, 2026
🤖 Agent note · picked up
id(web): fix inverted west resize handles for images (#1389) (#1592)
dezren39 commentedon Oct 28, 2026
🤖 Agent note · done