Skip to content

feat(html): a range takes a picture with it, and undo of a split works - #880

Merged
andiwand merged 1 commit into
mainfrom
feat/delete-over-picture
Sep 10, 2026
Merged

feat(html): a range takes a picture with it, and undo of a split works#880
andiwand merged 1 commit into
mainfrom
feat/delete-over-picture

Conversation

@andiwand

@andiwand andiwand commented Sep 10, 2026

Copy link
Copy Markdown
Member

🤖 Generated with Claude Code

#879 is merged, so this now sits on main.

The feature you asked for

A selection reaching over a picture is taken now, and the picture goes with
the text. A frame carries data-odr-id, so removeElement can name a drawing;
all five frame writers pass the address, so a shape works the same way.

A frame holding runs is a text box, and the text inside it is text the
reader did not mean to lose — that still refuses. The rule is "an addressed
element that holds no run", which reads as: an operation can name it, and
nothing inside it gets orphaned.

One case it does not reach, recorded in document-editing.md: a picture
alone in its paragraph, where both ends of the range land in a paragraph
with no run. There is no run to anchor the edit to, so it does nothing.
Deleting that one wants a gesture that names the frame, not a range across
text.

Two things found on the way, both worse than what I set out to fix

Undoing a paragraph split threw, and every edit after it in the session was
lost. splitLevel captured, per moved node, the sibling to put it back before
— and for the last of them that sibling is the paragraph's line box, which
refreshLineBox then replaces. Undo inserted before a node no longer in the
tree. What moved is now one list, restored in order ahead of whatever line box
the paragraph has.

The check page was reporting 48 of 93 checks as "48 checks, 0 failed". The
throw above ended the script, and checks.js tallies as it goes — so a page
that dies half way looks like a short green run. Both pages now turn an
uncaught error into a failed check.

The 45 checks that had never run brought three wrong assertions with them:

  • a refusal needs a caret, or the gate says range before it looks at the
    input type;
  • two refusals of the same reason inside two seconds are one event, so the
    second has to land in another run to be heard;
  • an edit inside a paragraph holding no run is taken and changes nothing,
    not refused.

93 of 93 now.

Reference output

document.js, text.js, editing.js and every page with a drawing change, so
this needs a regen and a pin advance once it and #879 land.

Base automatically changed from fix/refusal-messages to main September 10, 2026 15:43
A frame carries `data-odr-id` now, so `removeElement` can name a drawing
and a selection reaching over a picture is taken rather than refused. A
frame holding runs is a text box, and the text in it is text the reader
meant to keep, so that one still refuses.

Two things the check page was hiding, both found on the way.

Undoing a paragraph split threw `insertBefore ... not a child of this
node`, and every edit after it in the session was lost. `splitLevel`
captured, per moved node, the sibling to put it back before - and for the
last of them that sibling is the paragraph's line box, which
`refreshLineBox` then replaces. What moved is now one list, put back in
order ahead of whatever line box the paragraph has.

And the page reported "48 checks, 0 failed" while running 48 of 93: the
throw ended the script, and `checks.js` tallies as it goes, so a page that
dies half way looks like a short green run. Both pages now turn an
uncaught error into a failed check. The 45 checks that had never run
brought three wrong assertions with them - a refusal needs a caret or the
gate says `range` before it looks at the input type, two refusals of the
same reason inside two seconds are one event, and an edit inside a
paragraph holding no run is taken and changes nothing rather than refused.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KKFKbUVCYF2VhujdmjhhPW
@andiwand
andiwand force-pushed the feat/delete-over-picture branch from 04483b3 to 1438176 Compare September 10, 2026 15:47
@andiwand
andiwand merged commit 5aba0d1 into main Sep 10, 2026
25 checks passed
@andiwand
andiwand deleted the feat/delete-over-picture branch September 10, 2026 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant