Skip to content

Certificate: Fix preview popup blocked on Safari and mobile#1923

Merged
rappm merged 1 commit into
mainfrom
fix/1291-cert-preview-popup
Jul 18, 2026
Merged

Certificate: Fix preview popup blocked on Safari and mobile#1923
rappm merged 1 commit into
mainfrom
fix/1291-cert-preview-popup

Conversation

@rappm

@rappm rappm commented Jul 15, 2026

Copy link
Copy Markdown
Member

📝 Pull Request Template

Use this template to provide all necessary information for reviewing and testing your changes.

✨ What is the change?

The certificate template preview now opens reliably in Safari and on mobile. handlePreview in SettingsPage.tsx opened the preview tab with window.open(url, '_blank') only after awaiting the preview compilation, so the call was no longer inside the click gesture and Safari/mobile popup blockers silently swallowed it. The tab is now opened synchronously within the click handler and pointed at the generated blob once it is ready, with an anchor-based fallback if the browser still returns no window.

📌 Reason for the change / Link to issue

Closes #1291. On Safari and mobile browsers the "Preview" button did nothing because the popup was blocked. Browsers only allow window.open when it runs synchronously in a user-initiated event handler; after an await that context is lost.

🧪 How to Test

  1. Open a Certificate phase's Settings page in Safari (desktop or iOS) or a mobile browser.
  2. Edit or load a template and click Preview.
  3. The compiled certificate opens in a new tab instead of being blocked.
  4. Trigger a compile error (invalid template) and confirm the pre-opened tab is closed and the error is shown inline.

🖼️ Screenshots (if UI changes are included)

✅ PR Checklist

  • Tested locally or on the dev environment
  • Code is clean, readable, and documented
  • Tests added or updated (if needed)
  • Screenshots attached for UI changes (if any)
  • Documentation updated (if relevant)

@rappm
rappm requested a review from a team July 15, 2026 14:29
@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@rappm, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 40 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 3e234ebc-0082-4ef7-ae8e-3e5320f9221e

📥 Commits

Reviewing files that changed from the base of the PR and between a4c7721 and 0384127.

📒 Files selected for processing (1)
  • clients/certificate_component/src/certificate/pages/SettingsPage.tsx
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/1291-cert-preview-popup

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@rappm rappm added the schau mi o Translation: Ready to review label Jul 16, 2026
@rappm
rappm merged commit 4023483 into main Jul 18, 2026
81 of 82 checks passed
@rappm
rappm deleted the fix/1291-cert-preview-popup branch July 18, 2026 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

schau mi o Translation: Ready to review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Certificate of Completion preview certificate does not work in Safari / Mobile

1 participant