App icons: full-bleed tiles, three purposes, and an apple-touch-icon - #752
Merged
Conversation
Every platform masks the home-screen tile itself and fills any transparency first. iOS fills with white, so the pre-rounded bundled artwork installed as a mark floating on a white square. The bundled set is now full-bleed, opaque and square, and declares three purposes: any, maskable (the tile at 80%, so Android's adaptive masks crop into margin) and monochrome (Android 13+ themed icons). A Site Icon still wins and still goes out as any only, since maskable and monochrome are claims about how a specific piece of artwork is composed. Core hooks wp_site_icon() to wp_head and login_head but not admin_head, so wp-admin emitted no apple-touch-icon at all. That is why four bundled PNGs could never reach an iPhone. The shell now emits one.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What?
Installing the PWA on an iPhone gave a black circle on a white rounded square. Platforms mask the home-screen tile themselves and fill any transparency first, and iOS fills with white, so pre-rounded artwork installs with white corners showing.
any,maskable(the tile at 80%, so Android's adaptive masks crop into margin rather than into the mark),monochrome(Android 13+ themed icons).apple-touch-icon. Core hookswp_site_icon()towp_headandlogin_headbut notadmin_head, which is why four bundled PNGs never reached an iPhone.A Site Icon still wins, and still goes out as
anyonly.maskableandmonochromedescribe how a piece of artwork is composed, and we only know that about ours.No iOS startup images here: they match on an exact device media query, so the current iPhone and iPad range is 36 files and ~2 MB. Worth first checking whether iOS already draws an acceptable launch screen from the manifest's
background_color.Screenshots
The label differs because the test site is named differently, not because of this change. The app takes its name from the site, as it did before.
Testing instructions
Setup
Activate OpenStation, then check Settings → General has no Site Icon. A Site
Icon takes priority over the bundled files, so with one set you are testing the
wrong path.
In a desktop browser, no phone needed
any(128/180/192/256/512), twomaskable, twomonochrome. None should fail to load.safe area rather than being cropped.
<link rel="apple-touch-icon" sizes="180x180" href=".../assets/pwa/icon-180.png">.On
trunkthere is no such tag at all.On a phone, which is where the bug actually shows
A phone cannot reach
localhost, so point wp-env at your machine's LAN addressfirst. Create
.wp-env.override.json(gitignored):{ "config": { "WP_HOME": "http://YOUR-LAN-IP:8890", "WP_SITEURL": "http://YOUR-LAN-IP:8890" } }Run
npm run env:startagain. Skip this and the manifest hands the phonelocalhostURLs and the install quietly fails.http://YOUR-LAN-IP:8890/wp-admin/on the phone.only render on a shell request.
Delete any previous tile before re-adding. iOS caches home-screen icons hard
and will keep showing you the old one.
Then the Site Icon path
Set a Site Icon under Settings → General and reload. The manifest should switch
to the Site Icon URLs, all
purpose: anywith no maskable or monochrome, andthe
apple-touch-iconshould follow it.