Skip to content

fix(gallery): use the WebJs brand favicon, not the demo placeholder - #1377

Merged
vivek7405 merged 1 commit into
mainfrom
fix/gallery-brand-favicon
Aug 10, 2026
Merged

fix(gallery): use the WebJs brand favicon, not the demo placeholder#1377
vivek7405 merged 1 commit into
mainfrom
fix/gallery-brand-favicon

Conversation

@vivek7405

Copy link
Copy Markdown
Collaborator

Follow-up to #1375, which fixed the blank tab with the wrong mark.

gallery/app/icon.ts is the metadata-route demo: it generates a placeholder grey "w" inline. #1375 linked it, so gallery.webjs.dev got a favicon that looks nothing like webjs.dev, and the gallery read as a separate product in a tab strip.

What changes

The gallery now ships the website's committed brand assets in gallery/public/ (byte-identical: favicon.svg, favicon-192.png, apple-touch-icon.png, favicon.ico) and declares them through metadata.icons in the same shape and order the website uses. The rendered head now matches webjs.dev exactly:

<link rel="icon" href="/public/favicon-192.png" sizes="192x192" type="image/png">
<link rel="icon" href="/public/favicon.svg" sizes="any" type="image/svg+xml">
<link rel="apple-touch-icon" href="/public/apple-touch-icon.png" sizes="180x180">

Raster first, because Google's favicon crawler takes the first usable icon and wants a square raster whose side is a multiple of 48px. favicon.ico ships unlinked: the framework serves it at the origin root for crawlers that read no markup, and it 404'd before.

app/icon.ts stays. It is a deliberate demo of the metadata-route surface, copied into generated apps by copyGallery() and pruned by gallery:clear alongside apple-icon.ts / manifest.ts / opengraph-image.ts, and test/scaffolds/scaffold-gallery.test.js:86 asserts scaffolded apps ship it. Its header comment now says the gallery's own mark is the static one in public/, so the route is not mistaken for live wiring.

Two things #1375 got wrong beyond the mark

gallery/test/** is scaffold payload. copyGallery() copies it into every generated app, so #1375's gallery/test/seo/ shipped to users, and a stray directory there left gallery:clear unable to prune an empty test/. test/scaffolds/scaffold-gallery.test.js has been red on main since #1375 (it was merged without waiting for CI, at my request). The test moves to test/repo-health/gallery-favicon.test.mjs, which is also where it belongs on the merits: it reads website/public/, which exists only in this repo.

Tests

test/repo-health/gallery-favicon.test.mjs, five assertions, sitting beside site-seo-tags.test.mjs which covers the website's own icons:

  1. the head declares at least one <link rel="icon">
  2. every icon href in the head resolves 200 with an image/* type
  3. /favicon.ico answers at the origin root
  4. the served bytes are byte-identical to website/public/, the assertion that catches a placeholder, since 1 and 2 passed on fix(gallery): link the favicon the app already serves #1375's wrong mark
  5. the raster icon is declared ahead of the SVG

Green locally, along with test/scaffolds/scaffold-gallery.test.js (now fixed), test/repo-health/site-seo-tags.test.mjs, the gallery's own suite, webjs check and webjs typecheck.

#1375 fixed the blank tab by linking /icon, but that route is the
metadata-route DEMO: it generates a placeholder grey "w", so the gallery
rendered as a different product beside webjs.dev in a tab strip.

Ship the website's committed brand assets in gallery/public/ and declare
them through metadata.icons in the same shape and order the website uses,
raster ahead of SVG for Google's favicon crawler. favicon.ico rides along
unlinked; the framework serves it at the origin root for crawlers that
read no markup, and it 404'd before.

app/icon.ts stays as the dynamic-favicon demo, which is what it always
was: the scaffold copies it into generated apps and gallery:clear prunes
it with the other metadata routes. Its comment now says the gallery's own
mark is the static one, so the route is not mistaken for live wiring.

Move the test to the repo suite. It reads website/public/, which exists
only here, and gallery/test/** is scaffold payload that copyGallery()
copies into every generated app, where a stray directory also left
gallery:clear unable to prune an empty test/ (red on main since #1375).
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