feat: ir-diff 표 속성 / 컨트롤 식별 비교 추가 (closes #653)#659
feat: ir-diff 표 속성 / 컨트롤 식별 비교 추가 (closes #653)#659oksure wants to merge 3 commits intoedwardkim:develfrom
Conversation
기존 ir-diff 는 controls 수만 비교했으나, 이제 개별 컨트롤의
타입(tbl/pic/shape 등)과 속성을 식별 가능 단위로 비교한다.
표: page_break, repeat_header, cell_spacing, border_fill, outer_margin,
treat_as_char, text_wrap, size, offset, vert_rel, horz_rel
그림/도형: treat_as_char, text_wrap, size, offset, vert_rel, horz_rel
기존 text_start, line_height, segment_width 3개만 비교하던 것을 vertical_pos, text_height, baseline_distance, line_spacing, column_start 포함 전체 8개 필드로 확장.
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
ir-diff에서 문단 내 컨트롤 비교를 “개수 비교”에서 “타입 식별 + (표/그림/도형) 속성 비교”로 확장해 불일치 검출력을 높입니다.
Changes:
- 컨트롤 타입 식별 비교 및 컨트롤별(표/그림/도형) 속성 diff 출력 추가
- line_segs 비교 항목 확대(세부 필드 추가)
- 도움말/문서에 비교 항목 및 컨트롤 속성 비교 범위 안내 추가
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| src/main.rs | 컨트롤 태그 식별 및 표/공통 속성 diff 로직 추가, line_segs 세부 비교 추가, help 출력 갱신 |
| CLAUDE.md | ir-diff 비교 항목 설명을 “controls(타입+속성)” 및 컨트롤 속성 비교로 업데이트 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| println!(" 두 파일의 IR(중간표현) 비교 (HWPX↔HWP 불일치 검출)"); | ||
| println!(" 비교 항목: text, char_count, char_offsets, char_shapes, line_segs,"); | ||
| println!(" controls(타입+속성), tab_extended, ParaShape, TabDef"); | ||
| println!(" 표/그림/도형 컨트롤: treat_as_char, wrap, size, offset, page_break 등"); |
|
|
||
| 비교 항목: text, char_count, char_offsets, char_shapes, line_segs, controls, tab_extended, ParaShape(여백/줄간격/탭), TabDef(위치/종류/채움). | ||
| 비교 항목: text, char_count, char_offsets, char_shapes, line_segs, controls(타입+속성), tab_extended, ParaShape(여백/줄간격/탭), TabDef(위치/종류/채움). | ||
| 표/그림/도형 컨트롤: treat_as_char, wrap, size, offset, page_break, outer_margin 등 개별 속성 비교. |
| diffs.push(format!("ctrl[{}] tbl cell_spacing: A={} vs B={}", ci, a.cell_spacing, b.cell_spacing)); | ||
| } | ||
| if a.border_fill_id != b.border_fill_id { | ||
| diffs.push(format!("ctrl[{}] tbl border_fill: A={} vs B={}", ci, a.border_fill_id, b.border_fill_id)); |
| if a.vertical_offset != b.vertical_offset { | ||
| diffs.push(format!("ctrl[{}] {} voff: A={} vs B={}", ci, tag, a.vertical_offset, b.vertical_offset)); | ||
| } | ||
| if a.horizontal_offset != b.horizontal_offset { | ||
| diffs.push(format!("ctrl[{}] {} hoff: A={} vs B={}", ci, tag, a.horizontal_offset, b.horizontal_offset)); | ||
| } |
| let tag_a = control_tag(ca); | ||
| let tag_b = control_tag(cb); | ||
| if tag_a != tag_b { | ||
| diffs.push(format!("ctrl[{}] type: A={} vs B={}", ci, tag_a, tag_b)); | ||
| continue; | ||
| } | ||
| if let (Control::Table(ta), Control::Table(tb)) = (ca, cb) { | ||
| diff_table(&mut diffs, ci, ta, tb); | ||
| } | ||
| if let (Control::Picture(pic_a), Control::Picture(pic_b)) = (ca, cb) { | ||
| diff_common_obj(&mut diffs, ci, "pic", &pic_a.common, &pic_b.common); | ||
| } | ||
| if let (Control::Shape(sa), Control::Shape(sb)) = (ca, cb) { | ||
| diff_common_obj(&mut diffs, ci, "shape", sa.common(), sb.common()); | ||
| } |
- border_fill → border_fill_id (필드명 1:1 매칭) - voff/hoff → v_offset/h_offset (명확한 키) - if-let 체인 → single match (exhaustiveness 활용) - help text/CLAUDE.md: 표/그림/도형 비교 범위 분리 명시
|
Copilot 리뷰 5건 반영 (eb97d9b):
|
|
@oksure 님 6번째 사이클 PR 정합 — cherry-pick 머지 완료 (devel 처리 결과
메인테이너 → 컨트리뷰터 선구현 패턴5/5 메인테이너 직접 등록 (Issue #653, HWPX 시리얼라이제이션 영역 작업 중 발견) → 5/7 같은 일자에 외부 컨트리뷰터 선구현. 메인테이너 사이클 단축 + 공동체 비전 (v1.0.0+ 커뮤니티 개방) 정합 사례. Copilot 리뷰 응답 정합Copilot 4 코멘트 모두 마지막 commit
후속 권유Issue #653 의 미커버 영역:
본 영역 후속 PR 환영합니다. 별도 issue 등록 또는 본 환경에서 후속 사이클로 처리 가능합니다. 처리 보고서: Issue #653 본질 영역 정합 본 PR 흡수 — 감사합니다 🙏 |
- mydocs/pr/archives/pr_659_review.md (검토 보고서, 5/7 작성) - mydocs/pr/archives/pr_659_report.md (처리 보고서, 5/7 작성) - mydocs/orders/20260507.md PR #659 행 추가 (네 번째 처리 PR) PR 처리 본질: - 메인테이너 → 컨트리뷰터 선구현 패턴 (5/5 Issue #653 등록 → 5/7 PR #659 흡수) - 결정적 게이트웨이 검증 (samples/hwpx/aift.hwpx page 1 ir-diff BEFORE 255건 → AFTER 259건) - Issue #653 본질 영역 정확 재현 (HWPX SectionDef 정합 안 됨, ctrl[0] type: A=cold vs B=secd) - Issue #652 본질 #1 추가 검출 (tbl page_break: A=CellBreak vs B=RowBreak) - 작업지시자 시각 판정 통과
변경 요약
ir-diff 명령의 컨트롤 비교를 수(count)만 비교 → 타입 + 속성 식별 비교로 확장합니다.
추가된 비교 항목
컨트롤 타입 식별: 같은 위치의 컨트롤이 다른 타입(tbl vs pic 등)이면
ctrl[N] type: A=tbl vs B=pic으로 보고표 (Table) 속성 비교:
row_count,col_countpage_break(None / CellBreak / RowBreak)repeat_headercell_spacing,border_fill_idouter_margin(좌/상/우/하)treat_as_char,text_wrap,size,offset,vert_rel,horz_rel그림/도형 CommonObjAttr 비교: 표와 동일한 공통 속성 비교
출력 예시
테스트
cargo test통과cargo clippy -- -D warnings통과