Skip to content

DIFF update#571

Closed
xogh3198 wants to merge 6 commits into
edwardkim:develfrom
xogh3198:main
Closed

DIFF update#571
xogh3198 wants to merge 6 commits into
edwardkim:develfrom
xogh3198:main

Conversation

@xogh3198

@xogh3198 xogh3198 commented May 4, 2026

Copy link
Copy Markdown
Contributor

변경 요약

문서 비교(rhwp-studio)

두 HWP/HWPX 파일을 선택해 차이를 계산하는 문서 비교 UI(compare-dialog).
diff-engine 기반 alignment 전략(앵커·성능 튜닝 포함)으로 본문·컨트롤 diff 수행.
결과 목록과 상세 창(compare-result-window), CompareSessionStore로 세션을 묶고, compare:navigate-diff 이벤트로 hitTest / 문단 경로 기반 편집기 내 이동까지 연결.

문서 비교 (rhwp-studio)
두 HWP/HWPX 파일을 선택해 차이를 계산하는 문서 비교 UI(compare-dialog).
diff-engine 기반 alignment 전략(앵커·성능 튜닝 포함)으로 본문·컨트롤 diff 수행.
결과 목록과 상세 창(compare-result-window), CompareSessionStore로 세션을 묶고, compare:navigate-diff 이벤트로 hitTest / 문단 경로 기반 편집기 내 이동까지 연결.

문서 이력 관리
IndexedDB에 IR 스냅샷(JSON) 저장·목록·삭제·버전 vs 현재 비교 UI(history-dialog).
스냅샷에 문단 stable_id를 포함해 같은 문서 계열 비교 시 identity 전략 사용.
레거시(바이트만 저장된) 항목은 compareDocuments로 폴백.
WASM / 타입 정합
레이어 분리 캔버스 렌더·레이어 트리 JSON(renderPageToCanvasFiltered, getPageLayerTree)과 wasm-bridge 호출에 맞게 pkg/rhwp.d.ts의 HwpDocument 선언 보강.
병합 후 불일치하던 loadWebFonts 반환 타입을 FontLoadReport로 복구해, main 초기화의 폰트 경고 처리와 npx tsc --noEmit 통과.

관련 이슈

없음

테스트

  • cargo test 통과
  • cargo clippy -- -D warnings 통과
  • 관련 샘플 파일로 SVG 내보내기 확인
  • 웹(WASM) 렌더링 확인 (해당하는 경우)

스크린샷

변경 전후 비교가 필요한 경우 첨부해주세요.
image
image
image

thlee2 and others added 6 commits April 30, 2026 16:58
- Global anchors, relative isNearStructure base, norm-hash pins
- rightToLeftPara from alignment into buildControlDiffs slot matching

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>

# Conflicts:
#	rhwp-studio/src/compare/diff-engine-readme.md
#	rhwp-studio/src/compare/diff-engine.ts
#	rhwp-studio/src/compare/types.ts
#	rhwp-studio/src/core/font-loader.ts
#	src/wasm_api.rs
@edwardkim

Copy link
Copy Markdown
Owner

@xogh3198 님, rhwp 에 첫 PR 이시군요 — 환영합니다.

본 PR 의 rhwp-studio 영역 본질 (compare + history) 은 매우 잘 만들어져 있습니다. alignment 전략 (글로벌 앵커 → 구간 정렬 → 상대 구조 근접 → DP 비용) 의 단계화, CompareStrategy = 'identity' | 'alignment' 도메인 분리, 한국어 주석의 정합 모두 본 프로젝트 스타일에 잘 맞습니다.

다만 본 PR 을 그대로 머지하기 어려운 두 가지 사정이 있어 안내드립니다.

1. base skew — src/ revert 우려

본 PR 의 base 가 b84c5e9 로, 본 환경 devel 의 9 commit 전입니다. 그 사이 머지된 7 개 PR 의 본질 정정이 본 PR 의 aae3c89 merge commit 에 의해 사실상 revert 되는 형태입니다.

