Skip to content

Refine PWA launches on iOS#3742

Open
fellyph wants to merge 13 commits into
trunkfrom
improving-pwa-website
Open

Refine PWA launches on iOS#3742
fellyph wants to merge 13 commits into
trunkfrom
improving-pwa-website

Conversation

@fellyph

@fellyph fellyph commented Jun 2, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Improves the PWA installation flow for WordPress Playground and My WordPress, especially on iOS/macOS.
  • Adds iOS install metadata, Apple touch icons, and maskable manifest icons for both apps.
  • Keeps manifest identity stable so standalone launches reuse the installed manifest URL.
  • Keeps the PR scope focused on PWA installation by removing the manifest shortcut changes.
  • Makes local/tunneled dev URLs under /website-server/ use the static dev manifest and relative icon assets, so mobile PWA testing works through HTTPS tunnels.
  • Adds focused tests for manifest content and install metadata.

Testing

  • npm exec nx test playground-website --testFile=pwa-manifest.spec.ts
  • npm exec nx test playground-personal-wp --testFile=pwa-manifest.spec.ts
  • git diff --check
  • Verified local and tunneled manifests resolve correctly and do not include shortcuts.

Mobile PWA testing with HTTPS tunnels

Use iOS Safari for installation testing. If an older version of the app is already installed, remove it from the Home Screen first so iOS refreshes the icon and manifest metadata.

WordPress Playground

Start the Playground dev server:

npm run dev

Expose it with Cloudflare Tunnel:

cloudflared tunnel --url http://127.0.0.1:5400 --http-host-header 127.0.0.1:5400

Or expose it with ngrok:

ngrok http 5400 --host-header=127.0.0.1:5400

Open this URL on iOS Safari:

https://<tunnel-host>/website-server/

Then tap Share -> Add to Home Screen.

My WordPress

If the shared Playground dev server is already running, start only the Personal WP standalone app:

npm exec nx dev:standalone playground-personal-wp --configuration=development --output-style=stream-without-prefixes

If the shared dev server is not running, start the full Personal WP dev target instead:

npm exec nx dev playground-personal-wp

Expose Personal WP with Cloudflare Tunnel:

cloudflared tunnel --url http://127.0.0.1:5401 --http-host-header 127.0.0.1:5401

Or expose it with ngrok:

ngrok http 5401 --host-header=127.0.0.1:5401

Open this URL on iOS Safari:

https://<tunnel-host>/website-server/

Then tap Share -> Add to Home Screen.

Keep both the dev server and tunnel process running while testing.

before:
IMG_2390

Copilot AI 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.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR refines PWA launch/shortcut behavior for the Playground website and Personal WP apps, adds iOS install metadata + maskable icons, and introduces tests to lock down manifest/install metadata expectations.

Changes:

  • Expanded static and dynamic manifests with stable id, screenshots, categories, shortcuts (website only), and maskable icons.
  • Updated HTML install metadata (Apple touch icons + iOS standalone meta) and tightened manifest URL persistence for standalone launches.
  • Added focused unit tests covering manifest content, iOS install metadata, and dynamic manifest identity stability.

Reviewed changes

Copilot reviewed 8 out of 12 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/playground/website/src/lib/pwa-manifest.spec.ts Adds tests for website manifest fields, iOS metadata, and dynamic-manifest identity behavior.
packages/playground/website/public/manifest.json Enriches website manifest (id, screenshots, shortcuts, categories, maskable icons).
packages/playground/website/public/dynamic-manifest.json.php Adds stable manifest id, richer install metadata, and shortcut URL generation.
packages/playground/website/index.html Adds iOS install meta and reworks manifest URL selection/persistence.
packages/playground/personal-wp/src/lib/pwa-manifest.spec.ts Adds tests for personal-wp manifest fields, iOS metadata, and dynamic manifest identity behavior.
packages/playground/personal-wp/public/manifest.json Updates personal-wp manifest start/id to /my-apps/, adds screenshots/categories/maskable icons, removes shortcuts.
packages/playground/personal-wp/public/dynamic-manifest.json.php Adds stable manifest id and richer install metadata; adjusts start URL default to /my-apps/.
packages/playground/personal-wp/index.html Adds iOS install meta and reworks manifest URL selection/persistence.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/playground/personal-wp/public/dynamic-manifest.json.php Outdated
Comment thread packages/playground/website/public/dynamic-manifest.json.php
Comment thread packages/playground/website/src/lib/pwa-manifest.spec.ts Outdated
@fellyph fellyph requested a review from akirk June 2, 2026 17:33
@akirk

akirk commented Jun 18, 2026

Copy link
Copy Markdown
Member

@fellyph It seems like an "after" screenshot is missing

@fellyph

fellyph commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator Author

This is Playground on iOS:
IMG_2597

and my WordPress:
IMG_2599

IMG_2600

@fellyph fellyph changed the title Refine PWA launches and internal shortcuts Refine PWA launches on iOS Jun 18, 2026
Comment thread packages/playground/website/public/dynamic-manifest.json.php Outdated
Comment thread packages/playground/website/index.html Outdated
const runningOnDevServer =
window.location.port === '5400' ||
window.location.pathname.startsWith('/website-server/');

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's export an isDevServer function from the remote package and reuse it here. There are a few more dev servers we should support https://github.com/bgrgicak/wordpress-playground/blob/77a9939a22962b51d55bb08f3681d231a4db1c3a/packages/playground/remote/src/lib/offline-mode-cache.ts#L173-L187

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, Bero. I have moved to a separate module

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants