chore: bump fig-extract to v2.5.1 - #23
Conversation
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>
|
Warning Review limit reached
Next review available in: 33 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the 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 configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughFigExtract를 2.5.1로 갱신하고, 미지정 시 전체 페이지를 스캔하도록 변경했다. abort 시 진행 중 렌더를 취소하며, figure에는 페이지 전체 캔버스 대신 cropCanvas를 보관한다. ChangesFigExtract 2.5.1 통합
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 생성
Possibly related issues
Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
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
📒 Files selected for processing (5)
docs/fig-extract-integration.mdsrc/core/fig-engine.tssrc/core/fig-extract.jstest/fig-engine.test.tstest/tab-figures.test.ts
엔진 원본(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>
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장opts.maxPages는 선택적 상한으로 유지opts.signalabort 시 진행 중 페이지 렌더도RenderTask.cancel()로 즉시 중단 (페이지 경계 대기 제거)src/core/fig-engine.ts—EngineFigure.canvas→cropCanvas,maxPages·signal주석 동기화docs/fig-extract-integration.md— 크롭 캔버스 수명·취소 가이드 갱신 (호스트가 문서 교체 시 signal abort 필수임을 명시)test/*— mock figure의canvas→cropCanvas#12 acceptance criteria
cropCanvas로 대체, 페이지 캔버스 미보관npm run typecheck·npm test(25) ·npm run build통과render-region.tsLRU 3장은 후속main.ts가AbortController로 signal 전달·abort하는 wiring은 후속 (feat: add figure reference links, panel jumps, and crop flow #17 머지 후)setDocumentclear로 충족 검토)Test plan
npm run typechecknpm test(6 files, 25 tests)npm run buildNotes
후속 Margin wiring(
main.tssignal 전달,render-region.tsLRU, 메모리 QA)은 #17(figure-ux) 머지 후 별도 PR. 이 PR은 엔진 vendoring + 타입/문서 동기화만.🤖 Generated with Claude Code
Summary by CodeRabbit
maxPages동작을 개선했습니다.