feat: add HWPX fragment paste support#880
Conversation
0563caa to
44ca568
Compare
|
Updated the branch on top of current Current validation after rebase:
I also added a local pre-push guard in my working copy to prevent accidentally pushing |
|
Welcome to the rhwp project, @dragonnite1221-lgtm! 🎉 This is your first PR and the scope is impressive — HWPX fragment paste with both raw XML and IR migration paths, a yangsik dialog, and thorough test coverage. We've completed a detailed code review. The overall quality is good, but there are a few items to address before we can merge. What we liked
Requested changes1. Dual implementation overlap (medium)
Ask: Please add a note in the PR description explaining the intent, or consolidate into one path if the other is experimental. 2. Type cast in wasm-bridge.ts (medium)(this.doc as any).pasteHwpxFragmentInDocument(...)This bypasses compile-time type safety. Please add the method to the WASM binding type definition instead of using 3. Environment-dependent tests (medium)
Ask: Either bundle a small test fixture in 4. Comment/code mismatch (low)
5. Unused function (low)
How to proceed
We're also happy to discuss architecture decisions (e.g., the dual-path approach) in a GitHub Discussion or Issue if that would help. Thank you for the contribution, and looking forward to the updated PR! |
44ca568 to
29c7cdb
Compare
29c7cdb to
dd430bf
Compare
Adds HWPX fragment paste support, WASM bridge APIs, rhwp-studio insertion UI, and regression tests. Internal work logs, local environment paths, and operational notes were intentionally excluded from this public branch.
Architecture note: this PR intentionally keeps two paste entry points for different safety boundaries.
pasteHwpxFragment/fragment_paste.rsis the raw XML primitive. It performs byte-preserving section/header edits and owns HWPX ID remapping for raw snippets.pasteHwpxFragmentInDocument/fragment_paste_in_document.rsis the editor-facing bridge. It reuses the raw XML primitive, then reparses the updated section back intoDocumentCoreso rendering and later edit commands stay in sync.cross_document_migrate.rsis the IR migration primitive for future structured cross-document copy/paste. It is kept separate from the raw HWPX fragment path because it operates onDocument/DocInfoIR, not byte-preserved HWPX XML. The convergence point is at the command/API layer: raw HWPX fragments use the byte-preserving path now; structured IR copy/paste can use the migration primitive once the editor exposes that workflow.Review follow-up in this revision:
origin/develand preserved the HWPX external-image path fix inparse_hwpx_with_raw_xmls.as anycall by using the generated WASM binding type forpasteHwpxFragmentInDocument.saved/04-blank_hwpx_empty.hwpxfixture so CI gets real regression coverage.saved/04-blank_hwpx_empty.hwpx.build_occupied_setshelper.Validation performed locally:
cargo test --test fragment_paste_integration --test fragment_paste_in_documentcargo test fragment_pastenpm run buildinrhwp-studio/