Skip to content

Migrate DOCX and RTF formats to craft-libs (#778) - #6603

Merged
dylanmtaylor merged 1 commit into
mainfrom
codex/craft-libs-cutover
Nov 14, 2026
Merged

dylanmtaylor merged 1 commit into
mainfrom
codex/craft-libs-cutover

Conversation

@dylanmtaylor

Copy link
Copy Markdown
Member

Aggressively removes app-owned document formats from WordCraft:

  • Replaces crates/docx with craft-docx (-26,278 LOC across 68 files), preserving zero-copy image sharing, custom XML FitState preservation, and repeating-DIFAT protection.
  • Replaces crates/formats/src/rtf with craft-rtf (-5,395 LOC across 8 modules).
  • Net code reduction: -30,879 lines of app-owned format code eliminated across 85 files.
  • Full workspace cargo check passes, all 680 wordcraft-formats tests pass, all 41 wordcraft-zotero tests pass.

- Wire craft-wordmodel, craft-docx, craft-rtf (doc), and craft-doc-binary into workspace
- Delete ~26,300 lines of app-owned DOCX parser/serializer in crates/docx
- Implement zero-copy media transfer and FitState custom XML round-trip via craft_wordmodel bridge
- Delete ~5,400 lines of app-owned RTF parser/serializer in crates/formats/src/rtf
- Delegate RTF import, export, parse, and esc to craft-rtf
- Add cfb_guard DIFAT validation and float sanitization on model bridge
- Net reduction: 31,697 deletions, 818 insertions (-30,879 LOC)
@dylanmtaylor
dylanmtaylor merged commit 514085c into main Nov 14, 2026
2 of 6 checks passed
@coderabbitai

coderabbitai Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

Explain Change →

Caution

Review failed

The pull request is closed.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@sonarqubecloud

Copy link
Copy Markdown

Menonro added a commit to Menonro/wordcraft that referenced this pull request Nov 14, 2026
storytold#1630's reader half (a table without w:tblGrid takes its grid from its cells) was a change to
crates/docx/src/read/story/blocks.rs, which is gone from this repository; its two reader tests
go with it. Its layout and engine halves stay, and the commit after them builds on those.
Menonro added a commit to Menonro/wordcraft that referenced this pull request Nov 14, 2026
…#6603)

The VML reader's and the DrawingML writer's half of this change (a line that is off has no
width, v:stroke on before stroked, an outline that is not drawn written with its width) was in
crates/docx/src/read/story/vml.rs and crates/docx/src/write/story/drawing.rs, which are gone
from this repository. It is storytold/craft-libs#1257 now, with its two tests and the fixture
it changes. The layout half and the .doc bridge stay here.
hshamilt added a commit to hshamilt/wordcraft that referenced this pull request Nov 14, 2026
…d#5317)

Main storytold#6603 moved the OOXML reader/writer to craft-libs and deleted crates/docx/src/{read/styles.rs,read/story.rs,write/styles.rs}, the three files this PR edited. The changes are re-applied in craft-libs branch fix/w14-custom-number-format (wordmodel Level.custom_format + docx read/write + round-trip test; pushed to hshamilt/craft-libs), and the four craft-libs pins are bumped to that rev meanwhile. The serde-JSON model bridge maps custom_format without bridge changes, so app-side rendering and the ui/engine/dialog halves are untouched. The 12 wordcraft-docx and 2 wordcraft-engine style-revision failures in the docx suite reproduce identically on pristine origin/main (main migration at 514085c) and are not touched here.
pakiat added a commit to pakiat/wordcraft that referenced this pull request Nov 14, 2026
The reader's part of this change moved to craft-libs with crates/docx (storytold#6603). What stays is ResolvedChar::cs_off, which layout uses, with a test of its own.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
pakiat added a commit to pakiat/wordcraft that referenced this pull request Nov 14, 2026
The DOCX part of this change moved to craft-libs with crates/docx (storytold#6603), and its DOCX tests with it. What stays is the model and the app's side, with their tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
pakiat added a commit to pakiat/wordcraft that referenced this pull request Nov 14, 2026
The DOCX part of this change moved to craft-libs with crates/docx (storytold#6603), and its DOCX tests with it. What stays is the model and the app's side, with their tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
pakiat added a commit to pakiat/wordcraft that referenced this pull request Nov 14, 2026
The DOCX part of this change moved to craft-libs with crates/docx (storytold#6603), and its DOCX tests with it. What stays is the model and the app's side, with their tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
pakiat added a commit to pakiat/wordcraft that referenced this pull request Nov 14, 2026
The DOCX part of this change moved to craft-libs with crates/docx (storytold#6603), and its DOCX tests with it. What stays is the model and the app's side, with their tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
naxvog added a commit to naxvog/craft-libs that referenced this pull request Nov 14, 2026
…ll margins

Port of storytold/wordcraft#3821, whose reader code moved here with storytold/wordcraft#6603. Word's 0.08" cell margin comes from the Normal Table default table style; without a default table style a table that sets no margins (and whose style sets none) has zero margins. The zeros are kept as the table's own, also for the old properties of a tblPrChange, so they survive saving. w:default="on" now marks a default style too.
@benandez
benandez deleted the codex/craft-libs-cutover branch November 23, 2026 19:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant