feat(spreadsheet): write a cell of several runs - #870
Merged
Conversation
andiwand
force-pushed
the
feat/sheet-grow-xlsx
branch
from
September 9, 2026 18:36
fdc77f2 to
64210bb
Compare
andiwand
force-pushed
the
feat/sheet-rich-cells
branch
from
September 9, 2026 18:36
94fc6a5 to
e4f08f0
Compare
andiwand
force-pushed
the
feat/sheet-grow-xlsx
branch
from
September 9, 2026 19:42
64210bb to
1b8e95e
Compare
andiwand
force-pushed
the
feat/sheet-rich-cells
branch
from
September 9, 2026 19:42
e4f08f0 to
b1f41d2
Compare
andiwand
force-pushed
the
feat/sheet-grow-xlsx
branch
from
September 9, 2026 20:22
1b8e95e to
51aec1f
Compare
A cell whose paragraph held several runs was locked `rich`, because the write went through one text run and would have lost the others. What it loses is the formatting of a text the user is replacing anyway, which is what every spreadsheet does. `text_run_of` descends through a single span before it looks for the run, so a cell that holds one run writes through it and keeps its style - the same walk `spreadsheet.js::runOf` makes over the page, which is what keeps the two showing the same thing. Where the paragraph holds several runs, they are replaced by one, and the elements over the old children keep their ids and stop being reachable, as the xlsx write already did. The `rich` lock stays on what a write would take away without the user seeing it go: a link, whose target is not what the cell shows, and a line break or several paragraphs, which are a second line the overlay cannot write. xlsx needed no engine change - `sheet_set_cell` rewrites the whole `c` - so the lock alone changes there. 1876 cells over 37 files lose the lock in the reference output. The pins are not advanced here; the regeneration goes with the merge. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KKFKbUVCYF2VhujdmjhhPW
andiwand
force-pushed
the
feat/sheet-rich-cells
branch
from
September 9, 2026 20:36
b1f41d2 to
99db1dc
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
Rebased on main now that #869 has landed. Step 2.3 of
docs/design/spreadsheet-editing.md, and the last of step 2.What it does
A cell whose paragraph held several runs was locked
rich, because the write went through one text run and would have lost the others. What it loses is the formatting of a text the user is replacing anyway, which is what every spreadsheet does.text_run_ofdescends through a single span before it looks for the run, so a cell that holds one run writes through it and that run keeps its style — the same walkspreadsheet.js::runOfmakes over the page, which is what keeps the two showing the same thing. Where the paragraph holds several runs they are replaced by one, and the elements over the old children keep their ids and stop being reachable, as the xlsx write already did.The
richlock stays on what a write would take away without the user seeing it go: a link, whose target is not what the cell shows, and a line break or several paragraphs, which are a second line the overlay cannot write.xlsx needed no engine change —
sheet_set_cellrewrites the wholec— so the lock alone changes there.One thing worth knowing
Rebuilding a paragraph removes its old children from the dom while their elements keep their ids. Those elements'
pugi::xml_nodedangles from then on, which is the costooxml/spreadsheetalready pays for the same tombstoning, and it is now written down inodf/AGENTS.md. Nothing reaches them through the tree; anElementhandle taken before the write would.Reference output
The pins are not advanced in this pull request. 1876 cells over 37 files lose
data-odr-lock="rich"and itsodr-lockedclass; every changed line in a local regeneration is one of those<td>s and nothing else. CI is green either way, because.odr-lockedonly sets a cursor and only under.odr-editing, so no pixel moves. The regeneration goes with the merge.Test
OdfSheetWritegains four cases: several runs written, one span kept, and a link and a line break that still refuse.OoxmlSpreadsheetWritegains the richinlineStrcell.html_testgains the cell of several runs that carries no lock and the link that is lockedrich.test/browser/sheet/editing.htmlheld itsrichcell as two runs; it holds a link now. All four sheet check pages pass in headless Chrome — 51, 14, 20 and 8 checks, none failed.https://claude.ai/code/session_01KKFKbUVCYF2VhujdmjhhPW