feat(docx-io): add tracked changes and comments import/export#4836
feat(docx-io): add tracked changes and comments import/export#4836arthrod wants to merge 97 commits intoudecode:mainfrom
Conversation
Add full round-trip support for DOCX tracked changes (suggestions) and comments with threading. This enables import/export of Word documents while preserving revision history and comment discussions. Import pipeline: - Custom mammoth.js fork emits [[DOCX_*:...]] tokens for ins/del/comments - importTrackChanges.ts parses tokens, applies suggestion marks - importComments.ts parses comment tokens, creates discussion structures - importDocx.ts orchestrates full pipeline with token cleanup - searchRange.ts provides text-based range finding for token placement Export pipeline: - exportTrackChanges.ts injects tracking tokens into serialized HTML - exportComments.ts handles comment-specific OOXML generation - html-to-docx enhanced with comments.xml, commentsExtended.xml, commentsIds.xml, commentsExtensible.xml, and people.xml generation - Proper paraId threading for reply chains App integration: - import-toolbar-button.tsx: full DOCX import with user registration - export-toolbar-button.tsx: export with discussions and suggestions - suggestion-node-docx.tsx: DOCX-safe suggestion rendering (no ins/del) - discussion-kit.tsx: paraId fields for round-trip fidelity - docx-export-kit.tsx: SuggestionLeafDocx override for clean export Key features: - Suggestion authorship preserved through round-trip - Comment threading via paraId/parentParaId linking - UTC date handling for cross-timezone compatibility - Overlapping comment ranges supported - ImportedUser type for user store registration
Review or Edit in CodeSandboxOpen the branch in Web Editor • VS Code • Insiders |
|
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
52af579 to
04d04d8
Compare
…oth.js - Remove redundant biome suppression comment in roundtrip.spec.tsx - Use literal key instead of computed expression in export-comment-ids.spec.ts - Exclude vendored mammoth.js directory from biome linting https://claude.ai/code/session_016HSa8FaK9T51SfKE9TvZX4
fix(docx-io): fix lint errors in test files and exclude vendored mamm…
- Fix roundtrip test: replace registry imports with Base* plugins, resolve mammoth fixtures from npm package, add render.as config for table/link plugins to enable proper HTML serialization - Fix export-replies test: update date expectations to match normalizeDate output format (no milliseconds) - Fix lists test: unskip and update expected output to match BaseListPlugin indent-based flat paragraph behavior - Fix testDocxImporter: rewrite to use Base* plugins instead of React plugin variants that required unavailable packages - Add missing devDependencies for test plugins - Fix type error: use any[] for editorPlugins array in tests All 300 tests pass, 0 failures, 0 skipped. https://claude.ai/code/session_01Re6XP9ZEbTqXe4ng3mFRr1
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Removed the 'generate_from_rules' setting from skills.
Removed 'mammoth' dependency from package.json.
Removes ~700MB of downloads (puppeteer ~500MB Chromium, playwright ~200MB). These caused OOM during CI builds. Scripts now print install instructions instead of failing silently. https://claude.ai/code/session_01Re6XP9ZEbTqXe4ng3mFRr1
- Fix DocxExportPlugin import in DocxIOPlugin.spec.tsx (not re-exported from DocxIOPlugin) - Fix SlatePlugin[] type incompatibility in roundtrip.spec.tsx - Add @playwright/test as devDep to @platejs/playwright (was only peerDep, needed for typecheck after removing from root) - Fix biome lint error (template literal) https://claude.ai/code/session_01Re6XP9ZEbTqXe4ng3mFRr1
Skiller moved .claude/rules/ to .claude/skills/ and added SKILL.md metadata files. Also includes external spec file updates. https://claude.ai/code/session_01Re6XP9ZEbTqXe4ng3mFRr1
Staging cherry 4791
Tests were passing <tbody> as children but TableElementStatic wraps children in its own <tbody>, causing nested tbody hydration errors.
|
@zbeyens @felixfeng33 guys you can check the demo here: https://www-staging-9495.up.railway.app/ (vercel also broke my bank haha) |
|
Also, any suggestions on dealing with that template? I found several versions-mismatches there and fixed, but can't find a solution for this component. |
Move buildEnvironment and useLegacyStacker to environments.production per Railway schema (additionalProperties: false at root level). Decouple buildCommand from nested yarn scripts into explicit steps.
Amp-Thread-ID: https://ampcode.com/threads/T-6fd783d6-8524-4046-aed8-95fbbc1c5f6a Co-authored-by: Amp <amp@ampcode.com>
- Import and export are working - Known issue: import (docx → html/plate) is losing styles somewhere in the code - Needs investigation to determine where styles are being dropped during conversion Amp-Thread-ID: https://ampcode.com/threads/T-6fd783d6-8524-4046-aed8-95fbbc1c5f6a Co-authored-by: Amp <amp@ampcode.com>
Add full round-trip support for DOCX tracked changes (suggestions) and comments with threading. This enables import/export of Word documents while preserving revision history and comment discussions.
Import pipeline:
Export pipeline:
App integration:
Key features:
Checklist
yarn typecheckyarn lint:fixyarn testyarn brlyarn changeset