Repository navigation
Conversation
…paragraph text A run-level <w:sdt> was skipped by the reader, so a Word form's checkbox glyph and any Plain Text / Dropdown field value vanished from read, find and wc (#58). Inline <w:sdt> is now a run-bearing wrapper: the reader and every XML offset walker descend its <w:sdtContent>, a split half keeps the control (sdtPr minus w:id), and the --text diff rebuilds kept text inside the control. A checkbox toggled under tracking stays one checkboxToggle revision. The transparent-wrappers fixture gains a checkbox + text field. Fixes #58 Triage-Routine: true Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LkctEPkr8mq92sCK3ERfG3
This branch has not been deployed
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.
🤖 docx-cli triage
What was wrong
The reader skipped every run-level
<w:sdt>(inline content control), so the text inside one never appeared. That covers a Word form's checkbox glyph and any Plain Text or Dropdown field value. For the issue's paragraph,docx readprintedApproved <!-- p1 -->, anddocx find de.docx "☐"printedno matches(exit 0).wcdidn't count the text either.What changed
<w:sdt>is now a run-bearing wrapper: it is inRUN_BEARING_WRAPPER_TAGS, andwrapperContentNode(sdt)returns its<w:sdtContent>. The reader (walkInlineContentControl) and every XML offset walker step into the same node, sofind,replace,comments addand spaneditoffsets agree.checkboxToggletcN, and accept/reject keep the glyph andw14:checkedin step. Other revisions inside a control now get ordinarytcNs, and accepting or rejecting one changes only the content inside that control.<w:id>, so no two controls share an id.--textrewrite that repeats the control's text keeps that text inside the control, the same way it already keeps hyperlinks (keptWrapper). A checkbox stays a clickable checkbox.transparent-wrappers.docxgains a third paragraph with a checkbox and a Plain Text field.tests/cli/invariants.test.ts. Two existing tests that asserted the old skip are rewritten for the new behaviour.Verification
read→Approved <!-- docx:p p1 raw -->;find "☐"→no matches.read→☐ Approved <!-- docx:p p1 raw -->;find "☐"→p1:0-1;wccounts the glyph.--bold,--textwith and without--track.validateis clean after each.bun run check✅bun run test:unit✅ (2107 tests in the worktree; 2137 in the pre-commit hook run)registerCheckboxTogglehelper. /code-review xhigh: the forked run reviewed the wrong scope (commit feat(images)!: refuse HEIC/HEIF input and drop the LGPL libheif dependency #56 in the main checkout), so I didn't apply its output. I did a manual adversarial pass on this diff instead and found no new bugs (details below).Decisions for you
docx tasks check/uncheck --at pNhandles task-list items only. A form checkbox (Yes/No in a table cell, or several boxes in one paragraph) needs an address for each box, either a new id (e.g.cbN) or a span such aspN:S. Until then,replace ☐ ☒changes the glyph but leavesw14:checkedalone. REFERENCE.md says so.readadd a hint for checkboxes? For example<!-- docx:checkbox pN:0 checked=no -->, which would tell an agent the glyph is a control and not text. I left it out until the verb question above is settled.fldSimple/smartTag/hyperlinks):--track, or--markdown, over a paragraph with pending revisions) leaves wrapper text undeleted. This doubles a glyph, e.g.☒☒ Buy bread.<w:del>, so it can't be restored by reject. Before this PR,fldSimplealready did this (Today is -05-05).--markdownwhole-paragraph edit flattens the control to plain text.--textedit over a checkbox toggle that is still pending now resolves the toggle and prints the Whole-paragraph edit --text --track silently resolves other authors' pending changes #17 warning. That is how other pending text behaves. Before, the control was carried through unseen.Fixes #58
Action needed: approve/merge — review the "Decisions for you" checklist (above all, whether to add a checkbox-toggle verb in this PR or a follow-up), then merge.
Generated by Claude Code