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
|
Thanks for the rebase and conflict resolution. We've tested the code locally — However, we can't merge in the current state because there are no example yangsik fragment files included. When a user clicks "양식 부품" in the menu, they see "양식 부품 카탈로그가 비어있습니다" — the feature has no usable content. We need the PR to be end-to-end testable by a maintainer in the web editor, not only through unit/integration tests with inline XML. What's neededPlease add 1–2 example
A simple table or a standard form header would be sufficient as a demo. Summary of pending items
Once the example fragments are added and items #1–5 are addressed (or explained), we'll re-review and proceed with the merge. Thank you! |
|
One more question — the feature is named "HWPX fragment paste", but rhwp-studio also opens HWP5 ( Does this feature work when the active document is an HWP5 file? HWP5 uses OLE compound binary format while the fragments are HWPX XML. If fragment paste only works with HWPX documents, the Please clarify:
|
PR #880 (@dragonnite1221-lgtm, rhwp 첫 PR) GitHub diff 기반 cherry-pick. mydocs 거버넌스 산출물 제외. insert.ts 충돌 수동 해결. 신규 모듈: - document_core/commands/cross_document_migrate.rs — IR 경로 ID remap - document_core/commands/fragment_paste.rs — raw XML 경로 fragment paste - document_core/commands/fragment_paste_in_document.rs — 문서 내 paste - document_core/queries/raw_xml.rs — XML 쿼리 WASM API: pasteHwpxFragment + pasteHwpxFragmentInDocument + createBlankDocument rhwp-studio: YangsikPartsDialog + vite-plugin-yangsik-fragments + insert:yangsik-parts fixture: saved/04-blank_hwpx_empty.hwpx 검증: - cargo test --release --lib: 1306 passed (+60 신규) - fragment_paste_in_document + fragment_paste_integration: 6 passed - tsc --noEmit: 에러 0 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Closing this PR as there has been no response to the review feedback. The code quality was good and the fragment paste infrastructure was well-designed. If you'd like to revisit this in the future, please address the items listed in the previous review comments (example yangsik fragments, dual implementation clarification, HWP5 compatibility, etc.) and open a new PR. Thank you for the contribution! |
HWPX fragment paste support — 메인테이너 hands-on 테스트에서 동작 결함 2건 발견으로 close. 컨트리뷰터에게 재제출 권고. 발견 결함: - B1: 빈 HWPX 문서에서 after_para_idx 1 out of range - B2: 확인 버튼 무동작 — onConfirm() 항상 false 반환 기타 수정요청 항목 (재제출 시 권고): - M1: 비공개 task 참조 주석 (task_local_yangsik_paste_*) 제거 - M2: cross_document_migrate.rs (미사용 1011줄) 별도 PR 분리 - R1: yangsik 명명 UI ↔ 코드 불일치 해소 PR #880 잔존 6 항목 중 코드 측은 대부분 성실 반영 (예시 fragment, HWP5 비호환 guard, 카탈로그 보안 강화). 핵심 기능 설계도 양호. 그러나 end-to-end UX 게이트 미통과로 close. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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/