Skip to content

App icons: one icon per app, served as favicon, apple-touch-icon and web-app manifest - #54

Merged
thorwhalen merged 2 commits into
mainfrom
feat/app-icon-set
Sep 24, 2026
Merged

thorwhalen merged 2 commits into
mainfrom
feat/app-icon-set

Conversation

@thorwhalen

@thorwhalen thorwhalen commented Sep 24, 2026 •

Copy link
Copy Markdown
Member

Why

An app's icon appears in four places: the launcher tile, the browser tab, the iOS home screen (apple-touch-icon, PNG only) and the Android home screen (web-app manifest icons). enlace only handled the first, so on thorwhalen.com most apps had no favicon, only one had a manifest, and several tabs showed a different icon from their tile.

What

  • enlace.app_icons picks one icon per app (overlay > [app_meta.apps.<name>].icon > <name>.png in the new [app_meta].icons_dir > the app's own > monogram), and serves:
    • /_apps/{name}/icon-{32,180,192,512}.png: square PNGs cut from a raster source (Pillow, new enlace[icons] extra)
    • /_apps/{name}/manifest.webmanifest: generated, scoped to /{name}/, display from [app_meta].manifest_display (default browser)
    • both behind the same access check as /_apps/{name}/icon
  • AppIconLinksMiddleware adds the missing <link rel=icon|apple-touch-icon|manifest> and apple-mobile-web-app-title to each app's HTML. An icon from the platform tiers replaces the page's own icon links; an app's own icon only fills the gaps. Protected apps get crossorigin="use-credentials" on the manifest link.
  • enlace check warns about apps with no PNG form (no home-screen icon).
  • Harvest fixes: ?v=-stamped and mount-absolute (/{app}/favicon.svg) icon hrefs now resolve, and the largest declared icon wins over the first one listed.
  • enlace.html_rewrite now holds the buffered <head>-rewrite dance, shared by the deploy meta tags and the icon links (previously inline in manifest.py).

17 new tests (test_app_icons.py). The existing suites pass unchanged.

https://claude.ai/code/session_0162LVDYMJLDjsoq1ix991tj

…web-app manifest

- enlace.app_icons: pick one icon per app across tiers (overlay > app_meta >
  [app_meta].icons_dir/<name>.png > app's own > monogram), serve square PNG
  renditions (/_apps/{name}/icon-{32,180,192,512}.png, Pillow) and a generated
  /_apps/{name}/manifest.webmanifest, and add the missing <link> tags to each
  app's HTML (platform-owned icons replace the page's own).
- enlace check warns about apps with no PNG form (no home-screen icon).
- Harvest: resolve mount-absolute (/{app}/favicon.svg) and ?v=-stamped icon
  hrefs, and take the largest declared icon rather than the first.
- html_rewrite: the buffered <head> rewrite shared by the deploy meta tags and
  the icon links (was inline in manifest.py).
@thorwhalen
thorwhalen merged commit 7c047ff into main Sep 24, 2026
12 checks passed
@thorwhalen
thorwhalen deleted the feat/app-icon-set branch September 24, 2026 11:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant