You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
4.9 KiB
4.9 KiB
Plan
Status: ready_for_implement
Goal: implement ROADMAP.md Priority 4 — make the page addable to an Android home screen as "Home Lanundry" with a cartoon washing-machine icon. T-001..T-005 are done and unchanged in behavior.
Scope
- New static assets (manifest and icons), embedded routes, three
<head>tags, tests, README. - Out of scope: service worker, offline mode, TLS, install prompt UI, any change to status rule, JSON contract, SSE, page layout or the
<title>. - Transport stays plain HTTP, so Chrome offers "Add to Home screen" (shortcut), not "Install app". This is accepted; document it.
T-006 — Home screen icon and web manifest
Design decisions
- Assets live in
internal/web/static/and are embedded withgo:embed(anembed.FSover a fixed file list, or individual[]bytevars). No new dependencies. - Routes (all
GET, exact paths, registered on the existing mux):/manifest.webmanifest—Content-Type: application/manifest+json/icons/icon.svg—image/svg+xml/icons/icon-192.png,/icons/icon-512.png,/icons/icon-maskable-512.png—image/png/apple-touch-icon.png(180x180) —image/png
- Static assets use
Cache-Control: no-cache(revalidate); the existingno-storeon page/API stays. - Manifest content:
nameandshort_name"Home Lanundry",start_url/,scope/,displaystandalone,theme_colorandbackground_color#ffffff,icons= 192 and 512 (purpose: any) plus maskable 512 (purpose: maskable). - Icon art: flat cartoon front-loading washing machine — light-blue rounded-square background, white/pastel body, round porthole with blue water and a few bubbles, two or three control knobs and a small display on top. For the maskable variant, extend the background full-bleed and keep all artwork inside the central 80% safe zone.
Files to change (tests first)
internal/web/handler_test.go(write first, confirm failing):- Table test for each new route: 200, expected
Content-Type, non-empty body; PNG routes start with the PNG signature;POSTreturns 405. - Manifest test: decode JSON; assert
name/short_name== "Home Lanundry",display== "standalone",start_url== "/", and that everyicons[].srcresolves to a route that returns 200 and has the declaredsizes(decode PNG config) andtype; one icon haspurpose"maskable". - Extend
TestPageAndRoutingexpected substrings withrel="manifest",name="theme-color",rel="apple-touch-icon".
- Table test for each new route: 200, expected
internal/web/static/icon.svg(new): source art, 512x512 viewBox.internal/web/static/icon-192.png,icon-512.png,icon-maskable-512.png,apple-touch-icon.png(new): rendered from the SVG (full-bleed variant for maskable). Suggested tools: headlessgoogle-chrome --screenshotor Pillow; keep the generation script out of the repo, or add it asinternal/web/static/README-freescripts/only if small — implementer's choice, but the committed SVG must be the source of truth and PNGs must visually match it. Visually check the result (view the PNGs, including a circle-crop check of the maskable one).internal/web/static/manifest.webmanifest(new): content as above.internal/web/handler.go: embed the new assets, register the routes with correct content types and cache header, update the package/handler doc comment to mention the manifest and icons.internal/web/static/index.html: add to<head>:<link rel="manifest" href="/manifest.webmanifest">,<meta name="theme-color" content="#ffffff">,<link rel="apple-touch-icon" href="/apple-touch-icon.png">,<link rel="icon" href="/icons/icon.svg" type="image/svg+xml">. Do not change title, layout or script.Dockerfile: no change expected (it already copiesinternal); verify the build still embeds the new files (.dockerignoremust not exclude*.png/*.svg/*.webmanifest— check and fix if it does).README.md: new "Add to Android home screen" subsection (before "Limitations"): open the page in Chrome on Android, menu → "Add to Home screen"/"Install app" if offered, name "Home Lanundry". State the plain-HTTP limitation: without HTTPS Chrome only offers a home-screen shortcut with the icon, not a full install, and there is no offline mode. Add the new routes (/manifest.webmanifest,/icons/*,/apple-touch-icon.png) to the endpoint documentation. Do not touch the AI Workflow section.ROADMAP.md: already updated by the planner; no further edit.
Validation
go fmt ./...,go vet ./...,go test ./...(plus-raceon./internal/web).- Smoke: run the service,
curl -sIeach new route for status and content type; open the page in Chrome DevTools (Application → Manifest) at a 360px viewport and confirm no manifest or icon errors and a correct icon preview. - Docker build if available (confirm assets are embedded).
Commit message
feat(web): add Home Lanundry home-screen icon and web manifest