Repository navigation
Conversation
Header/footer parts registered only run-level ins/del/moveFrom/moveTo, so a paragraph mark, a pPrChange, or a row/cell/table-property revision in a header was invisible to `track-changes list`, and `accept --all` reported "no tracked changes" while leaving the markup pending. The marginal walk now registers pPrChange, paragraph marks (with their owning paragraph on the reference, since a header paragraph isn't in Body.blockReferences), and the table kinds through the body's own table helpers, in the body's order; text-box stories walk as block containers. Apply resyncs grids and prunes empty hyperlinks in marginal trees too, and rejecting the inserted mark of a story's only paragraph keeps the paragraph so the part stays valid. First slice of #37 (track-changes completeness). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LkctENj7B2nTmUttTgfBhs Triage-Routine: true
Owner
Author
|
🤖 docx-cli triage This PR is the first slice of #37: track-changes completeness inside headers and footers. Every revision kind the body registers now lists in headers too, and Action needed: approve/merge — review PR #48 and merge it if the slice looks right; then decide the open questions in #37 (find/replace default scope, Generated by Claude Code |
6 tasks
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
Header/footer parts registered only run-level
ins/del/moveFrom/moveTo. A paragraph-mark revision, apPrChange, or a table row/cell/property revision in a header didn't appear intrack-changes list, soaccept --alldid nothing and exited 0 while the change stayed pending. This is the "Tracked changes" bullet of #37. Onmain, for a header with a centered-alignmentpPrChangeplus a deleted paragraph mark:What changed
core/ast/read.ts: the marginal walk now registerspPrChange, paragraph marks, and every table kind (tblPrChange,tblGridChange,rowIns/rowDel,cellIns/cellDel,tcPrChange), in the same order the body uses. It reuses the body's table-revision helpers, which now take aRevisionScope, so all ids are still minted inregisterTrackedChange. Text-box stories are walked as block containers too.Body.blockReferences, so its paragraph-mark reference now stores the owningparagraph/paragraphParentitself (TrackedChangeReference).core/track-changes/apply.tsuses those fields when present.<w:hdr/>or<w:tc>.src/cli/track-changes/CLAUDE.md, and thelist --helptext.Verification
listshowstc0 format hdr0 alignment ·→centerandtc1 delete hdr0 ¶ paragraph mark. The read hint showspending="tc0 tc1"andpending=2 (hdr0: 2).accept --allapplies 2 changes, andheaders listthen shows"AcmeLetterhead"(the two lines merged).tests/cli/headers-footers.test.ts:pPrChangewith prior/current values, reject restoresapply, with the grid resync andvalidatepassingbun run check✅bun run test:unit✅ (2097 tests)Decisions for you
hdr0:pNlocators, render header blocks as Markdown, or letedit/insert/findwork inside headers. Those parts need the product calls the issue lists as open: whetherfind/replace --allinclude headers by default, howwccounts them, and whether comments and footnotes are allowed in headers.rPrChangeis still not registered in headers, the same as in the body (it isn't modeled anywhere yet).Refs #37 (first slice: track-changes completeness — does not close the issue)
Generated by Claude Code