Allow Hotwire.io to be installable as a Progressive Web App (PWA) #313
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.
Background
Prior to this change, in macos Chrome and Edge, the PWA install prompt was not visible in the toolbar.
After this change, the app install prompt is now present.
Details
Key change
public/site.manifest
from the application layoutmanifest.json.erb
to point to actual iconsAdditional change
Since both site.manifest file and manifest.json were listed as the site manifest in the application layout, I believe browsers were ignoring manifest.json.
The manifest.json.erb file appears to be the desired choice for the site manifest as it is consistent with the style of web manifest used in Rails 7.
Removing the site.manifest file allows browsers to pick up the desired web manifest which contains the necessary properties to make this app installable as a PWA, including
name
,icons
,start_url
, anddisplay
.I‘ve also update the names of the relevant icons for the manifest to be less specific to android chrome.
Caveats
I don‘t know the history of
site.webmanifest
nor am I an Android user but I don‘t believe two manifest files are needed.