Skip to content

fix: prevent PWA install dialog from auto-showing on page load#141

Merged
Hugo0 merged 1 commit intomainfrom
fix/pwa-install-dialog-timing
Mar 14, 2026
Merged

fix: prevent PWA install dialog from auto-showing on page load#141
Hugo0 merged 1 commit intomainfrom
fix/pwa-install-dialog-timing

Conversation

@Hugo0
Copy link
Owner

@Hugo0 Hugo0 commented Mar 14, 2026

Summary

  • The @khmyznikov/pwa-install web component has built-in auto-display behavior that shows an install dialog on page load — independent of our custom banner
  • On iOS: triggers via _triggerAppleDialog() 500ms after load
  • On Android: triggers when beforeinstallprompt fires
  • This is distracting when the user is mid-game and hasn't finished yet
  • Adds manual-apple and manual-chrome attributes to suppress auto-display
  • Our custom banner (shown 2s after game win) still calls showDialog() explicitly, so the install flow is unchanged

Test plan

  • Open game on iOS Safari — install dialog should NOT auto-appear on load
  • Open game on Android Chrome — install dialog should NOT auto-appear on load
  • Win a game — custom banner should appear after 2s, tapping "Install" should open the pwa-install dialog
  • Verify PWA install still works end-to-end on both platforms

Summary by CodeRabbit

  • New Features
    • PWA install component now supports configurable manual installation instructions for Apple and Chrome platforms, providing enhanced control over platform-specific installation guidance.

The @khmyznikov/pwa-install component auto-triggers its own install
dialog on page load (via _triggerAppleDialog on iOS, beforeinstallprompt
on Android). This is distracting when the user hasn't finished their
game yet.

Add manual-apple and manual-chrome attributes to suppress auto-display.
The dialog is still shown explicitly via showDialog() in our
pwa.install() function, which is triggered by the custom banner that
only appears after game completion.
@coderabbitai
Copy link

coderabbitai bot commented Mar 14, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 7fb4f4da-88b1-4cd2-8c72-8177d3a9b7ca

📥 Commits

Reviewing files that changed from the base of the PR and between 68a2b79 and c8db54d.

📒 Files selected for processing (1)
  • webapp/templates/partials/_pwa_install.html

📝 Walkthrough

Walkthrough

Two boolean-like attributes (manual-apple and manual-chrome) were added to the <pwa-install> component in the PWA install template to enable explicit manual installation instructions for Apple and Chrome platforms.

Changes

Cohort / File(s) Summary
PWA Install Template
webapp/templates/partials/_pwa_install.html
Added manual-apple and manual-chrome boolean attributes to the <pwa-install> element to enable platform-specific manual installation instructions.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 Two gentle flags now grace the PWA,
Apple and Chrome, bundled in hay,
Manual installs, oh what a delight,
Platform-specific paths shining bright,
Small changes bloom in templates light! 🌿

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/pwa-install-dialog-timing
📝 Coding Plan
  • Generate coding plan for human review comments

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 and usage tips.

@Hugo0 Hugo0 merged commit b689e59 into main Mar 14, 2026
4 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