Skip to content

feat(spreadsheet): write into an empty ods cell - #867

Merged
andiwand merged 1 commit into
mainfrom
feat/sheet-materialise-ods
Sep 9, 2026
Merged

feat(spreadsheet): write into an empty ods cell#867
andiwand merged 1 commit into
mainfrom
feat/sheet-materialise-ods

Conversation

@andiwand

@andiwand andiwand commented Sep 9, 2026

Copy link
Copy Markdown
Member

🤖 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 .ods file states an empty cell as a node with no content — often one node for a run of a thousand of them — and index_sheet_rows gives such a node no element. sheet_set_cell therefore refused every empty cell. The page carries no lock on one, so the user typed and the host got the refusal back.

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 goes through.

A cell that a merge spans holds no paragraph either, and the page already reads it as editable. holds_one_run passes such a cell now, and text_run_of writes 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

OdfSheetWrite gains 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. Full odr_test suites for odf, ooxml, sheets, cells and edits pass.

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
andiwand force-pushed the feat/sheet-materialise-ods branch 2 times, most recently from c51c631 to 245e772 Compare September 9, 2026 19:39
@andiwand
andiwand merged commit d807b41 into main Sep 9, 2026
38 of 70 checks passed
@andiwand
andiwand deleted the feat/sheet-materialise-ods branch September 9, 2026 20:06
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