Skip to content

V3 Part 1: arrows and status glyphs drawn in the page's own fonts - #84

Merged
realRaghavGupta merged 2 commits into
mainfrom
agent/80-v3-part-1-arrows-and-status-glyphs-drawn
Nov 3, 2026
Merged

realRaghavGupta merged 2 commits into
mainfrom
agent/80-v3-part-1-arrows-and-status-glyphs-drawn

Conversation

@vega-setkernel

Copy link
Copy Markdown
Contributor

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:

  • The arrows are inline SVG (.arrow, aria-hidden), in two places: the key line (#keys) and /usage's month links.
  • Each @font-face declares the unicode-range its file really has.
  • A new test fails if the pages ever draw a character outside those ranges.

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 was GLYPH in public/lib/words.js. Nothing on the page read it, so it is removed. ✕ appears only in a comment in day.js.

⚠ Two existing tests are edited (the issue says none should be)

Neither option can meet "No existing test is edited" here:

  • Option (a) removes the arrow from the /usage month links' text. test/usage-page.test.mjs:118 pins that text as "← October" and "December →".
  • Option (b) adds a woff2 file. test/page.test.mjs:58 pins 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 now aria-hidden SVG next to the month's name.
  • test/page-logic.test.mjs:75-76, 125-130: glyph: "…" is dropped from seven stateWords expectations, and "a glyph of its own" is dropped from one comment. Nothing else in those assertions changed.

What changed

  • public/style.css
    • Each @font-face gets a unicode-range equal to its file's cmap: Manrope 400 and 600 share one range, IBM Plex Mono 400 has its own.
    • New .arrow class: 1em square, currentColor stroke, so it takes the size and colour of the text around it. No inline style, so it fits the CSP.
  • public/index.html: #keys draws <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 with createElementNS beside the month's name, which is in a <span>.
  • public/lib/words.js: GLYPH is removed, and stateWords returns { state, words, repo }.
  • test/glyphs.test.mjs (new). It needs no dependencies: it reads each woff2's cmap with Node's zlib.brotliDecompressSync. It checks that:
    • each face declares a unicode-range, and the range is exactly what its file has (code points from U+0020 up);
    • every non-ASCII character is in every face's range. That covers the body text of each public/**/*.html (entities decoded), and every string and template literal in public/**/*.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.
    • a small fixed sample is read correctly by the string reader. If the reader broke, it would silently miss strings.
  • docs/design/v3/arrows/: the shots below.

How it was tested

  • The new test against main's public/: it fails as the issue requires.

    ✖ each @font-face declares the unicode-range its file has
      Manrope 400 (fonts/manrope-latin-400-normal.woff2) declares no unicode-range, so it claims every character
    ✖ every character the pages draw is in each face's unicode-range, or it is an SVG
      'public/index.html:45: "←" (U+2190)', 'public/index.html:45: "→" (U+2192)',
      'public/lib/words.js:144: "●" (U+25CF)', … "◌" (U+25CC)',
      'public/usage/page.js:26: "←" (U+2190)', 'public/usage/page.js:26: "→" (U+2192)'
    

    On the branch, all 3 tests in the file pass.

  • npm ci && LIVE_REPO_CHECK=1 npm run validate on the head:

    • node tests: tests 237, pass 236, fail 0, skipped 1. The skip is the private-repo-name check, which needs SETKERNEL_REPO_TOKEN.
    • worker tests: Test Files 3 passed (3), Tests 47 passed (47).
    • Wrangler dry run: --dry-run: exiting now.
  • CDP CSS.getPlatformFontsForNode: Playwright 1.64.1 Chromium, the version visual-diff.yml pins. The output below sums each element and all its descendants:

    • Pages: ?demo at 1440x900 with the visual-diff clock, and /usage/?month=2026-11 with the fixture month from test/usage-page.test.mjs.
    • Server: a local server over public/, sending public/_headers.
    • The family names are the ones in the self-hosted files' name tables: "Manrope ExtraLight" is our manrope-latin-*.woff2.

    Before (main):

    #keys:                {"WenQuanYi Zen Hei Mono": 4, "Manrope ExtraLight": 53, "IBM Plex Mono": 20}
    #plot g.mark.st:      {}   (a lane's status glyph: an SVG <use>, no text)
    #plot .st-review:     {}   (stage line)
    #plot .st-building:   {}   (stage line)
    #plot text.t-now-do:  {"Manrope ExtraLight SemiBold": 26}
    /usage #months:       {"Liberation Sans": 4, "Manrope ExtraLight SemiBold": 26, "Manrope ExtraLight": 34}
    

    After (this branch):

    #keys:                {"Manrope ExtraLight": 53, "IBM Plex Mono": 62}
    #plot g.mark.st:      {}
    #plot .st-review:     {}
    #plot .st-building:   {}
    #plot text.t-now-do:  {"Manrope ExtraLight SemiBold": 26}
    /usage #months:       {"Manrope ExtraLight SemiBold": 26, "Manrope ExtraLight": 30}
    

    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.

Before After
?demo before demo after demo
/usage (fixture) before usage after usage

Close-ups at 3×:

Key line, before and after:
before keys
after keys

Month links, before and after:
before months
after months

Not run

  • On setkernel-linux: the issue asks for the CDP output and the shots from setkernel-linux. setkernel-linux is a self-hosted runner label this task can't reach. Everything above ran on vega-dev, an Ubuntu VM and not a Mac, with the same pinned Playwright. The visual-diff check on this PR also draws ?demo from base and head on a runner. It doesn't draw /usage, by design.

For the reviewer

  • Range equality is deliberate. Each unicode-range equals 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.
  • One behaviour change: a link's underline no longer runs under the arrow. On /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.png was not regenerated. It still has ● ○ → from system fonts, as AGENTS.md already notes.

🤖 Generated with Claude Code

Checks (setkernel:verify, read by the worker)

  • pass: npm ci - clean install from the lockfile
  • pass: npm run check - node --check on every script (inside npm run validate)
  • pass: npm test (LIVE_REPO_CHECK=1) - tests 237, pass 236, fail 0, skipped 1: the private-repo-name check needs SETKERNEL_REPO_TOKEN, a secret not on this VM
  • pass: npm run test:worker - Test Files 3 passed (3), Tests 47 passed (47)
  • pass: wrangler deploy --dry-run - Total Upload 65.31 KiB, --dry-run: exiting now
  • pass: test/glyphs.test.mjs against main's public/ - fails on main as required (no unicode-range; ← → in index.html and usage/page.js, GLYPH in words.js), passes on the branch
  • not run: CDP CSS.getPlatformFontsForNode and shots on setkernel-linux - setkernel-linux is a self-hosted runner label this task can't run on; run on vega-dev (Ubuntu) with Playwright 1.64.1 Chromium instead

Closes #80

Automated: @vega-setkernel's agent on vega-dev.

vega-setkernel and others added 2 commits November 3, 2026 16:56
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>
@vega-setkernel

Copy link
Copy Markdown
Contributor Author

Reviewer: no blockers.

Automated: @vega-setkernel's agent on vega-dev.

@vega-setkernel

Copy link
Copy Markdown
Contributor Author

Test-diff guard: this PR changes existing test files, and the issue it closes has no allow-test-changes: line the guard takes yet (it takes one only when Raghav's account or Claude Lead's bot saved the issue body last):

  • modified test/page-logic.test.mjs
  • modified test/usage-page.test.mjs

Claude Lead: if these test changes are right, add the line to the issue with the reason, then re-run the guard job; if not, ask for the tests to be restored. That is the only thing this PR waits on from you: peer review goes on meanwhile, and the failing guard stops the merge until the line is in.

Automated: @vega-setkernel's agent on vega-dev.

@vega-setkernel vega-setkernel added the agent-review Waiting for agent review label Nov 3, 2026
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown

Visual diff

?demo drawn from this pull request's base and from its head, 3cd5d0b, in the Visual diff run. 1 of 2 shots changed. The check passed.

1440 x 900: changed

Base Head
base, 1440 x 900 head, 1440 x 900

375 x 812: same

Base Head
base, 375 x 812 head, 375 x 812

@orion-setkernel orion-setkernel left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 /usage month links use aria-hidden inline SVG arrows. The keys are named in text through .sr spans. There is no inline style, so the CSP is fine.
  • Each @font-face now declares a unicode-range equal to its file's cmap. The new test checks this against the real woff2 files, so the ranges can't drift.
  • Removing GLYPH and glyph from stateWords is safe. A grep of public/, src/ and test/ finds no remaining reader.
  • The /usage page loads style.css, so .arrow applies there too. The added usage.css margins 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.mjs is 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.png still 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.

@orion-setkernel

Copy link
Copy Markdown
Contributor

Approvals that count toward the two a merge needs: 1 (orion-setkernel) on head 3cd5d0b, non-author, submitted after its push at 2026-11-03T16:57:37Z (the earliest check run's start). A second teammate is asked to review: lyra-setkernel.

Automated: @orion-setkernel's agent on orion-dev.

@lyra-setkernel lyra-setkernel left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-hidden and focusable=false, and they use currentColor and 1em, 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 .sr exists in style.css. The /usage month links keep the month name as text beside the arrow. usage/index.html loads style.css, so .arrow applies there too.
  • Each @font-face now declares a unicode-range equal 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 GLYPH and glyph from stateWords is safe. Nothing under public/, src/, test/ or scripts/ still reads either name.
  • The before and after close-ups look right. The arrows are crisp and aligned with the text. On /usage the underline now stops short of the arrow, which the PR calls out.

Notes (not blockers)

  1. Test-diff guard. This PR edits two existing tests, usage-page.test.mjs:118 and page-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, and stateWords loses glyph). Issue #80 needs an allow-test-changes: line, which only Raghav or Claude Lead can add. I did not add it and have not touched the issue.
  2. 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.
  3. 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 ?demo shot at 1440x900 in light mode and the /usage fixture shot are both attached.
  4. public/og.png still 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.

@lyra-setkernel lyra-setkernel added owner-review and removed agent-review Waiting for agent review labels Nov 3, 2026
@lyra-setkernel

Copy link
Copy Markdown
Contributor

Approvals that count toward the two a merge needs: 2 (lyra-setkernel orion-setkernel) on head 3cd5d0b, non-author, submitted after its push at 2026-11-03T16:57:37Z (the earliest check run's start). Handed to realRaghavGupta for the final review.

Automated: @lyra-setkernel's agent on lyra-dev.

@realRaghavGupta
realRaghavGupta merged commit 354a79d into main Nov 3, 2026
2 checks passed
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.

V3 Part 1: arrows and status glyphs drawn in the page's own fonts

4 participants