Repository navigation
fix(comments): keep Word's comment sidecars in sync on add/reply/delete - #35
Merged
Merged
Conversation
A Word-saved package carries commentsExtended.xml, commentsIds.xml and commentsExtensible.xml with one entry per comment. `comments add` wrote none of them and `comments delete` never pruned commentsIds/Extensible, so Word offered to repair the file and renumbered every comment. CommentsView now loads and writes commentsIds/commentsExtensible beside commentsExtended, registers a commentEx + commentId (fresh durableId) + commentExtensible for every comment it appends (add, reply, audit), and removes all three on delete. Absent sidecars stay absent. `raw part replace/edit` now rejects the two newly view-owned parts. Fixes #33 Triage-Routine: true Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LkctEMYpX1DxpKLGCMzZxp
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
On a Word-saved file,
comments addwrote the comment intocomments.xmlbut added nothing tocommentsIds.xmlorcommentsExtended.xml, andcomments deletenever removed thecommentsIdsentry. Word then reports unreadable content, and its repair renumbers every comment. Repro ontests/fixtures/academic-paper.docx(44/44/44 comment/id/ext entries):What changed
CommentsViewnow also loads and writescommentsIds.xmlandcommentsExtensible.xml. Every comment it appends (add, reply, audit comment) gets an entry in each sidecar the package already has: aw15:commentEx done="0", aw16cid:commentIdwith a newly minted uniquedurableId, and aw16cex:commentExtensiblewith thatdurableIdanddateUtc.delete(including the reply cascade) removes all three.raw part replace/editnow refuses the two parts the view owns now (otherwise the view would overwrite the raw change on save).tests/cli/comments.test.ts, plus one sentence in REFERENCE.md.Verification
validatepasses.mainand passes with the fix.bun run check✅bun run test:unit✅ (1911 tests; the pre-commit hook also ran 1939 across 59 files)Decisions for you
docx comments rebuild-parts FILEverb (the reporter suggested it) to repair files already written by ≤0.28.0, which have stale side parts. Not built.validateflag side parts that are out of step withcomments.xml? That is tracked separately in feat(validate): report cross-part comment inconsistencies, not only per-part schema errors #34.docx create, which never writes these sidecars. Do you want a Word-shaped fixture checked in (e.g. the reporter's)?Fixes #33
Action needed: approve/merge — PR ready for your review; check it opens without a repair prompt in Word if you can.
Generated by Claude Code