Skip to content

feat(spreadsheet): grow an ods sheet to the position a write names - #868

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

feat(spreadsheet): grow an ods sheet to the position a write names#868
andiwand merged 1 commit into
mainfrom
feat/sheet-grow-ods

Conversation

@andiwand

@andiwand andiwand commented Sep 9, 2026

Copy link
Copy Markdown
Member

🤖 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_cell refused 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_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 — split_row_at comes out of claim_cell for 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). A table:table-row therefore lands before table:named-expressions, and a table:table-column before 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 csv on a grown sheet reads it back as a,7.5,, / ,,, / ,,,grown — the appended rows, cells and column declarations are what LibreOffice expects.

Test

OdfSheetWrite gains 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 against table:named-expressions, and a new declaration landing after the ones the file states.

DocumentEdit.the_ops_before_a_refusal_are_applied refused on the absent cell, which is written now; it names an absent sheet instead.

https://claude.ai/code/session_01KKFKbUVCYF2VhujdmjhhPW

@andiwand
andiwand force-pushed the feat/sheet-grow-ods branch from b1a34f0 to 0e4adc5 Compare September 9, 2026 18:36
@andiwand
andiwand force-pushed the feat/sheet-materialise-ods branch from c51c631 to 245e772 Compare September 9, 2026 19:39
@andiwand
andiwand force-pushed the feat/sheet-grow-ods branch from 0e4adc5 to 9e6f87f Compare September 9, 2026 19:41
Base automatically changed from feat/sheet-materialise-ods to main September 9, 2026 20:06
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
andiwand force-pushed the feat/sheet-grow-ods branch from 9e6f87f to 4e73db9 Compare September 9, 2026 20:11
@andiwand
andiwand merged commit c777081 into main Sep 9, 2026
25 checks passed
@andiwand
andiwand deleted the feat/sheet-grow-ods branch September 9, 2026 20:12
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