Skip to content

[codex] Improve PDF generation UX#160

Merged
ThisIs-Developer merged 3 commits into
mainfrom
codex/improve-pdf-generation-ux
Jun 5, 2026
Merged

[codex] Improve PDF generation UX#160
ThisIs-Developer merged 3 commits into
mainfrom
codex/improve-pdf-generation-ux

Conversation

@ThisIs-Developer
Copy link
Copy Markdown
Owner

Summary

  • Adds a PDF generation progress modal with percentage, current step, ETA, and cancellation.
  • Resets export button and temporary export DOM from a guaranteed cleanup path after success, failure, or cancellation.
  • Prevents duplicate PDF generations while one export is active.
  • Improves export responsiveness by skipping unnecessary Mermaid/MathJax work, yielding between page rendering, gating verbose logs, and using an adaptive html2canvas scale for large documents.

Root Cause

The previous PDF export flow updated the button and overlay inline, then duplicated cleanup across success and error paths. The error path looked for an overlay style string that did not match the created overlay, so state could remain stuck. Long-running generation also had no user-visible progress beyond a static message and no cancellation path before saving.

User Impact

Users now see meaningful PDF generation progress, can cancel an export, and can run multiple PDF exports in one session without refreshing the page. Cancelled exports clean up immediately and do not intentionally save a partial PDF.

Validation

  • node --check script.js
  • git diff --check
  • Local browser smoke test: progress modal appeared at 55%, Cancel closed it, removed temporary PDF DOM, and restored the PDF export button.
  • Repeated PDF generation after cancellation reset cleanly.

@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 4, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
markdown-viwer Ready Ready Preview, Comment Jun 4, 2026 9:35pm

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Jun 4, 2026

Deploying markdown-viewer with  Cloudflare Pages  Cloudflare Pages

Latest commit: c55f68e
Status: ✅  Deploy successful!
Preview URL: https://f6a1f8cb.markdown-viewer.pages.dev
Branch Preview URL: https://codex-improve-pdf-generation.markdown-viewer.pages.dev

View logs

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Jun 4, 2026

Deploying markdownviewer with  Cloudflare Pages  Cloudflare Pages

Latest commit: c55f68e
Status: ✅  Deploy successful!
Preview URL: https://79605262.markdownviewer.pages.dev
Branch Preview URL: https://codex-improve-pdf-generation.markdownviewer.pages.dev

View logs

@ThisIs-Developer ThisIs-Developer marked this pull request as ready for review June 4, 2026 21:25
@ThisIs-Developer ThisIs-Developer merged commit a6d062d into main Jun 5, 2026
6 checks passed
@ThisIs-Developer ThisIs-Developer deleted the codex/improve-pdf-generation-ux branch June 5, 2026 04:37
@ThisIs-Developer ThisIs-Developer restored the codex/improve-pdf-generation-ux branch June 5, 2026 17:00
@ThisIs-Developer ThisIs-Developer deleted the codex/improve-pdf-generation-ux branch June 5, 2026 18:11
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