Replace custom DOCX tracked changes with docx-track-changes library

🟢 open · #58 · willchen96/mike ← becker-charles/mike · opened 15d ago by becker-charles · +593-1,190 across 11 files · ↗ on GitHub

From the PR description

Changes

  • Replace approx. 1179 line custom docxTrackedChanges.ts with approx. 370 line wrapper around docx-track-changes library
  • Switch from fuzzy text matching (find + context_before/after) to paragraph ID based editing (paraId)
  • Mint and persist stable paragraph IDs on first document read
  • Fix stale preview after accept/reject by bumping refetchKey
  • Remove unused fast-diff and fast-xml-parser dependencies

Benefits

  • More reliable edits: Paragraph IDs are unambiguous vs fuzzy text matching that could match wrong location
  • Simpler maintenance: Leverage maintained library instead of custom XML manipulation
  • Better error messages: Clear feedback when paraId does not exist
  • Smaller codebase: Approx. 800 fewer lines to maintain

Our analysis

Swap custom docx tracked-changes engine for a library wrapper — read the full analysis →

Think the analysis missed something the PR description covers?

Capture this PR into my fork

Download a Markdown prompt that tells Claude how to port every commit in this PR into your working tree. Run it via claude -p < capture-pull-58.md from inside the repo you want the changes in.

⬇ Download capture-pull-58.md