Skip to content

feat: ir-diff 표 속성 / 컨트롤 식별 비교 추가 (closes #653)#659

Closed
oksure wants to merge 3 commits intoedwardkim:develfrom
oksure:contrib/ir-diff-table-controls
Closed

feat: ir-diff 표 속성 / 컨트롤 식별 비교 추가 (closes #653)#659
oksure wants to merge 3 commits intoedwardkim:develfrom
oksure:contrib/ir-diff-table-controls

Conversation

@oksure
Copy link
Copy Markdown
Contributor

@oksure oksure commented May 7, 2026

변경 요약

ir-diff 명령의 컨트롤 비교를 수(count)만 비교타입 + 속성 식별 비교로 확장합니다.

추가된 비교 항목

컨트롤 타입 식별: 같은 위치의 컨트롤이 다른 타입(tbl vs pic 등)이면 ctrl[N] type: A=tbl vs B=pic 으로 보고

표 (Table) 속성 비교:

  • row_count, col_count
  • page_break (None / CellBreak / RowBreak)
  • repeat_header
  • cell_spacing, border_fill_id
  • outer_margin (좌/상/우/하)
  • CommonObjAttr: treat_as_char, text_wrap, size, offset, vert_rel, horz_rel

그림/도형 CommonObjAttr 비교: 표와 동일한 공통 속성 비교

출력 예시

--- 문단 0.45 --- ""
  [차이] ctrl[0] tbl page_break: A=None vs B=CellBreak
  [차이] ctrl[0] tbl tac: A=false vs B=true
  [차이] ctrl[0] tbl wrap: A=TopAndBottom vs B=Square
  [차이] ctrl[0] tbl size: A=35280x14400 vs B=35280x14520

테스트

  • cargo test 통과
  • cargo clippy -- -D warnings 통과

oksure added 2 commits May 7, 2026 04:42
기존 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개 필드로 확장.
Copilot AI review requested due to automatic review settings May 7, 2026 04:44
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/main.rs Outdated
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 등");
Comment thread CLAUDE.md Outdated

비교 항목: 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 등 개별 속성 비교.
Comment thread src/main.rs Outdated
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));
Comment thread src/main.rs
Comment on lines +2414 to +2419
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));
}
Comment thread src/main.rs Outdated
Comment on lines +2594 to +2608
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: 표/그림/도형 비교 범위 분리 명시
@oksure
Copy link
Copy Markdown
Contributor Author

oksure commented May 7, 2026

Copilot 리뷰 5건 반영 (eb97d9b):

  • border_fillborder_fill_id (필드명 1:1 매칭)
  • voff/hoffv_offset/h_offset (명확한 키 이름)
  • if-let 체인 → single match 블록 (타입 불일치도 match arm에서 처리)
  • help text + CLAUDE.md: 표/그림/도형 비교 범위 분리 명시

@edwardkim edwardkim self-requested a review May 7, 2026 06:36
@edwardkim edwardkim added this to the v1.0.0 milestone May 7, 2026
@edwardkim edwardkim added the enhancement New feature or request label May 7, 2026
edwardkim pushed a commit that referenced this pull request May 7, 2026
@edwardkim
Copy link
Copy Markdown
Owner

@oksure 님 6번째 사이클 PR 정합 — cherry-pick 머지 완료 (devel 0d8b0fe).

처리 결과

메인테이너 → 컨트리뷰터 선구현 패턴

5/5 메인테이너 직접 등록 (Issue #653, HWPX 시리얼라이제이션 영역 작업 중 발견) → 5/7 같은 일자에 외부 컨트리뷰터 선구현. 메인테이너 사이클 단축 + 공동체 비전 (v1.0.0+ 커뮤니티 개방) 정합 사례.

Copilot 리뷰 응답 정합

Copilot 4 코멘트 모두 마지막 commit eb97d9b "address review" 에서 반영:

  • border_fillborder_fill_id
  • voff/hoffv_offset/h_offset
  • ✅ if-let 체인 → single match (exhaustiveness)
  • ✅ help text / CLAUDE.md 정정

후속 권유

Issue #653 의 미커버 영역:

본 영역 후속 PR 환영합니다. 별도 issue 등록 또는 본 환경에서 후속 사이클로 처리 가능합니다.

처리 보고서: mydocs/pr/archives/pr_659_report.md
검토 보고서: mydocs/pr/archives/pr_659_review.md

Issue #653 본질 영역 정합 본 PR 흡수 — 감사합니다 🙏

@edwardkim edwardkim closed this May 7, 2026
edwardkim pushed a commit that referenced this pull request May 7, 2026
- 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)
- 작업지시자 시각 판정 통과
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants