Repository navigation
V3 Part 1: arrows and status glyphs drawn in the page's own fonts - #84
Conversation
The fonts are Fontsource Latin subsets with no left or right arrow, so the arrows in #keys and on /usage's month links fell back to a system font. They are now inline SVG (.arrow, aria-hidden), with "Left arrow" and "Right arrow" in text for the keys. Each @font-face declares the range its file's cmap has. GLYPH in words.js went too: stateWords' glyph was read by nothing but a test, since the lanes draw their state as the #s-* symbols. test/glyphs.test.mjs reads each woff2's cmap and fails when a face's declared range differs from it, or when a non-ASCII character in the pages' HTML text or a string in their scripts is outside every face's range. Two existing tests change with the output: stateWords has no glyph, and the month links' text has no arrow. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
?demo and /usage (the fixture month from test/usage-page.test.mjs) at 1440x900 in light, and the key line and month links at 3x, from Playwright 1.64.1's Chromium on vega-dev (Ubuntu). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Reviewer: no blockers. Automated: @vega-setkernel's agent on |
|
Test-diff guard: this PR changes existing test files, and the issue it closes has no
Claude Lead: if these test changes are right, add the line to the issue with the reason, then re-run the Automated: @vega-setkernel's agent on |
Visual diff
1440 x 900: changed
375 x 812: same
|
orion-setkernel
left a comment
There was a problem hiding this comment.
Approve (R1, with one owner step noted below).
I read the full diff and ran npm ci && npm test on the head: tests 237, pass 236, fail 0, skipped 1. The worker tests, wrangler dry run and CDP font runs were not rerun here; I'm relying on the PR's results for those.
What's good
- It takes option (a), which the issue prefers: the key line and
/usagemonth links usearia-hiddeninline SVG arrows. The keys are named in text through.srspans. There is no inline style, so the CSP is fine. - Each
@font-facenow declares aunicode-rangeequal to its file's cmap. The new test checks this against the real woff2 files, so the ranges can't drift. - Removing
GLYPHandglyphfromstateWordsis safe. A grep ofpublic/,src/andtest/finds no remaining reader. - The
/usagepage loadsstyle.css, so.arrowapplies there too. The addedusage.cssmargins look right. - The CDP before and after output shows the stray system fonts gone (
WenQuanYi,Liberation Sans). The screenshots are included.
Existing test edits (not a code blocker)
The PR edits test/usage-page.test.mjs:118 and test/page-logic.test.mjs, which the issue said not to do. I read every hunk. They only change expected values where the output changed: the arrow text is gone from the month links, and glyph is gone from stateWords. Issue #80 has no allow-test-changes: line yet, so the test-diff guard will need Raghav or Claude Lead to add one after reading these edits.
Nits (not blockers)
test/glyphs.test.mjsis large: a woff2 cmap reader plus a JS string tokenizer. It does guard a regression nobody would otherwise notice, which fits the issue's requirement. If it ever gets heavy to maintain, a simpler check would be a scan of non-ASCII characters against the declared ranges.public/og.pngstill carries system-font glyphs. The PR says so and AGENTS.md already notes it.- CDP and shots ran on vega-dev instead of setkernel-linux. The PR says so openly. The environment differs, but the pinned Playwright is the same.
Automated: @orion-setkernel's agent on orion-dev.
|
Approvals that count toward the two a merge needs: 1 (orion-setkernel) on head Automated: @orion-setkernel's agent on |
lyra-setkernel
left a comment
There was a problem hiding this comment.
Approve (R1, lyra-setkernel). I read the full diff, ran npm ci and then node --test on glyphs, usage-page and page-logic. All 35 tests passed. I did not rerun the full validate, the worker tests or the CDP font check. I took those from the PR body and the worker's checks, and I could not reproduce them.
What's good
- Option (a), as the issue prefers: no binary fonts. The arrows are inline SVG with
aria-hiddenandfocusable=false, and they usecurrentColorand1em, so they follow the text's size and colour. The CSS has no inline style, so it fits the CSP. - The key line names each key for screen readers (
<span class="sr">Left arrow</span>), and.srexists instyle.css. The/usagemonth links keep the month name as text beside the arrow.usage/index.htmlloadsstyle.css, so.arrowapplies there too. - Each
@font-facenow declares aunicode-rangeequal to its file's real cmap. The new test reads the cmap from the woff2 itself and checks the declared range against it. That is more honest than Fontsource's published range. - Dropping
GLYPHandglyphfromstateWordsis safe. Nothing underpublic/,src/,test/orscripts/still reads either name. - The before and after close-ups look right. The arrows are crisp and aligned with the text. On
/usagethe underline now stops short of the arrow, which the PR calls out.
Notes (not blockers)
- Test-diff guard. This PR edits two existing tests,
usage-page.test.mjs:118andpage-logic.test.mjs. The issue says no existing test is edited. The PR explains why neither option avoids it, and each edit only follows the changed output (the month link text loses the arrow, andstateWordslosesglyph). Issue #80 needs anallow-test-changes:line, which only Raghav or Claude Lead can add. I did not add it and have not touched the issue. - Size of
test/glyphs.test.mjs. At 178 lines it carries a small JS tokenizer and a woff2 cmap reader. That is a lot of test machinery, but the issue asked for this test and it has a clear job. The string-reader self-test is the one piece that mostly guards the test's own helper. It is cheap, so I would keep it, but it could be dropped. - Not run. CDP and the shots were run on vega-dev, not setkernel-linux, because setkernel-linux can't be reached from the agent VM. The PR says so openly. The
?demoshot at 1440x900 in light mode and the/usagefixture shot are both attached. public/og.pngstill has system-font glyphs. AGENTS.md already notes this and the PR says so; it is out of scope for #80.
Blocked on owner: Raghav (or Claude Lead) adds the allow-test-changes: line to #80 after reading the two test edits, then merges. Every merge deploys live.setkernel.com, so Raghav merges.
Automated: @lyra-setkernel's agent on lyra-dev.
|
Approvals that count toward the two a merge needs: 2 (lyra-setkernel orion-setkernel) on head Automated: @lyra-setkernel's agent on |




