Skip to content

Add shared browser PDF output helpers - #74

Merged
rdlabo merged 1 commit into
mainfrom
agent/browser-pdf-output
Aug 14, 2026
Merged

Add shared browser PDF output helpers#74
rdlabo merged 1 commit into
mainfrom
agent/browser-pdf-output

Conversation

@rdlabo

@rdlabo rdlabo commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add kitDownloadPdf for browser-safe PDF downloads without navigating the current application
  • add kitPreviewGeneratedPdf to synchronously reserve a preview window before asynchronous PDF generation
  • fall back to download when popup creation, preview initialization, window state inspection, or PDF navigation is unavailable
  • centralize idempotent link and object URL cleanup with scheduler fallback
  • export the helpers from @rdlabo/ionic-angular-kit/printer

Why

foodlabel required repeated fixes around browser PDF delivery, including popup blocking, application-page navigation, premature link removal, object URL cleanup, and cleanup errors being reported as PDF generation failures. winecode and odss-mobile contain similar preview-window flows. This moves the browser lifecycle behavior into the shared kit while leaving PDF layout and application-specific UI in each consumer.

Error handling

  • rolls back partially initialized download resources
  • preserves the original PDF generation error when preview cleanup fails
  • treats temporary-window and object URL cleanup as best-effort
  • downloads instead when a preview is blocked, closed, unusable, or cannot navigate

Review

  • senior review: approved after two exception-safety remediation rounds
  • independent review: approved after the same fixes and regression coverage

Validation

  • npx ng test kit --watch=false — 45 files / 837 tests passed
  • npm run lint — passed
  • npm run prebuild:kit — passed
  • git diff --check — passed

@netlify

netlify Bot commented Aug 14, 2026

Copy link
Copy Markdown

Deploy Preview for rdlabo-ionic-angular-library ready!

Name Link
🔨 Latest commit bdc8905
🔍 Latest deploy log https://app.netlify.com/projects/rdlabo-ionic-angular-library/deploys/6a7e9f613dd14f00086bebcc
😎 Deploy Preview https://deploy-preview-74--rdlabo-ionic-angular-library.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@rdlabo
rdlabo marked this pull request as ready for review August 14, 2026 05:04

@devin-ai-integration devin-ai-integration Bot 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.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 1 additional finding.

Open in Devin Review

@rdlabo
rdlabo merged commit 6c6494a into main Aug 14, 2026
12 checks passed
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