Skip to content

feat: Show pagination progress during PDF build#853

Open
u1f992 wants to merge 5 commits into
mainfrom
feat/pdf-build-pagination-progress
Open

feat: Show pagination progress during PDF build#853
u1f992 wants to merge 5 commits into
mainfrom
feat/pdf-build-pagination-progress

Conversation

@u1f992

@u1f992 u1f992 commented Jul 3, 2026

Copy link
Copy Markdown
Member

refs: vivliostyle/vivliostyle.js#2039 vivliostyle/vivliostyle.js#2040 vivliostyle/vivliostyle.js#2041

PDFビルド時のログをリッチにするPRです。進行中のファイル、ページ数、割合、残り時間目安が表示されるようになります。

cli

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR enriches the PDF build experience by reporting pagination progress (pages, percentage, ETA) during Vivliostyle typesetting, integrating viewer-side progress events into the CLI’s spinner logging.

Changes:

  • Add an ETA estimator + formatter utility and unit tests.
  • Wire paginationprogress events from the Vivliostyle viewer into buildPDF() to update spinner text with pages/%/ETA.
  • Add Logger.logUpdateProgress() for high-frequency in-place spinner text updates.

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/progress-eta.test.ts Adds unit tests for ETA estimation and formatting.
src/output/progress-eta.ts Introduces ETA estimator (EMA-smoothed) and formatEta() helper.
src/output/pdf.ts Hooks viewer paginationprogress into CLI logging and displays pages/%/ETA.
src/logger.ts Adds logUpdateProgress() to update spinner text without checkpoint lines.
src/global-viewer.d.ts Extends window/payload typings for pagination progress reporting.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/output/pdf.ts
Comment thread src/output/pdf.ts
Comment thread src/output/pdf.ts

@spring-raining spring-raining left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

examples/table-of-contents など、プロジェクトによってはログ出力が壊れる状態になっています。おそらく logUpdateProgress が短い時間で呼び出されることで起こるバグなので修正してもらえますか?

Image

@u1f992

u1f992 commented Jul 5, 2026

Copy link
Copy Markdown
Member Author

確認しています。今のところyocto-spinnerとハイパーリンク表示の問題ではないかなとみています。

@u1f992

u1f992 commented Jul 5, 2026

Copy link
Copy Markdown
Member Author

sindresorhus/yocto-spinner#18 に報告済みです。Vivliostyle CLI側ではハイパーリンクを無効にします。

@u1f992 u1f992 force-pushed the feat/pdf-build-pagination-progress branch from a98613e to b69f2fb Compare July 5, 2026 14:08
@u1f992

u1f992 commented Jul 6, 2026

Copy link
Copy Markdown
Member Author

さっそく直していただけたので更新しました。

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.

3 participants