본 환경 머지 PR diff 의 deletion
Task #555 (PR #562, 옛한글 PUA 폰트 매트릭스) src/renderer/composer/tests.rs -69, composer.rs -16, layout.rs -28, table_layout.rs -32
PR #582 (분수형 위첨자 베이스라인) src/renderer/equation/layout.rs -51
PR #583 (그룹 내 Picture 직렬화) src/serializer/control/tests.rs -79
(회귀 테스트 묶음) src/renderer/layout/integration_tests.rs -312
기타 layout/paragraph_layout 도합 -120

본 PR 을 그대로 머지하면 위 본질 정정들이 회귀합니다. 다음 PR 은 fork 의 devel 을 본 환경 devel 와 동기화한 후 분기해 주시면 매끄럽게 진행됩니다:

git fetch upstream
git checkout devel
git merge --ff-only upstream/devel
git push origin devel
git checkout -b local/task{N}

2. Rust pagination/typeset 변경 — 시각 판정 게이트 필요

본 PR 의 의도된 Rust 변경 영역 중 두 곳이 본 환경의 페이지네이션 본질 영역과 동일합니다:

  • src/renderer/pagination/engine.rsshould_reserve_picture_height 신규 함수 — 그림 높이 예약 결정에 새 분기 (Square 항상 예약 안 함, Paper 기준 머리말 영역만 무예약) 도입
  • src/renderer/typeset.rsnormalize_floating_only_paragraph_height 신규 함수 — 비-TAC 부유 도형만 있는 빈 문단 높이를 0 으로 강제

이 영역은 본 환경의 Task #546/#510/#511/#418/#530 등 시각 회귀가 자주 발생한 곳이라, 본 환경의 13 fixture 수십 페이지에 대해 SVG 비교 + 작업지시자 시각 판정 게이트가 필수입니다. 본 PR 본문에 시각 비교가 없어 별도 사이클로 진행하는 것이 안전합니다.

3. paragraph.rs::stable_id — identity 전략 동작 보강 필요

src/model/paragraph.rsstable_id: String 필드가 추가되었습니다만, parser (src/parser/hwp5/, hwpx/, hwp3/) 어디에서도 stable_id 를 채우지 않아 항상 빈 문자열로 남습니다. 또한 wasm_api 노출도 없어, rhwp-studio 의 identity 전략이 실제로는 alignment fallback 으로만 동작합니다.

identity 동작을 살리려면 (1) parser 에서 stable_id 생성 (2) wasm_api 로 노출 (3) studio identity 경로 통합 — 이 세 단계가 필요합니다.

권장 — 분리 PR

본 PR 을 close 하고 다음 3 개로 나눠 재 PR 부탁드립니다:

  1. rhwp-studio TS (compare + history) 본질 — 위에서 평가한 우수 영역. base 동기화 후 그대로 추출.
  2. Rust pagination/typeset 변경should_reserve_picture_height + normalize_floating_only_paragraph_height. 본 환경 fixture sweep + before/after SVG 비교 + 작업지시자 시각 판정.
  3. paragraph.rs stable_id + parser + WASM 노출 통합 — identity 전략이 실제로 동작하도록.

본 PR 의 우수한 alignment 설계가 1 번 PR 로 빠르게 머지될 수 있도록 검토 준비하겠습니다.

검토 문서: 메인테이너 환경의 mydocs/pr/archives/pr_571_review.md 에 정리되어 있습니다.

@edwardkim edwardkim closed this May 4, 2026
edwardkim added a commit that referenced this pull request May 4, 2026
- mydocs/pr/archives/pr_571_review.md (검토 문서 — base skew + Rust 회귀 위험 + TS 영역 우수 평가)
- mydocs/pr/archives/pr_571_report.md (처리 보고서 — close + 3 개 분리 PR 권장 + base 동기화)
- mydocs/orders/20260504.md: PR #571 항목 추가
edwardkim added a commit that referenced this pull request May 5, 2026
PR #600 (closes #513, @oksure Hyunwoo Park) 1차 검토:
- 본질 결함: Task #509 의 map_pua_bullet_char 매핑이
  convert_pua_enclosed_numbers (composer) 의 CharOverlap 변환에 막혀 도달 못 함
