feat(html): a sheet writes the same markup editable or not - #860
Merged
Conversation
`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
force-pushed
the
feat/sheet-no-contenteditable
branch
from
September 7, 2026 21:12
53c331b to
84dddcc
Compare
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
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 0.6 — the last item of stage 0.
What it fixes
translate_sheetstampedcontenteditableanddata-odr-pathon every run inside a cell wheneverHtmlConfig::editablewas set, askingelement_is_editableand never the document. Two consequences the plan called out:editableon got a half-working sheet editor — a string saved, a number desynced fromoffice:value;plain_textrefuses to fold an editable run into itstd.Decision 3 puts a sheet's editing in an overlay, so its markup should state none of it.
WritingStategainseditable_markup, false for the statetranslate_sheetwrites 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 pinned —
test/data.cmakeadvances bothREVISIONs to the commits pushed on each output repo'smain.ods/.contenteditableattributes removed — every one underods/; the 29,396 that remain are all indocx/odt/odp/odm/txt/odg.x-selements with them.document.jscatching up with feat(document)!: take an op envelope, not a map of modified text #859'sgenerateDiff, andpdf-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/andresources/, both repos.Also
html_output_test'sread-onlyods 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
an_editable_cell_keeps_the_run_it_is_addressed_byis inverted intoan_editable_sheet_writes_the_markup_a_read_only_one_does, which asserts the editable and read-only pages are byte-identical; a newan_editable_text_document_marks_its_runspins that text documents still carry the attributes.-Wall -Wextra -Werrorover three TUs.