Skip to content

chore: bump fig-extract to v2.5.1 - #23

Merged
onetwothr1 merged 4 commits into
devfrom
chore/bump-fig-extract-v2.5.1
Jul 15, 2026
Merged

chore: bump fig-extract to v2.5.1#23
onetwothr1 merged 4 commits into
devfrom
chore/bump-fig-extract-v2.5.1

Conversation

@onetwothr1

@onetwothr1 onetwothr1 commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

Summary

figure-preview-test 엔진 v2.5.1을 byte-identical 벤더링. PDFViewer#12 메모리 대응의 엔진 측 작업을 land.

Changes

  • src/core/fig-extract.js — v2.5.1 byte-identical 복사 (엔진 repo에서만 수정, 여기선 복사)
    • figure.canvas(페이지 전체 렌더 보관) 폐지 → figure.cropCanvas(그림 영역만 즉시 크롭). figure마다 ~9.4MB scale-2.2 페이지 캔버스를 물던 상주 구조 제거 → 스캔 중 페이지 캔버스 동시 상주 최대 1장
    • 페이지 스캔 상한 기본값(60) 제거 — 미지정 시 전체 페이지 스캔, opts.maxPages는 선택적 상한으로 유지
    • opts.signal abort 시 진행 중 페이지 렌더도 RenderTask.cancel()로 즉시 중단 (페이지 경계 대기 제거)
  • src/core/fig-engine.tsEngineFigure.canvascropCanvas, maxPages·signal 주석 동기화
  • docs/fig-extract-integration.md — 크롭 캔버스 수명·취소 가이드 갱신 (호스트가 문서 교체 시 signal abort 필수임을 명시)
  • test/* — mock figure의 canvascropCanvas

#12 acceptance criteria

  • Full-page canvases are not retained for every figure-bearing page after previews are produced — cropCanvas로 대체, 페이지 캔버스 미보관
  • Engine changes are made upstream first, then vendored byte-identically with a version bump — 엔진 repo v2.5.1 후 byte-identical 벤더링
  • npm run typecheck · npm test(25) · npm run build 통과
  • Peak retained page render surfaces bounded (LRU) — 엔진 피크는 1장으로 bound. Margin render-region.ts LRU 3장은 후속
  • Document replacement cancels the previous extraction — 엔진 메커니즘 완비(signal + in-flight 렌더 취소). main.tsAbortController로 signal 전달·abort하는 wiring은 후속 (feat: add figure reference links, panel jumps, and crop flow #17 머지 후)
  • Preview Blob/Object URLs revoked — Margin 측 (현행 dataURL 캐시 setDocument clear로 충족 검토)
  • Long figure-heavy PDF memory QA documented — 후속

Test plan

  • npm run typecheck
  • npm test (6 files, 25 tests)
  • npm run build
  • 런타임 스캔 검증 — 벤더 엔진은 탐지·bbox 로직 무변경(엔진 repo에서 patch로 판정, 물리 diff 0 기대). Margin 통합 런타임은 후속 wiring PR에서

Notes

후속 Margin wiring(main.ts signal 전달, render-region.ts LRU, 메모리 QA)은 #17(figure-ux) 머지 후 별도 PR. 이 PR은 엔진 vendoring + 타입/문서 동기화만.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • 개선 사항
    • 문서 전체 페이지를 기본으로 스캔하도록 maxPages 동작을 개선했습니다.
    • 작업 취소 시 진행 중인 페이지 렌더링이 즉시 중단됩니다.
    • 그림별 크롭 캔버스를 사용해 미리보기 생성과 메모리 관리 효율을 높였습니다.
    • 중복 그림을 더 일찍 제거하고, 불필요한 페이지 전체 캔버스 보관을 줄였습니다.
  • 문서
    • 취소 처리와 캔버스 수명 관리 규칙을 최신 동작에 맞게 업데이트했습니다.

figure-preview-test v2.5.1 엔진을 byte-identical 벤더링. 메모리 패치(#12):
- figure.canvas(페이지 전체 렌더 보관) 폐지 → figure.cropCanvas(그림 영역만
  즉시 크롭). figure마다 ~9.4MB 페이지 캔버스를 물던 상주 구조 제거, 스캔 중
  페이지 캔버스 동시 상주 최대 1장.
- 페이지 스캔 상한 기본값(60) 제거 — 미지정 시 전체 페이지. opts.maxPages 유지.
- opts.signal abort 시 진행 중 페이지 렌더도 RenderTask.cancel()로 즉시 중단.

타입/문서 동기화: fig-engine.ts EngineFigure.canvas→cropCanvas, maxPages·signal
주석, integration.md 크롭 캔버스 수명·취소 가이드. mock figure의 canvas→cropCanvas.

typecheck·test(25)·build 통과. #12 문서 교체 취소 wiring(main.ts signal 전달),
render-region LRU, 메모리 QA는 후속 Margin 작업 (#17 머지 후).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@onetwothr1
onetwothr1 requested a review from enu3379 as a code owner July 15, 2026 14:26
@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@onetwothr1, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 33 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a33213fb-ffba-45b9-a319-f1e1974e94a5

📥 Commits

Reviewing files that changed from the base of the PR and between f70a3c7 and 4b6c282.

📒 Files selected for processing (2)
  • src/core/fig-extract.js
  • test/fig-engine.test.ts
📝 Walkthrough

Walkthrough

FigExtract를 2.5.1로 갱신하고, 미지정 시 전체 페이지를 스캔하도록 변경했다. abort 시 진행 중 렌더를 취소하며, figure에는 페이지 전체 캔버스 대신 cropCanvas를 보관한다.

Changes

FigExtract 2.5.1 통합

Layer / File(s) Summary
공개 계약 및 스캔 범위
src/core/fig-engine.ts, src/core/fig-extract.js
EngineFigurecropCanvas를 노출하고, maxPages 미지정 시 전체 페이지를 스캔하도록 변경했다.
렌더 취소 및 cropCanvas 파이프라인
src/core/fig-extract.js
abort 시 RenderTask.cancel()을 호출하고, 중복 제거된 figure에 대해 즉시 cropCanvas를 생성하도록 변경했다.
통합 문서 및 소비자 검증
docs/fig-extract-integration.md, test/fig-engine.test.ts, test/tab-figures.test.ts
새로운 취소·메모리 수명 규약과 cropCanvas 입력 shape를 문서 및 테스트에 반영했다.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Host
  participant FigExtract
  participant RenderTask
  participant FigureResult
  Host->>FigExtract: extract(opts)
  FigExtract->>RenderTask: 페이지 렌더 시작
  Host->>FigExtract: signal abort
  FigExtract->>RenderTask: RenderTask.cancel()
  RenderTask-->>FigExtract: AbortError 반환
  FigExtract->>FigureResult: 중복 제거 후 cropCanvas 생성
Loading

Possibly related issues

Possibly related PRs

  • enu3379/PDFViewer#2fig-extractEngineFigure 통합 변경의 기반이 된 초기 연동 작업이다.
  • enu3379/PDFViewer#22 — 동일한 figure 중복 제거와 AbortSignal 취소 흐름을 수정한다.

Suggested reviewers: enu3379

Poem

당근처럼 가벼워진 캔버스,
토끼는 cropCanvas를 품고
긴 페이지도 끝까지 달려가네.
abort 신호가 울리면 폴짝,
렌더는 즉시 멈추고
새 버전 꽃이 피었네.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목이 fig-extract를 v2.5.1로 올리는 핵심 변경을 정확하고 간결하게 요약합니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/bump-fig-extract-v2.5.1

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/core/fig-extract.js`:
- Around line 478-483: Update the rendering flow around the task created by
pd.page.render and invoke the existing checkAborted() immediately before
starting or awaiting the render, so cancellation that occurred during earlier
asynchronous work is detected even after the abort event has fired. Preserve the
current onAbort listener and task.cancel() behavior for aborts occurring while
rendering.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 29936540-81c5-4a50-aebb-eea12a29cd1d

📥 Commits

Reviewing files that changed from the base of the PR and between b99460c and f70a3c7.

📒 Files selected for processing (5)
  • docs/fig-extract-integration.md
  • src/core/fig-engine.ts
  • src/core/fig-extract.js
  • test/fig-engine.test.ts
  • test/tab-figures.test.ts

Comment thread src/core/fig-extract.js Outdated
onetwothr1 and others added 3 commits July 15, 2026 23:43
엔진 원본(figure-preview-test)에 coderabbitai(#23) 지적 수정 후 byte-identical
재벤더링. 페이지 상단 checkAborted 이후 await 도중 abort 시 렌더 리스너가 안
불려 전체 페이지 렌더가 낭비되던 race를 렌더 시작 직전 checkAborted()로 차단.

typecheck·build 통과.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
dev의 #18(figure 번호 보존) 머지로 fig-engine.test.ts에 추가된 EngineFigure
리터럴이 구 canvas 필드를 써 v2.5.1 타입(cropCanvas)과 충돌 → PR CI(브랜치+dev
머지 트리)에서 tsc 실패. 해당 리터럴을 cropCanvas로 갱신하고, 누락돼 있던
EngineResult.suspectedMissing도 채워 typecheck 통과.

typecheck·test(26)·build 통과. 벤더 엔진 byte-identical 유지.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@onetwothr1
onetwothr1 merged commit 5ce9f88 into dev Jul 15, 2026
3 checks passed
@onetwothr1
onetwothr1 deleted the chore/bump-fig-extract-v2.5.1 branch July 15, 2026 14:58
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