Conversation
A manifest, two PNG icons rendered from the existing favicon, and the head links (manifest, theme-color, apple-touch-icon) let browsers install the web UI as an app: fullscreen from a home-screen icon on a phone at the booth, its own window and dock icon on desktop. The standalone display mode drops all browser chrome, and the theme colors keep the launch splash on the UI's dark palette. No service worker on purpose: the UI is meaningless without the live server, so offline caching would only mislead. Some browsers gate their automatic install prompt on one; manual add-to-home-screen and Chromium's install menu work without it, and that trade is documented in web.go. Verified against a live server: /manifest.json serves with the manifest content type and parses in Chromium, both icons serve as correctly-sized PNGs, and the head carries the manifest link and theme-color.
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 & why
A manifest, two PNG icons rendered from the existing favicon, and three head links (manifest, theme-color, apple-touch-icon) let browsers install the web UI as an app: fullscreen from a home-screen icon on a phone at the booth, its own window and dock icon on desktop. The standalone display mode drops all browser chrome, and the theme colors keep the launch splash on the UI's dark palette instead of flashing white. Everything is embedded in the binary like the rest of the web assets, so the UI stays CDN-free on the offline link-local network.
Two deliberate omissions, both documented in web.go. No service worker: the UI is meaningless without the live server, so offline caching would only mislead — an installed app that opens to a stale library with nothing working is worse than a connection error. Some browsers gate their automatic install banner on a service worker; manual add-to-home-screen and Chromium's install menu work without one, and that trade is the right one for this app. And no maskable icon claim: the icon has no safe-zone padding, and claiming maskable without it gets the artwork clipped by launcher masks — plain icons render correctly everywhere. The apple-touch-icon link covers iOS, which ignores manifests for home-screen icons.
Verified against a live server: /manifest.json serves with the manifest content type and parses in Chromium the way a browser consumes it, both icons serve as correctly-sized PNGs, and the head carries the manifest link and theme-color. The install ceremony itself can't be exercised headless — worth one add-to-home-screen on a phone against a running instance to see it launch fullscreen.
Hardware testing
Checklist
go build ./...,go vet ./..., andgo test ./...passgofmt -l .is cleanGPL-3.0-or-later) (n/a — new files are JSON/PNG assets)