feat(daemon): add a PI monogram dashboard favicon - #9
Merged
Conversation
The browser tab showed the generic placeholder, so the dashboard was unidentifiable among open tabs. Ship a "PI" monogram in JetBrains Mono Bold on the page's own dark tile, glyphs in the dashboard accent blue so the icon matches the product it belongs to. The mark rides inline as a base64 data URI rather than a second embedded asset: the dashboard is one self-contained file whose version always equals the binary, and a separate asset would need its own embed, route and cache policy for no user-visible gain. The serving path is unchanged. The accompanying test asserts the served page carries exactly one icon link whose payload fully decodes as a 32x32 PNG, by marker rather than by byte-exact blob, so the mark can be regenerated without breaking it. Refs: #8 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Closes #8
Gives the dashboard a
PImonogram favicon so the tab identifies the page insteadof showing the browser's generic placeholder.
What changed
Two files, 50 added lines, one of them the mark itself:
gateway/httpapi/web/index.html— a single<link rel="icon" type="image/png" sizes="32x32" href="data:image/png;base64,…">after<meta name="theme-color">,on its own line so the blob stays contained in diffs.
gateway/httpapi/ui_test.go— a regression subtest underTestHandleDashboard.gateway/httpapi/ui.gois untouched: no newgo:embed, no new file underweb/,no
/favicon.icoroute. The dashboard stays one self-contained asset whose versionalways equals the binary.
The mark
512x512 master downscaled to 32x32 with Catmull-Rom (never rasterised directly at
32): rounded tile at 19% corner radius filled
--bg:#0b0e14,PIin JetBrains MonoBold in the dashboard's own accent
--accent:#6f9dff— Open Question 1, resolved bythe owner in favour of the issue's default. Glyphs fitted by measured ink bounds
rather than advance widths, since a monospace cell's side bearings would otherwise
make the mark read small; ink height 48% of the tile, width landing at ~68%, so the
"PI is wider than CV" crowding pitfall never bit and no tracking tweak was needed.
1083-byte PNG, 1444 base64 chars — 1.4 KB on a 35.9 KB page, inside the issue's
~2 KB budget and one fewer round trip than a separate favicon file.
Per the issue's default, no 16x16 variant: browsers downscale the 32 acceptably for
a two-glyph mark.
The generator is a throwaway Go program (
golang.org/x/image/font/opentype) kept outof the repo, as the issue requires — the committed artifact is the data URI alone.
It replaces the breakdown's assumed Python/PIL step only because neither
PILnorpipexists on the workstation; same technique, same output contract. No font fileis added to this repo.
Verification
make testandmake lintgreen; native andarm64builds green.link removed, payload truncated,
hrefswapped to an external file, duplicate iconlink. The first cut used
png.DecodeConfig, which waved the truncated payloadthrough (a truncated blob still carries an intact IHDR); it now decodes in full.
yarddogd, fetched/, and theicon extracted from the served bytes decodes to a 32x32 PNG that is SHA-256
identical to the generated master.
Left to the reviewer
Task 4's real-browser check. This host is headless and a tab-bar favicon is not
something a headless screenshot can capture, so everything mechanically checkable is
checked and the "does it look right in a tab" pass is yours. Mind the trap the issue
flags: check in a new tab or a private window — browsers cache favicons hard and a
plain reload will keep showing the old placeholder.