Skip to content

feat(html): a sheet writes the same markup editable or not - #860

Merged
andiwand merged 2 commits into
mainfrom
feat/sheet-no-contenteditable
Sep 7, 2026
Merged

feat(html): a sheet writes the same markup editable or not#860
andiwand merged 2 commits into
mainfrom
feat/sheet-no-contenteditable

Conversation

@andiwand

@andiwand andiwand commented Sep 7, 2026

Copy link
Copy Markdown
Member

🤖 Generated with Claude Code

Step 0.6 — the last item of stage 0.

What it fixes

translate_sheet stamped contenteditable and data-odr-path on every run inside a cell whenever HtmlConfig::editable was set, asking element_is_editable and never the document. Two consequences the plan called out:

  • an app that turns editable on got a half-working sheet editor — a string saved, a number desynced from office:value;
  • the editable output laid out differently, because plain_text refuses to fold an editable run into its td.

Decision 3 puts a sheet's editing in an overlay, so its markup should state none of it. WritingState gains editable_markup, false for the state translate_sheet writes its content through — cells and the shapes anchored in A1 alike, so the title's claim holds for the whole sheet. Text documents, which have no overlay, are untouched. The condition itself is one helper, writes_editable, rather than the same three terms at two sites.

The gate could not simply be Document::is_editable — step 0.5 made that true for a sheet.

Reference output

The regen is done and pinnedtest/data.cmake advances both REVISIONs to the commits pushed on each output repo's main.

  • 221 output files changed, all under ods/.
  • 645,288 contenteditable attributes removed — every one under ods/; the 29,396 that remain are all in docx/odt/odp/odm/txt/odg.
  • Style classes renumber, because the folded runs take their x-s elements with them.
  • No page's text changes: stripping tags from all 221 changed files gives byte-identical text on both sides.
  • Every change is a modification — nothing added, nothing removed.
  • Three resource files per repo came along: document.js catching up with feat(document)!: take an op envelope, not a map of modified text #859's generateDiff, and pdf-annotation.{css,js} with feat(pdf): hand the annotation gesture policy to the viewer #852's gesture policy. Neither had been regenerated, because neither moved an output file — and a stale resource is loaded, not diffed, so it sits there until something else makes its pages render.

A fresh full run against the new reference is 0 diffs in output/ and resources/, both repos.

Also

html_output_test's read-only ods case now renders identically to the default, which is the point; its comment is updated rather than the case dropped, so the pipeline still pins that the two agree.

Checks

  • 1598 tests, 1592 passed, 6 pre-existing skips. The old an_editable_cell_keeps_the_run_it_is_addressed_by is inverted into an_editable_sheet_writes_the_markup_a_read_only_one_does, which asserts the editable and read-only pages are byte-identical; a new an_editable_text_document_marks_its_runs pins that text documents still carry the attributes.
  • clang-tidy clean; gcc-15 -Wall -Wextra -Werror over three TUs.

Base automatically changed from feat/sheet-op-envelope to main September 7, 2026 21:07
`translate_sheet` stamped `contenteditable` and `data-odr-path` on every run
inside a cell when `HtmlConfig::editable` was set, asking the element and never
the document. That is a half-working sheet editor - a string saved, a number
desynced from `office:value` - and it laid the sheet out differently, since
`plain_text` refuses to fold an editable run into its `td`.

A sheet's editing is an overlay, so its markup states none of it:
`WritingState` gains `editable_markup`, false for the state a sheet writes its
content through. Text documents, which have no overlay, are unchanged.

The reference output loses every `contenteditable` under `ods/` and the runs
fold back into their cells. No page's text changes: all 221 files differ in
markup alone.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01J325TWocZ4iXBjvKv2ZVZi
@andiwand
andiwand force-pushed the feat/sheet-no-contenteditable branch from 53c331b to 84dddcc Compare September 7, 2026 21:12
The sheets lose their `contenteditable`, and the two resource files that no
output change carried with them catch up.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01J325TWocZ4iXBjvKv2ZVZi
@andiwand
andiwand merged commit 4f6663f into main Sep 7, 2026
25 checks passed
@andiwand
andiwand deleted the feat/sheet-no-contenteditable branch September 7, 2026 21:21
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