- 본질 정정: composer.rs 에서 F02B1~F02C4 CharOverlap 제외 +
  paragraph_layout.rs 에 ⑩~⑳ 매핑 추가 (전체 20자 완성)
- Copilot review 3개 응답 (aafe85a): ⑩~⑳ 테스트 + 주석 + 폭 계산 정합
- PR base skew (PR #571/#599 패턴) — UI MERGEABLE 표시지만 PR base diff
  가 본 사이클 cherry-pick 모두 revert
- 그러나 본질 commit 영역이 본 사이클 처리분과 0 중첩
  (PR #592 의 SPUA-A 저영역 F0000~F00CF 와 다른 코드포인트 영역)
  → commit 단위 cherry-pick 가능
- 본 환경 임시 검증: 2 commits cherry-pick 충돌 0 +
  cargo test --lib --release 1134 passed (회귀 0) + clippy 0건 +
  PUA 테스트 12 passed

권장 처리: 옵션 A — commit 단위 cherry-pick (2 commits, 단순 머지 절대 금지) +
결정적 검증 + 광범위 sweep + 작업지시자 시각 판정.
edwardkim added a commit that referenced this pull request May 5, 2026
…A SVG 출력 정정 — @oksure 2 commits + 시각 판정 ★ 통과)

PR #600 (closes #513, @oksure Hyunwoo Park):
- 본질 결함: Task #509 의 map_pua_bullet_char 매핑이
  convert_pua_enclosed_numbers (composer) 의 CharOverlap 변환에 막혀 도달 못 함
- 본질 정정: composer.rs 에서 F02B1~F02C4 CharOverlap 제외 +
  paragraph_layout.rs 에 ⑩~⑳ 매핑 추가 (전체 20자 완성)
- Copilot review 3개 응답 (aafe85a): ⑩~⑳ 테스트 + 주석 + 폭 계산 정합

PR base skew (PR #571/#599 패턴) — UI MERGEABLE 표시지만 PR base diff
가 본 사이클 cherry-pick 모두 revert. 그러나 본질 commit 영역이
본 사이클 처리분과 0 중첩 (PR #592 의 SPUA-A 저영역 F0000~F00CF 와
다른 코드포인트 영역 F02B1~F02C4) → commit 단위 cherry-pick 가능.

cherry-pick 2 commits (충돌 0, author Hyunwoo Park 보존):
- 34f8547 fix: Supplementary PUA-A (U+F02B1~F02C4) SVG 출력 정정
- 14f30e8 address review: ⑩~⑳ 테스트 추가 + 주석 갱신 + 폭 계산 정합

검증:
- cargo test --lib --release 1134 passed (회귀 0)
- cargo test --lib pua 12 passed (supplementary_pua_a_maps_circled_digits ⑩~⑳ GREEN)
- svg_snapshot 6/6 / issue_546 1 / issue_554 12 / clippy 0 / build --release
- 광범위 페이지네이션 sweep: 164 fixture / 1,614 페이지 / 회귀 0
- SVG 정량 (원문자 출현): pua-test 0→9 / mel-001 20→34 / kps-ai 32→34 /
  KTX 변경 없음 (PR 본문 100% 재현)

시각 판정 ★ 통과.

별개 영역 발견: pua-test U+F53A 옛한글 자모 시퀀스의 아래아 (U+119E ᆞ)
글리프 미렌더 — 별도 이슈 #615 등록 (옛한글 폰트 fallback 영역).

closes #513.
xogh3198 pushed a commit to xogh3198/rhwp that referenced this pull request May 6, 2026
- pagination: should_reserve_picture_height — Square/InFront/Behind는
  column used_height 미예약, TopAndBottom+Paper는 머리말 밴드 내 무예약
- typeset: normalize_floating_only_paragraph_height — 비-TAC 부유 그림만
  있는 빈 문단의 FormattedParagraph 높이 0으로 맞춤

메인테이너 PR edwardkim#571 분리안 중 Rust pagination/typeset 본질.
시각 판정 게이트 권장(별도 fixture/SVG 비교).

Co-authored-by: Cursor <cursoragent@cursor.com>
xogh3198 pushed a commit to xogh3198/rhwp that referenced this pull request May 11, 2026
edwardkim pushed a commit that referenced this pull request May 11, 2026
edwardkim added a commit that referenced this pull request May 11, 2026
…ine 정합

@xogh3198 — Task #571 분리 PR 1/3 (TypeScript/UI 본질).
PR #571#623#799 점진적 정합 (base skew 해결 + 분리 PR 가이드 정합).

본질:
- diff-engine (정렬/비교 로직, +3105)
- Compare dialog + result window + CSS
- History dialog + IndexedDB store
- WasmBridge 신규 API (hasLoadedDocument / releaseDocument / getTableSignature / getParagraphStableId, graceful fallback)
- 메뉴 + 단축키 (Alt+Shift+V / Ctrl+Shift+H)

후속 분리 PR:
- 2/3 — Rust pagination/typeset (PR #571 페이지네이션 본질)
- 3/3 — paragraph.rs::stable_id parser+WASM 노출 (identity 전략)

메인테이너 정정:
- actual.svg 5 파일 제거 (PR 영역 영역 잘못 staging 된 테스트 임시 출력)
- package-lock.json 영역 devel 측 보존

자기 검증: tsc + cargo test ALL GREEN + WASM 빌드 (4.5 MB)
시각 판정: 작업지시자 웹 에디터 인터랙션 검증 ✅ 통과
@edwardkim

Copy link
Copy Markdown
Owner

PR #799 (분리 PR 1/3) 머지 완료 (commit 6b9ad9e0, devel 5/11).

본 분리 PR 영역 영역 TypeScript/UI 본질 정합:

  • diff-engine + Compare/History 다이얼로그
  • WasmBridge 신규 API (hasLoadedDocument / releaseDocument / getTableSignature / getParagraphStableId, graceful fallback)
  • 단축키 (Alt+Shift+V / Ctrl+Shift+H)

후속 분리 PR 영역 영역 본 이슈 후속:

  • 2/3 — Rust pagination/typeset (페이지네이션 본질)
  • 3/3 — paragraph.rs::stable_id parser + WASM 노출 (identity 전략 완성)

분리 PR 2/3, 3/3 영역 영역 머지 후 본 이슈 close.

xogh3198 added a commit to xogh3198/rhwp that referenced this pull request May 29, 2026
README·다이얼로그 hint 변경은 하지 않고, compare 모듈 README §6.1에 메뉴·단축키·엔진 매핑만 보강한다.

Co-authored-by: Cursor <cursoragent@cursor.com>
xogh3198 added a commit to xogh3198/rhwp that referenced this pull request May 29, 2026
README·다이얼로그 hint 변경은 하지 않고, compare 모듈 README §6.1에 메뉴·단축키·엔진 매핑만 보강한다.

Co-authored-by: Cursor <cursoragent@cursor.com>
xogh3198 added a commit to xogh3198/rhwp that referenced this pull request May 29, 2026
upstream/devel 기준 main 동기화 후 compare 모듈 README §6.1에 메뉴·단축키·엔진 매핑만 보강.

Co-authored-by: Cursor <cursoragent@cursor.com>
edwardkim pushed a commit that referenced this pull request May 29, 2026
upstream/devel 기준 main 동기화 후 compare 모듈 README §6.1에 메뉴·단축키·엔진 매핑만 보강.

Co-authored-by: Cursor <cursoragent@cursor.com>
edwardkim added a commit that referenced this pull request May 29, 2026
PR #571/#799 (rhwp-studio 문서 비교·이력) 커밋 4개가 GitHub 계정과
연결되지 않는 "thlee2 <thlee2>" author 로 기록되어 기여 집계에서
누락됨. .mailmap 으로 올바른 계정(taeho <…xogh3198…>)에 매핑한다.
히스토리는 재작성하지 않으며 git log/shortlog/blame/소스뷰 표시만 통합.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

2 participants