feat(spreadsheet): write into an empty ods cell - #867
Merged
Conversation
An `.ods` file states an empty cell as a node with no content, or as one node for a run of them, and the parser gives such a node no element. A write therefore refused every empty cell, while the page carries no lock on one, so the host got the refusal back after the user had typed. `split_repeat` becomes `claim_cell`: besides cutting the run it appends the `text:p` the file states none of, so the reindex sees a node that is not empty and builds the element the write needs. A cell that a merge spans holds no paragraph either. `holds_one_run` now passes such a cell, and `text_run_of` writes the paragraph, because the page reads it as editable and the engine has to agree. A position past the last cell the file states still refuses. 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-materialise-ods
branch
2 times, most recently
from
September 9, 2026 19:39
c51c631 to
245e772
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
Step 2.1 of
docs/design/spreadsheet-editing.md, the part that was still open: a cell the file states no element for.What it does
An
.odsfile states an empty cell as a node with no content — often one node for a run of a thousand of them — andindex_sheet_rowsgives such a node no element.sheet_set_celltherefore refused every empty cell. The page carries no lock on one, so the user typed and the host got the refusal back.split_repeatbecomesclaim_cell: besides cutting the run it appends thetext:pthe file states none of, so the reindex sees a node that is not empty and builds the element the write goes through.A cell that a merge spans holds no paragraph either, and the page already reads it as editable.
holds_one_runpasses such a cell now, andtext_run_ofwrites the paragraph.What still refuses
A position past the last cell the file states. Growing the sheet is the next pull request in the stack.
Test
OdfSheetWritegains nine cases from inline fixtures: an empty cell, an empty cell in a repeat, one in a repeated row, a number into an empty cell, the style that survives, a merged empty cell, the empty formula cell that still refuses, and a save and reopen. Fullodr_testsuites for odf, ooxml, sheets, cells and edits pass.