feat(spreadsheet): grow an ods sheet to the position a write names - #868
Merged
Conversation
andiwand
force-pushed
the
feat/sheet-grow-ods
branch
from
September 9, 2026 18:36
b1a34f0 to
0e4adc5
Compare
andiwand
force-pushed
the
feat/sheet-materialise-ods
branch
from
September 9, 2026 19:39
c51c631 to
245e772
Compare
andiwand
force-pushed
the
feat/sheet-grow-ods
branch
from
September 9, 2026 19:41
0e4adc5 to
9e6f87f
Compare
A write past the last cell of a row, past the last row, or past both had nothing to write into, so `sheet_set_cell` refused it. The page cannot name such a position, but the API can, and the refusal was the last one that had nothing to do with what the cell holds. `grow_to_cell` states the rows and the runs of empty cells it takes to reach the position, and `grow_columns` declares the columns the sheet stops before, so `sheet_dimensions` covers the new cell. A repeated row is cut first, because its cells stand for every row it repeats over, so `split_row_at` comes out of `claim_cell`. A `table:table-row` goes before `table:named-expressions` and a `table:table-column` before the rows, which is where [ODF 1.2] 9.1.2 orders them. Nothing caps the position: ODF states no grid limit. LibreOffice opens a grown package and reads the new cell, checked with `soffice --convert-to`. `DocumentEdit.the_ops_before_a_refusal_are_applied` refused on the absent cell, which is written now; it names an absent sheet instead. 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-grow-ods
branch
from
September 9, 2026 20:11
9e6f87f to
4e73db9
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 #867 has landed. The rest of step 2.1 of
docs/design/spreadsheet-editing.md.What it does
A write past the last cell of a row, past the last row, or past both had nothing to write into, so
sheet_set_cellrefused it. The page cannot name such a position, but the API can, and it was the last refusal that had nothing to do with what the cell holds.grow_to_cellstates the rows and the runs of empty cells it takes to reach the position, andgrow_columnsdeclares the columns the sheet stops before, sosheet_dimensionscovers the new cell. A repeated row is cut first, because its cells stand for every row it repeats over —split_row_atcomes out ofclaim_cellfor that.Placement is one rule,
insert_ordered: a new child goes before the first one that has to follow it ([ODF 1.2] 9.1.2). Atable:table-rowtherefore lands beforetable:named-expressions, and atable:table-columnbefore the rows — which is after every declaration the file already states, since those all precede the rows.Nothing caps the position: ODF states no grid limit, and the page can only name a cell it rendered. A write far past what LibreOffice holds (1024 × 1048576) still saves a valid package; LibreOffice then drops that cell.
Check
soffice --headless --convert-to csvon a grown sheet reads it back asa,7.5,,/,,,/,,,grown— the appended rows, cells and column declarations are what LibreOffice expects.Test
OdfSheetWritegains eight cases: past the row, past the last row, past both, a repeated row that stays short for its other rows, a sheet with no row at all, a save and reopen, the order againsttable:named-expressions, and a new declaration landing after the ones the file states.DocumentEdit.the_ops_before_a_refusal_are_appliedrefused on the absent cell, which is written now; it names an absent sheet instead.https://claude.ai/code/session_01KKFKbUVCYF2VhujdmjhhPW