Skip to content

bug when downloading invoice schedule pdf - #1272

Open
jordividaller wants to merge 1 commit into
mainfrom
fix/invoice-preview-download
Open

bug when downloading invoice schedule pdf #1272
jordividaller wants to merge 1 commit into
mainfrom
fix/invoice-preview-download

Conversation

@jordividaller

@jordividaller jordividaller commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

Fix bug when downloading invoice schedule pdf.


Note

Low Risk
Example-app-only UX fix for PDF preview; no auth, API, or production flow changes.

Overview
Fixes invoice schedule PDF preview in the contractor onboarding example so the file is downloaded with the correct filename instead of opening preview.content in a new browser tab.

Adds a small downloadInvoicePreview helper that builds a temporary <a> with href set to the preview data URI and download set to preview.name, then triggers a click. Preview invoice on the create-invoice-schedule step now calls this helper on success and imports the ContractorInvoicePreview type from @remoteoss/remote-flows.

Reviewed by Cursor Bugbot for commit 0d24ec7. Bugbot is set up for automated code reviews on this repo. Configure here.

… a tab

`window.open()` on the preview's `data:application/pdf;base64,...` content
landed on about:blank: browsers block top-level navigation to `data:` URLs.
Trigger a download through an `<a download>` instead, the same way
PDFPreviewDefault already offers the contract document.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

📊 Coverage Report

⚪ Coverage unchanged

Metric Current Previous Change Status
Lines 85.48% 85.48% 0%
Statements 85.04% 85.04% 0%
Functions 83.70% 83.70% 0%
Branches 76.89% 76.89% 0%

Detailed Breakdown

Lines Coverage
  • Covered: 4355 / 5095
  • Coverage: 85.48%
  • Change: 0% (0 lines)
Statements Coverage
  • Covered: 4428 / 5207
  • Coverage: 85.04%
  • Change: 0% (0 statements)
Functions Coverage
  • Covered: 1155 / 1380
  • Coverage: 83.70%
  • Change: 0% (0 functions)
Branches Coverage
  • Covered: 2699 / 3510
  • Coverage: 76.89%
  • Change: 0% (0 branches)

✅ Coverage check passed

@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Deploy preview for adp-cost-calculator ready!

Project:adp-cost-calculator
Status: ✅  Deploy successful!
Preview URL:https://adp-cost-calculator-a5uxrosda-remotecom.vercel.app
Latest Commit:0d24ec7

Deployed with vercel-action

@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Deploy preview for remote-flows ready!

Project:remote-flows
Status: ✅  Deploy successful!
Preview URL:https://remote-flows-pt5renfef-remotecom.vercel.app
Latest Commit:0d24ec7

Deployed with vercel-action

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