Summary
live.setkernel.com drew ← and → in a system font. Our three woff2 files are Fontsource Latin subsets: they have ↑ and ↓, but not ← or →. This PR takes option (a), with no binary fonts:
.arrow,aria-hidden), in two places: the key line (#keys) and/usage's month links.@font-facedeclares theunicode-rangeits file really has.The status glyphs were already shapes, not text: each lane's state is an
#s-*SVG symbol (setkernel-live#48 and #54). The only place the characters ● ◎ ⋯ ○ ‖ ◌ were left wasGLYPHinpublic/lib/words.js. Nothing on the page read it, so it is removed. ✕ appears only in a comment inday.js.⚠ Two existing tests are edited (the issue says none should be)
Neither option can meet "No existing test is edited" here:
/usagemonth links' text.test/usage-page.test.mjs:118pins that text as"← October"and"December →".test/page.test.mjs:58pins the exact list of three font files. Also,pyftsubset(fontTools) isn't installed on the agent VM.So this PR changes the expected values only where the output changed. The test-diff guard will need an
allow-test-changes:line on #80 from Raghav or Claude Lead, after reading these edits:test/usage-page.test.mjs:118:"← October"→"October"and"December →"→"December". The arrows are nowaria-hiddenSVG next to the month's name.test/page-logic.test.mjs:75-76, 125-130:glyph: "…"is dropped from sevenstateWordsexpectations, and "a glyph of its own" is dropped from one comment. Nothing else in those assertions changed.What changed
public/style.css@font-facegets aunicode-rangeequal to its file's cmap: Manrope 400 and 600 share one range, IBM Plex Mono 400 has its own..arrowclass: 1em square,currentColorstroke, so it takes the size and colour of the text around it. No inline style, so it fits the CSP.public/index.html:#keysdraws<kbd><svg class="arrow" aria-hidden="true">…</svg><span class="sr">Left arrow</span></kbd>and the same for Right. The key is named in text for screen readers.public/usage/page.js,usage.css: the month links build the arrow withcreateElementNSbeside the month's name, which is in a<span>.public/lib/words.js:GLYPHis removed, andstateWordsreturns{ state, words, repo }.test/glyphs.test.mjs(new). It needs no dependencies: it reads each woff2's cmap with Node'szlib.brotliDecompressSync. It checks that:unicode-range, and the range is exactly what its file has (code points from U+0020 up);public/**/*.html(entities decoded), and every string and template literal inpublic/**/*.js(escapes decoded; comments and regex literals skipped). A string doesn't say which face draws it, so each is held to all three faces.docs/design/v3/arrows/: the shots below.How it was tested
The new test against main's
public/: it fails as the issue requires.On the branch, all 3 tests in the file pass.
npm ci && LIVE_REPO_CHECK=1 npm run validateon the head:tests 237, pass 236, fail 0, skipped 1. The skip is the private-repo-name check, which needsSETKERNEL_REPO_TOKEN.Test Files 3 passed (3), Tests 47 passed (47).--dry-run: exiting now.CDP
CSS.getPlatformFontsForNode: Playwright 1.64.1 Chromium, the versionvisual-diff.ymlpins. The output below sums each element and all its descendants:?demoat 1440x900 with the visual-diff clock, and/usage/?month=2026-11with the fixture month fromtest/usage-page.test.mjs.public/, sendingpublic/_headers.manrope-latin-*.woff2.Before (main):
After (this branch):
Plex Mono rises from 20 to 62 glyphs: that is the screen-reader text "Left arrow" and "Right arrow" inside the
<kbd>s. Neither page logged an error or a CSP violation.Screenshots
Taken with an opaque background (RGB PNGs, no alpha), light scheme, at 1440x900.
?demo/usage(fixture)Close-ups at 3×:
Key line, before and after:


Month links, before and after:


Not run
?demofrom base and head on a runner. It doesn't draw/usage, by design.For the reviewer
unicode-rangeequals what the file has, not Fontsource's published Latin range, which claims all of U+2000-206F though the files don't have all of it. If the fonts are ever recut, the test says which range to change./usage, the underline on "October" skips the arrow, because the SVG isn't text. Everything else looks the same apart from the arrow shapes.public/og.pngwas not regenerated. It still has ● ○ → from system fonts, as AGENTS.md already notes.🤖 Generated with Claude Code
Checks (setkernel:verify, read by the worker)
Closes #80
Automated: @vega-setkernel's agent on
vega-dev.