fix(gallery): link the favicon the app already serves - #1375
Merged
Conversation
app/icon.ts answered /icon with a real SVG, but a metadata ROUTE is not auto-linked: the framework emits <link rel="icon"> only from metadata.icons. The gallery's root layout declared just a title and a description, so the head named no icon, the browser fell back to /favicon.ico, and the gallery ships no such file. gallery.webjs.dev rendered with a blank tab mark. The scaffold's generated layout gets this right, so the gallery was teaching a favicon route that does not work in the one app meant to be read as reference. Cover it where each half alone stayed green: the head must declare an icon, /icon must serve an image, and every icon href in the head must resolve rather than 404.
vivek7405
added a commit
that referenced
this pull request
Aug 10, 2026
…1377) #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).
This was referenced Aug 10, 2026
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.
gallery.webjs.devrenders with a blank tab mark.gallery/app/icon.tshas been answering/iconwith a real SVG the whole time (verified live:200,image/svg+xml, 287 bytes). But a metadata route is not auto-linked. The framework emits<link rel="icon">only frommetadata.icons(packages/server/src/ssr.js:1840), andgallery/app/layout.tsdeclared onlytitleanddescription. So the head named no icon, the browser fell back to/favicon.ico, and the gallery ships no such file.GET /icon200,image/svg+xml<link rel="icon">in the served HTMLGET /favicon.ico(browser fallback)404The scaffold's generated layout declares
metadata.iconscorrectly (packages/cli/lib/create.js:1205).gallery/app/layout.tsis one of the four app-shell files excluded from the template copy, so it never picked the key up. That matters more than a missing icon: the gallery is the canonical reference for what a scaffolded app looks like, and it was demonstrating a favicon route that does not work.Tests
Each half stayed green on its own, so all three assertions ship together in
gallery/test/seo/favicon.test.ts:<link rel="icon">pointing at/icon/iconanswers200with animage/*content typeCounterfactual: with the
iconskey reverted, 1 and 3 fail and 2 still passes.webjs checkandwebjs typecheckare clean ingallery/.Out of scope
The gallery's head also carries a duplicate
<meta charset>and<title>(the layout hand-writes both and the framework splices its own frommetadata). Harmless, left alone.