feat(html): a range takes a picture with it, and undo of a split works - #880
Merged
Conversation
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
force-pushed
the
feat/delete-over-picture
branch
from
September 10, 2026 15:47
04483b3 to
1438176
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 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, soremoveElementcan 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 picturealone 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.
splitLevelcaptured, 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
refreshLineBoxthen replaces. Undo inserted before a node no longer in thetree. 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.jstallies as it goes — so a pagethat 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:
rangebefore it looks at theinput type;
second has to land in another run to be heard;
not refused.
93 of 93 now.
Reference output
document.js,text.js,editing.jsand every page with a drawing change, sothis needs a regen and a pin advance once it and #879 land.