Skip to content

chore: bump fig-extract to v2.8.0#26

Merged
onetwothr1 merged 2 commits into
devfrom
chore/fig-extract-v2.8.0
Jul 21, 2026
Merged

chore: bump fig-extract to v2.8.0#26
onetwothr1 merged 2 commits into
devfrom
chore/fig-extract-v2.8.0

Conversation

@onetwothr1

@onetwothr1 onetwothr1 commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

Summary

fig-extract 엔진 v2.8.0을 PDFViewer에 byte-identical하게 반영합니다. 공개 추출 계약은 유지하면서 캡션이 figure의 위·아래·왼쪽·오른쪽에 놓인 레이아웃 탐지 범위를 확장합니다.

Closes: N/A — 이 버전 동기화와 정확히 대응하는 PDFViewer 이슈가 없습니다.
Upstream: onetwothr1/PDFViewer-Figure-Extract@e5f986582f431fba7260f2be46c66846a832225b

Changes

  • src/core/fig-extract.js를 upstream v2.8.0 엔진으로 교체
  • hard-caption stitching과 공통 up/down/left/right 후보 점수·선택 로직 반영
  • side caption용 column-profile scan 및 보수적 경계/stopper 처리 반영
  • docs/fig-extract-integration.md에 v2.8 지원 범위와 잔여 제한 업데이트
  • exported API, 결과 필드, 좌표계, (num, page) 식별자 및 manifest 스키마 변경 없음

Impact

상단·좌측·우측 캡션 레이아웃의 figure 탐지 범위가 넓어집니다. captionless figure, 약한 side 정렬, cross-page figure는 계속 보수적으로 제한됩니다. PDFViewer wrapper나 UI 계약 변경은 없습니다.

Test plan

  • Vendored engine SHA256 일치: CDB14E2F4ED075BDE0BBB1B2DD657D9DE5D658CAD242EB2B27280AEBEA659BB0
  • npm run typecheck
  • npm run build
  • Margin PDF의 Figures 탭 수동 smoke test: 정상

Checklist

  • PR 제목은 Conventional Commits 형식
  • 관련 자동 검증 통과
  • AI-assisted

Summary by CodeRabbit

  • 새로운 기능

    • 상·하·좌·우 방향의 figure 후보를 더욱 폭넓게 탐지합니다.
    • 분리된 캡션 라벨도 연결해 figure 탐지 정확도를 높였습니다.
    • 캡션과 본문, 이미지 경계를 분석해 figure 영역을 보수적으로 선택합니다.
  • 버그 수정

    • 텍스트 꼬리나 인접 캡션으로 인해 figure 영역이 잘못 확장되는 문제를 개선했습니다.
  • 문서

    • 캡션 기반 탐지의 지원 범위와 제한 사항을 최신 동작에 맞게 업데이트했습니다.
    • 서로 다른 페이지에 배치된 캡션과 figure, side-caption 레이아웃은 계속 지원되지 않습니다.

@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c20083c5-bb31-464d-bf1c-1612ff835fd4

📥 Commits

Reviewing files that changed from the base of the PR and between 774f7b0 and 9ee6d59.

📒 Files selected for processing (2)
  • docs/fig-extract-integration.md
  • src/core/fig-extract.js

📝 Walkthrough

Walkthrough

캡션 앵커 생성과 소유관계 처리가 v2.8.0으로 갱신되었으며, 상·하·좌·우 figure 후보 탐지, prose-tail 종료, 후보 억제 및 선택 정책이 확장되었습니다. 관련 문서의 지원 범위와 제한도 수정되었습니다.

Changes

Figure extraction v2.8.0

Layer / File(s) Summary
캡션 앵커 및 규약 갱신
src/core/fig-extract.js, docs/fig-extract-integration.md
버전을 2.8.0으로 변경하고, 분리된 라벨 조각을 stitched 캡션 앵커로 연결했습니다. 방향별 후보 지원과 side caption 및 페이지 간 캡션 제한을 문서화했습니다.
캡션 기반 페이지 감지 통합
src/core/fig-extract.js
페이지별 captionData를 생성·전달하고, 캡션 소유관계를 사용해 캡션 확장과 stopper 경계를 판정합니다.
상하 후보 스캔 제어
src/core/fig-extract.js
down 스캔에 prose-tail 종료 조건을 추가하고, 상하 후보 확장의 bodyish 및 의심 신호 판정을 소유관계 기반으로 변경했습니다.
좌우 후보 생성 및 최종 선택
src/core/fig-extract.js
side 프로파일과 종료·보호 규칙을 추가했으며, 분리된 후보와 text-tail 후보를 억제하고 선택 마진 정책을 조정했습니다.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant extract
  participant captionAnchors
  participant detectPage
  participant CandidateScans
  participant chooseCandidate
  extract->>captionAnchors: 페이지 텍스트 분석
  captionAnchors->>extract: captionData 반환
  extract->>detectPage: 페이지와 captionData 전달
  detectPage->>CandidateScans: 상하좌우 후보 생성
  CandidateScans->>chooseCandidate: 후보, 증거, 거부 사유 전달
  chooseCandidate->>detectPage: 선택된 후보 반환
Loading

Possibly related PRs

  • enu3379/PDFViewer#25: 캡션 및 figure 후보 생성·선택 흐름의 이전 버전 변경과 직접 연결됩니다.
  • enu3379/PDFViewer#24: 캡션 탐지 로직과 이번 소유관계 기반 후보 확장의 기반이 연결됩니다.
  • enu3379/PDFViewer#22: 동일한 fig-extract.js 엔진과 extract 파이프라인을 갱신합니다.

Suggested reviewers: enu3379

Poem

당근처럼 캡션 조각 이어 붙여,
위아래 옆으로 그림을 찾아요.
꼬리 긴 글은 살짝 멈추고,
엉킨 후보는 조심히 걸러요.
토끼도 외쳐요, “v2.8.0 만세!”

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/fig-extract-v2.8.0

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ast-grep (0.44.1)
src/core/fig-extract.js

ast-grep timed out on this file


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@onetwothr1
onetwothr1 marked this pull request as ready for review July 21, 2026 04:17
@onetwothr1
onetwothr1 requested a review from enu3379 as a code owner July 21, 2026 04:17
@onetwothr1
onetwothr1 merged commit 5d23091 into dev Jul 21, 2026
3 checks passed
@onetwothr1
onetwothr1 deleted the chore/fig-extract-v2.8.0 branch July 21, 2026 04:18
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.

1 participant