Skip to content

Step the theme's neutrals from three colours, prefix every token, and rank a page's reset below Leaf's layers - #6025

Merged
max-sixty merged 14 commits into
mainfrom
fable-theme
Nov 15, 2026
Merged

max-sixty merged 14 commits into
mainfrom
fable-theme

Conversation

@max-sixty

@max-sixty max-sixty commented Nov 15, 2026 •

Copy link
Copy Markdown
Owner

Restructures Leaf's theme so a page or theme sets three colours and everything Leaf draws follows, and so a page's own CSS framework can't break what Leaf draws. It answers run 14 of the Fable list, "The structure of the CSS and theme"; the candidates and their measurements are on the run's Leaf page, where max-sixty picked the three calls it left open: keep the prefix, build personal themes on the reading look, and keep the accent's hue in the accent tint. All three are in.

What changes

  • A palette is three colours. --lf-paper, --lf-ink and --lf-accent are the theme's inputs. Leaf steps eight neutrals (card, field, chip, rule, border, muted, second ink, inline code's ground) from the paper toward the ink in OKLab, and mixes the six tinted grounds (status, added, removed, highlighted) from the paper and the status's hue. --lf-r-s and --lf-r-l are half and twice --lf-r. The kernel's paper and ink are the browser's Canvas and CanvasText; the reading theme sets its warm pair.
  • Every custom property is --lf-. The 177 bare names (--paper, --muted, --accent, --card, --r, --sans) are prefixed, so none meets a name a page's framework declares. --border-2 becomes --lf-border.
  • A page's reset layer ranks below Leaf's. The document's layer order names reset ahead of Leaf's tiers, so a reset there leaves Leaf's controls their faces. Every other page layer still outranks Leaf's.
  • A personal theme builds on the reading look. reading composes first and the theme after it, so a theme of five declarations keeps the callout's tint, the tags and the label it lost when it replaced reading. themes.with_theme is the one statement of that order, and theme_package goes.
  • The accent tint keeps the accent's hue. --lf-accent-tint mixed 12% of the accent into the card in sRGB, where the reading navy and cream cancel to a grey that reads as a disabled control. It is now the card with a tenth of the accent in OKLab at several times its chroma, capped at the reading accent's.
  • One list of public tokens. package-themes.md, "Theme tokens", names 94; with the declarations and outputs other references name, 121 of the 508 properties Leaf's sheets declare are public, and tests/model/test_theme_tokens.py holds Leaf's examples and instructions to them.

What it removes

Fourteen hand-stated colour pairs (the theme states 29 where it stated 45, two of which moved to the reading theme), the references' second copy of the token list, and the need for a theme to restate about ten colours to recolour a page.

What users see

  • Default pages: the same but for the accent tint, the ground under a hovered accent control and under a reaction the user added, which goes from rgb(230 234 235) to rgb(229 241 253) in the light scheme and from rgb(45 48 49) to rgb(31 44 57) in the dark. Each derived colour lands within two levels of one colour channel of the hex it replaces. leaf-dev stills against main, on the 48 example and fixture pages and 25 interactive states in Chromium and Firefox, light and dark (267 pairs), run before the tint changed, found no pixel moving more than 3 levels of a channel, apart from the example film below, a trace main's own arm fails to load, and about 40 pixels of one text line's edge in Firefox. An earlier run of all 285 states in light Chromium read the same.
  • A page with its own palette: three declarations recolour the panel, thread cards, widgets, controls and status grounds; before, 17 elements Leaf drew kept the reading theme's cream.
  • A page with no theme: Leaf's panel, cards and widgets take the browser's canvas and text colours, or the page's once it sets --lf-paper and --lf-ink, rather than the reading theme's cream.
  • A page with Tailwind 4 and shadcn's tokens: five of Leaf's words read under 3:1 and eleven of its controls lost their faces. The words now read with no edit to the page; the faces come back once its reset stands in @layer reset.
  • A plain site using portable.css: the same collision made five words of a chart and a timeline unreadable; now none.

What it costs

  • The rename touches 201 files and 3,662 occurrences, mechanically, and conflicts with any open branch that touches a stylesheet. The script below redoes it on a branch after it merges main.
  • A page or package that sets or reads a bare token name writes the prefixed one. Pages made before this draw with unresolved tokens until edited.
  • A page's rules in a layer named reset no longer outrank Leaf's layered rules.
  • A personal theme that restated the whole look now composes over reading; one that wants none of it is a content package on a page with --no-theme.
  • Two example films draw their fourth colour in the chart palette's violet rather than the comment marks' ink, which stays Leaf's own.

Where to look

browser/styles/tokens.css (the steps, at --lf-paper, and the grounds, at --lf-ok-tint), packages/reading/defaults.css (the theme's two colours), src/leaf/layer.py (PAGE_RESET_LAYER), src/leaf/themes.py (with_theme), skills/leaf/references/package-themes.md ("Theme tokens"), and notes/browser-support.md for the Chromium gap that sets how the steps are written. The first commit is the rename alone. Codex reviewed the branch twice; its findings (a demoted base layer losing an author's rules, a stale regex, a test that claimed more than it held) are fixed in the later commits.

Asked for by max-sixty through the Fable run list. Two tests in the test job fail the same way on main (test_margin_entry_tone_stays_distinct_from_control_and_agent_state and test_each_sampled_focus_ring_is_shown_whole_in_its_surface). Tests: tests/model/test_theme_tokens.py, tests/model/test_themes.py, two browser tests in tests/browser/controls/test_theme_and_device.py, pnpm run test:runtime, the smoke tier and the layer, theme and font model tests. Evals: four styling cases pass 3 of 3 on main and on the branch, pin-takes-no-page-room passed 2 of 3 and 1 of 3 on a reply no changed passage covers, and the two new cases pass 6 of 6.

The rename script
"""Give Leaf's theme tokens the `--lf-` prefix on a branch cut before the rename.

    python rename_tokens.py          # from the repository root, after merging main

Every whole occurrence of a bare token name in a tracked text file becomes `--lf-`
and the rest of the name; `--border-2` becomes `--lf-border`. Then run
`pnpm run build:browser`, and read `git diff` where a name is also a word of the
file's own, such as a command's `--quiet` flag, which this leaves alone only after
`uv`, `docker`, `run` or `--script`.
"""

import re
import subprocess
from pathlib import Path

NAMES = """
    accent accent-tint add-tint aim-floor aside badge-fill badge-ink border-2
    callout-margin-block card chip chip-lh chip-pad chip-r choice-pad code-bg code-border
    code-chrome code-ink code-inline-pad code-inline-r code-inline-size code-line code-muted
    code-size col col-pad danger danger-ink danger-tint del-tint details-margin-block
    drawing-size drawing-small-size entry-floor field figure-margin-block fill focus-region-gap
    focus-region-room focus-ring focus-ring-gap focus-ring-inset focus-ring-landing
    focus-ring-room focus-ring-w focus-shadow focus-surface font-chip font-choice font-code
    font-compact font-count font-emoji font-error font-fine font-goal font-heading font-label
    font-message font-name font-small font-status font-tip font-title font-ui font-widget
    h2-start h3-start hi-tint hr-margin-block ink ink-2 link-underline link-underline-offset
    list-inset margin-entry margin-gap mark mark-contour-ink mark-contour-w mark-hover mark-ink
    mark-ink-text mark-pending mark-pending-text mark-size mark-strong mono msg-size muted note
    offer-hover offer-hover-shadow ok ok-ink ok-tint ok-wash page-pad-end page-pad-start
    pane-bar-pad pane-bar-pad-block pane-inset paper pin-inset playground-controls-height
    playground-top pre-bg pre-inset quiet quote-inset quote-rule quote-style r r-l r-s rail
    rail-hang raise-1 raise-1-blur raise-1-drop raise-2 raise-2-blur raise-2-drop raise-3
    raise-3-blur raise-3-drop react rule sans series-1 series-2 series-3 series-4 series-5 serif
    shade sidebar sidebar-spine sp-1 sp-2 sp-3 sp-4 sp-5 syn-comment syn-keyword syn-name
    syn-number syn-string syn-type t-1 t-2 t-3 t-4 t-5 t-6 t-7 t-working-label target-trace-ink
    thread-card thread-card-min tip-bg tip-ink tip-pad tip-r tip-turn-ink turn-ink turn-wash
    veil warn warn-ink warn-tint wide wide-page-max
""".split()
SKIP = ("tests/fixtures/plain/", "evals/ui-review-detection/fixtures/")
TEXT = (".css", ".html", ".js", ".mjs", ".ts", ".py", ".md", ".json", ".yaml", ".yml", ".jsonl")
whole = re.compile(
    r"(?<![\w-])--(" + "|".join(map(re.escape, sorted(NAMES, key=len, reverse=True))) + r")(?![\w-])"
)
flag = re.compile(r"(uv|docker|run|--script)[\"',\s\]\[]+[^\n]{0,40}$")
count = 0
for name in subprocess.check_output(["git", "ls-files"], text=True).split("\n"):
    if not name.endswith(TEXT) or "/vendor/" in name or name.startswith(SKIP):
        continue
    path = Path(name)
    text = path.read_text(encoding="utf-8")

    def renamed(match: re.Match) -> str:
        global count
        before = text[max(0, match.start() - 60) : match.start()]
        if match[1] == "quiet" and flag.search(before):
            return match[0]
        if match[1] == "r" and text[match.end() : match.end() + 1] == "{":
            return match[0]
        count += 1
        return "--lf-border" if match[1] == "border-2" else "--lf-" + match[1]

    new = whole.sub(renamed, text)
    if new != text:
        path.write_text(new, encoding="utf-8")
print(count, "occurrences renamed")

This was written by Claude Code on behalf of max-sixty

Leaf's theme tokens were bare names on the root: --paper, --ink, --accent,
--muted, --card, --border-2, --r, --sans. A page that brings its own CSS
framework declares the same names for other things. Under shadcn's tokens
--muted and --accent are pale surface colours and --card and --sidebar are
colours too, so the panel's and thread cards' quiet words and symbols took
the page's surface colour and vanished into it.

Every property a sheet under browser/ or packages/ declares now starts with
--lf-, as the runtime's own already did, and a dependency's properties keep
its prefix. --border-2 becomes --lf-border, since no --border-1 exists. The
rename is mechanical across sheets, modules, examples, docs, references,
tests and evals; plain HTML fixtures and captured pages keep their own
names. The syntax bundle is rebuilt for its six colour variables.

A text document's token highlights keep their names (lf-token-syn-comment),
now read from the variable after its prefix.

Behavior changed: a page or package that sets or reads a bare token name
writes the prefixed one.
The theme stated each neutral as its own pair of hex colours: card, field,
chip, rule, border, muted, the second ink and inline code's ground. A page
with a palette of its own set --lf-paper, --lf-ink and --lf-accent and kept
the default theme's cream cards and warm rules, so recolouring a page whole
took about ten colours, and a test theme states 38 declarations.

Each neutral is now an OKLab mix of the paper toward the ink, so the three
colours recolour the panel, thread cards, widgets and controls with the
page. The kernel's paper and ink are the browser's Canvas and CanvasText,
which a page with no theme keeps, and the reading theme sets its warm pair.
On that pair each mix lands within 1.4 of the colour it replaces (OKLab
distance x100), and no text loses contrast. --lf-r-s and --lf-r-l are half
and twice --lf-r, so one length squares or rounds every corner.

--lf-ground on the root is the page's paper, so a page that paints its own
ground sets --lf-paper and nothing else.

Behavior changed: a page with no theme draws Leaf's panel, thread cards and
widgets in the browser's canvas and text colours rather than the reading
theme's cream. A theme that restated only --lf-r now also changes the small
and large corners.
A page's own cascade layers are named after Leaf's sheet, so they outrank
every tier of Leaf's. A framework's reset in a layer, as Tailwind 4 writes
its preflight, zeroed the borders, padding and faces of Leaf's widgets and
controls, and reached the panel and thread cards too, since their guard
rolls back to the layered cascade.

The document's layer order now names `reset` and `base` ahead of Leaf's
tiers. A reset in either still zeroes the page's own elements, and Leaf's
faces outrank it on what Leaf draws. A page with an unlayered reset wraps it
in `@layer reset`. Every other page layer still outranks Leaf's tiers.

The reading face states a list's markers as the browser's, since a reset
below it would otherwise clear the bullets in a thread's message.

Behavior changed: a page's rules in a layer named `reset` or `base` no
longer outrank Leaf's layered rules.
… them

Leaf's sheets declare 508 custom properties, and nothing said which a page,
theme or package may rely on: the references named 74, the examples read
others (--lf-chip-r, --lf-mark-ink), and a private property an author copied
could change in any update.

package-themes.md, "Theme tokens", now lists them by role: the colours a
theme sets, the neutrals Leaf steps from the paper and ink, and the type,
spacing, corner, lift, control and page geometry tokens. page-authoring.md,
page-layout.md and packages.md point to it and say how a page hands Leaf a
palette of its own or a framework's tokens, and how its reset keeps off
Leaf's controls. tests/model/test_theme_tokens.py holds three things: every
property a sheet declares starts with --lf- or a dependency's prefix; the
examples, registry examples and package instructions read only properties a
reference names; and every property a reference names exists.

The root paints the page's ground from --lf-paper in the kernel, so a page
with no theme sets the token and writes no rule. Two example films draw
their fourth colour in the chart palette's violet rather than the comment
marks' ink, and the playground's --playground-NAME properties keep their
names, which the first commit had prefixed in an instruction and a test.

Two browser tests cover the behavior the earlier commits changed: a page's
paper and ink recolour the neutrals Leaf draws, with a theme or without, and
a reset in `@layer reset` leaves Leaf's controls their faces.
… warmth

A plain mix of the reading theme's paper and ink came out greyer than the
neutral it replaced: the border's blue channel moved 10 levels, and the
chips and callout grounds lost their warmth over whole areas.

Each step now also scales the mix's two OKLab colour axes, by a factor of
its own and by no more than 0.014 of chroma. On the reading theme's paper
and ink every neutral lands within two levels of one channel of the colour
it was tuned to, a colourful palette's neutrals take a faint tint of it, and
a grey palette's stay grey. The card is the paper a little lighter.

The axes are scaled rather than `oklch()`'s chroma: Chromium 158 reads a
near-grey colour's hue as none in a relative `oklch()`, which drew these
neutrals pink there. notes/browser-support.md records the gap.
page-palette-sets-the-theme-tokens asks for a page in a user's house
colours and passes when the three theme colours are set on the root.
page-reset-stays-off-leaf-controls hands over a site's stylesheet with a
reset and passes when the reset stands in `@layer reset` or `base` and the
root hands Leaf the site's ground, text and brand colours.
…e paper, and leave the root's paint to the theme

Review and a fresh look at the captures found three faults in the branch.

A page's `base` layer ranked under Leaf's tiers with `reset`. A framework's
base layer holds its author's element rules beside its reset, so on a themed
page an `h1` sized in `@layer base` took the reading look's size, and a
framework's `html { background }` there lost to the kernel's paint of the
root, which drew the page in the browser's canvas colour instead of its own.
Only `reset` ranks low now, and the reading theme paints the root again, so
a page with no theme paints its own.

The status grounds were stated, so a callout stayed cream on a page whose
paper is cool. Each is now seven parts the paper and three a colour of the
status's hue, which gives the reading theme the tints it had, each within
one level of a channel, and follows any other paper. The grounds of added,
removed and highlighted lines are stepped the same way.

Two tests were weak. The focus ring's matcher in render_cases_layout.py
still named `--focus-ring`, so it matched no outline after the rename. The
check that every token a reference names exists counted a module's
`var(--lf-paper)` as a declaration; it now counts a sheet's declarations and
the names a module holds as strings of their own, and fails with the paper's
declaration removed. The reset test also holds that an author's own layer
outranks the theme.

@leaf-agent leaf-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

After 7c16ea2, the description no longer matches the code in three places. Merging squashes the description into main's commit message, so these errors would end up in the history:

  • What changes says the layer order names "reset and base" ahead of Leaf's tiers, and What it costs says rules in "a layer named reset or base" no longer outrank Leaf's. Only reset ranks low now (PAGE_RESET_LAYER in src/leaf/layer.py).
  • Where to look names PAGE_RESET_LAYERS. The constant is now PAGE_RESET_LAYER.
  • What users see says a page with Tailwind 4's reset now has no unreadable words or faceless controls. Tailwind 4 keeps preflight in base, so after this commit that holds only once the page moves preflight into @layer reset. page-layout.md now tells authors to do that. Either rerun the Tailwind case against the head or state that condition in the claim.

…me the reset layer on the site

The pull request's test job failed five tests. Two fail the same way on
main: a margin entry's tone, and the sampled focus rings' journey. Three
were this branch's.

The series palette's floors read the paper from tokens.css, where it is now
the browser's canvas; the test reads it from the reading look, which states
it. The drawing preview's test took a stroke's channels from the digits of
its computed colour, and a stepped token computes to `oklab()`; it now
paints the colour and reads the pixel, as the render checks do.

The site's account of the cascade said every `@layer` block of a page
outranks Leaf's layers; it now names `reset` as the one that ranks below.
…st's claim

The third token test claimed each property a reference names is declared,
and counted a module's `getPropertyValue("--lf-sans")` and names in comments
as declarations, so it passed with the declaration removed. Whether a
property a sheet reads is set is already
`test_every_token_a_sheet_reads_is_set_somewhere`'s to hold. This test now
claims what it can: each name a reference teaches is one Leaf's sheets or
modules use outside their comments, an author's input such as `--lf-bound`
included, so a renamed or removed token the prose still names fails it.
The tint under a hovered accent control, and under a reaction the user added,
mixed 12% of the accent into the card in sRGB. The reading theme's navy and its
cream card cancel there: the tint measured chroma 0.004, a grey, which reads as
a disabled control. It is now the card with a tenth of the accent in it in
OKLab, the accent going in at several times its chroma, capped at the reading
accent's, so the tint lands at chroma 0.02 in the accent's hue and still
follows the card a page sets. A grey accent still gives a grey tint.

Default pages change: the tint goes from rgb(230 234 235) to rgb(229 241 253)
in the light scheme, and from rgb(45 48 49) to rgb(31 44 57) in the dark,
the same in Chromium and Firefox.
A page's theme replaced `reading`, so a theme of five declarations lost the
callout's tint, the tags and the label, and had to restate each. `reading` now
composes first and the theme after it, so a theme states only what it changes.
A look that wants none of the reading look is a content package on a page that
takes no theme. `package check` already composed a package over `reading`, so
a theme is now checked on the layer its pages get.

`themes.with_theme` is the one statement of the composing order:
`layer.selected_layer` and `selected_vocabulary` take the ordered packages, and
`theme_package` goes.
# Conflicts:
#	tests/browser/controls/test_focus.py
#	tests/browser/startup/test_activity.py
#	tests/browser/test_render_pages.py
@max-sixty
max-sixty marked this pull request as ready for review November 15, 2026 19:02
@max-sixty
max-sixty merged commit a6533b5 into main Nov 15, 2026
5 of 6 checks passed
@max-sixty
max-sixty deleted the fable-theme branch November 15, 2026 19:22
max-sixty added a commit that referenced this pull request Nov 15, 2026
…d its test

Both conflicts keep this branch's side with the renamed tokens: the palette reads
var(--lf-ok), var(--lf-danger) and var(--lf-pre-bg), and widget-shadow.css's marks
read the palette's --lf-code-add-mark and --lf-code-del-mark. The test's dark code
tokens move to --lf-pre-bg, --lf-code-ink and --lf-syn-*. Under the old names they
reached no canvas, so the dark-code check passed even with lightness stated per
scheme; the test now first requires the canvas to turn dark. With the first push's
palette, renamed, it fails with "a added row +0.708 in lightness from dark code", and
it passes with this one.
max-sixty added a commit that referenced this pull request Nov 15, 2026
…heme's hues (#6050)

Under the reading theme lf-diff filled an added row `#e0eae3` and a
removed row `#f3e0de`: 16% of `--lf-ok` and of `--lf-danger` mixed into
`--lf-pre-bg` in sRGB. Leaf's status colours are muted, so that mix
stays near grey (Oklab chroma 0.015 and 0.021), and the two rows were
0.032 apart in Oklab where GitHub's light rows are 0.057 apart. A larger
share of the token only darkens the rows.

The diff package's palette (`packages/diff/styles/palette.css`) now
mixes each status token into `--lf-pre-bg`, stripped of chroma and hue,
in oklch (15% for a row, 30% for a word mark), and triples the mix's
chroma up to a cap (0.034 for a row, 0.065 for a mark). So the row fills
and word marks follow `--lf-pre-bg`'s lightness and the tokens' hue,
whatever a theme or page sets for each, a dark code canvas on a light
page included. The marks move from `widget-shadow.css` into the palette
in the same form, because the old 34% sRGB mix was less colourful than
the row it now sits on. Stripping the canvas's hue keeps the mix from
turning toward a tinted canvas; mixing in oklab instead leaves the hue
powerless at that chroma in Chromium, which reads it as 0. A grey token
mixes to a grey row.

Painted colours, sampled from `leaf-dev stills --state diff-separator`
crops of the pr-walkthrough's key hunk in Chromium:

| Scheme | Rows apart | Added mark to its row | Removed mark to its row
|
| ------ | ---------- | --------------------- | -----------------------
|
| Light, before | 0.033 | 0.083 | 0.090 |
| Light, after | 0.059 | 0.076 | 0.076 |
| Dark, before | 0.031 | 0.101 | 0.096 |
| Dark, after | 0.058 | 0.085 | 0.081 |

A theme may set the code inputs apart from the scheme
(`package-themes.md`, "Theme colors"). With dark code tokens on `:root`
under the light scheme, the rows stand 0.047 lighter than the dark
canvas and code reads 8.0–12.3:1 on them (main: 7.9–12.3:1). Marks there
stand 0.056 from their rows. The line numbers and +/− signs on changed
rows, and the change counts, still take `--lf-ok-ink` /
`--lf-danger-ink`, which follow the page's scheme rather than the code
canvas, so on that page they read 2.15–2.34:1, as on main (2.14–2.30:1);
this PR leaves them. A 35% mark would stand 0.070 from its row there,
but would take the default light scheme's code on a mark to 4.4:1, the
finding main has; at 30% it is 4.7:1.

Code on the marks reads better than on main. With every file of the
pr-walkthrough open, the render gate's syntax probe (`unreadSyntax`)
found a light-scheme comment token at 4.4:1 on a word mark on main and
finds nothing now, in either scheme, on that page, diff-thread-gallery,
worktree-diffs, live-progress or file-tree. Line numbers, syntax colour,
folded context and notes anchored to lines are unchanged: the stills
list only row and mark backgrounds among the computed styles that differ
(states `diff-separator`, `walkthrough-calls` for lf-call-diff,
`diff-author-notes`, `diff-long-lines`, `worktree-startup`; light and
dark).

`test_a_diff_is_colored_by_each_files_own_path` asked only that the two
fills differ. It now has the browser convert each row and mark paint to
Oklab, in both schemes, and requires the rows at least 0.05 apart and
each mark at least 0.05 from its row. It also sets dark code tokens
(`--lf-pre-bg`, `--lf-code-ink`, `--lf-syn-*`) under the light scheme,
requires the canvas to turn dark, and requires each changed row within
0.1 of the canvas's lightness and the syntax probe to find nothing. On
main it fails with `dark: added and removed rows 0.032 apart`; with
lightness stated per scheme it fails with `a added row +0.708 in
lightness from dark code`.

## Browser support

The palette needs relative colour syntax: Chrome 122, Firefox 128,
Safari and iOS 18. On Safari 17.4–17.6 the declarations fail at
computed-value time and changed rows lose their fill. The colours
resolve to the same `oklch()` values in both schemes in Playwright's
Chromium, Firefox and WebKit; the review also checked Safari on an iOS
26.1 simulator.

## Calls Max may reverse

- The mix shares (15% row, 30% mark) and caps (0.034, 0.065). The light
fill sits at about today's lightness (0.93 against 0.92–0.93) rather
than GitHub's lighter 0.955–0.977: at a lighter row, sRGB holds too
little chroma for a red for two rows of one lightness and chroma to
reach the separation (at 0.955, at most 0.022).
- The marks moved into the palette beside the fills, as
`--lf-code-add-mark` / `--lf-code-del-mark`, so the four colours have
one home.
- `--lf-add-tint` / `--lf-del-tint` (inserted and deleted prose,
lf-shot's difference, chips) are unchanged, still 0.039 apart.

## Ran

- `uv run pytest tests/browser/test_render_anchors.py
tests/browser/test_render_gate.py -k
"test_a_diff_is_colored_by_each_files_own_path or
test_a_diff_marks_changed_words or test_the_syntax_probe_reports or
test_a_diff_can_start"`: 4 passed; the first fails with main's sheets
and with the first commit's.
- `uv run pytest tests/model/test_interact_layer.py
tests/model/test_interface_fonts.py`: 178 passed on the first commit.
After merging main (#6025's `--lf-` names):
`tests/model/test_theme_tokens.py` and `tests/model/test_themes.py`
pass; two `test_interface_fonts.py` tests fail on main too, on
`.lf-msg-ending` in `browser/styles/components/surfaces.css`, which
still names `--font-small`.
- `leaf-dev stills` for the five states above, light and dark, base
`5cc9aef6a7`, before the merge; the merge renames the tokens and leaves
their values.

## Not verified

- A wide-gamut display: the bundled tokens' colours sit inside sRGB, but
a theme whose canvas and token give a row above lightness 0.95 can ask
for more chroma than sRGB holds there, and the browser gamut-maps it.
- The lf-diff fixture in `test_page_fixture_renders` (journeys tier) was
not run; its syntax-contrast part was run by hand on the five pages
above.

Closes #5857
max-sixty added a commit that referenced this pull request Nov 15, 2026
#6051 added `.lf-msg-ending`, the line under a question the agent ended
that says how it ended, with `var(--sp-1)`, `var(--ink-2)` and
`var(--font-small)`. #6025 landed beside it and renamed every theme
token to `--lf-`, so on main nothing sets those three names and all
three declarations are invalid at computed-value time. The line drew in
the face of whatever holds it, with no gap above it. Each PR passed its
checks against a base without the other.

The rule now reads `--lf-sp-1`, `--lf-ink-2` and `--lf-font-small`. No
other line added since #6025 names a bare token: a sweep of `git diff
a6533b5..HEAD` against the rename list in #6025's message finds only
these three.

## Evidence

A `.lf-msg-ending` element added to `heat-loss`'s `main` (`leaf-dev
probe heat-loss --base --js …`), beside a reference element that reads
the three tokens directly:

| | margin-top | colour | font |
| --- | --- | --- | --- |
| main | 0px | `rgb(28 27 24)`, the page's ink | 17px Charter serif |
| this branch | 4px | the second ink | 11.5px system-ui |

The branch's values are identical to the reference element's.

## Tests

Main fails three model tests on this rule. All three pass here:

- `test_every_rule_of_the_interface_names_a_declared_font` and
`test_every_font_size_names_a_theme_token`
(`tests/model/test_interface_fonts.py`)
- `test_every_token_a_sheet_reads_is_set_somewhere`
(`tests/model/test_interact_layer.py`), which reports all three names on
main, not only the font

Also run: `tests/model/test_theme_tokens.py` (passes), and
`tests/browser/threads/test_agent_replies.py -k
test_an_answer_says_what_it_leaves_while_that_stands` (passes; it reads
the line's text and clipping, not its style, so it passed on main too).

Not checked: the line inside a real margin card. The probe placed the
element in the page's `main`, which shows the rule now resolves but not
what the card's own face around it looks like.
leaf-agent added a commit that referenced this pull request Nov 15, 2026
…wo readings (#6075)

#6025 steps the theme's neutrals in oklab, so computed style now writes
some of Leaf's colours outside `rgb()`. Two test readings compared those
strings rather than the colours, and both have failed on `main` since
#6025 (first in push run
[43756616490](https://github.com/max-sixty/leaf/actions/runs/43756616490)).
Locally, both pass at #6025's parent and fail at #6025 and at current
`main`. With this change, both pass.

- `test_the_leaf_paints_inside_its_focus_ring_after_folding`
(`ValueError: unknown color specifier: 'oklab(0.497097 -0.000823501
0.0183057)'`): the test and the `leaf_dev.panel_paint` probe journey
both parsed the leaf mark's colour with PIL's `ImageColor`, which can't
read `oklab(...)`. `panel_paint.mark_colours` now paints each colour on
a canvas and returns its sRGB channels, and the test and the probe both
call it.
- `test_color_cues_fade_to_the_live_surface[firefox_browser]` (`{'end':
'color(srgb 0 0 0 / 0)', 'rest': 'rgba(0, 0, 0, 0)'}`): Firefox
serializes the same transparent colour in two forms. The test now
compares the painted RGBA values, so it still checks that the cue ends
on the live surface.

No product code changes. #6025 meant to move the neutrals to oklab, and
these readings were the only part that disagreed with it.

Refs #3985 — automated triage

Co-authored-by: leaf-agent <[email protected]>
max-sixty added a commit that referenced this pull request Nov 16, 2026
main prefixed every theme token (#6025), so --muted no longer exists and the grey dot's
rule read nothing; test_every_token_a_sheet_reads_is_set_somewhere caught it on the PR's
merge with main.
max-sixty added a commit that referenced this pull request Nov 16, 2026
… it (#6107)

Ten nightly-tier cases have failed on main since Nov 15, because two
changes moved what the tests read and the push and PR selections don't
run that tier. A macOS run of the nightly suite found them, and each
passes locally at its cause's parent and fails at the cause:

- #5964 put a command's findings and refusals in its JSON on stdout. Two
`test_wait.py` cases still asserted an empty stdout,
`test_codex_adapter.py`'s later-claim case read its refusal from stderr,
and `test_interact_anchors.py`'s unsectioned-quote case read the advice
as a line of its own. The wait cases still check that a waiter that lost
its page prints only why it stopped.
- #6025 writes the theme's neutrals in oklab, and
`test_the_gutter_runs_beside_the_exhibit_and_no_further` (six cases)
parsed the bar's colour from the integers in its computed style. It now
paints the colour on a canvas, as #6075 did for two other readings.

No product code changes. Max asked whether anything was working on the
nightly failures; nothing was on these. Tests: the ten cases pass
locally with `--run-nightly`.

> _This was written by Claude Code on behalf of max-sixty_
leaf-agent added a commit that referenced this pull request Nov 16, 2026
…and a deleted theme section (#6125)

Brings seven comments and docstrings in line with code that changed in
the last day. No code changes.

- **Draft carrying (#6060).** #6060 removed `carry` from `openComposer`,
so a new target opens its own draft and earlier words stay with their
passage. It also dropped the word "Draft" from Threads' row status. Four
comments still described the old behavior:
- `composing/surface.js`'s header said `commentOnTarget` carries an
unsent draft to the new target.
- `composing/aim.js` said an ⌥ press moves the draft onto another
target.
- `composing/selection.js` said an explicit Comment gesture can carry
user text.
  - `floating-panel.js` said a drafted Threads row says "Draft".
- **Other pages (#6068).** The served `others` list became `/api/pages`,
but `server.py`'s docstring for the machine key still named the `others`
menu.
- **Theme tokens (#6025).** `tests/browser/test_render_anchors.py` cited
`package-themes.md`'s "Theme colors" section, which #6025 replaced with
"Theme tokens".
- **`renderQuiet` (#6070).** Its new comment said it runs as a message's
markup arrives. `paintDeclaredWords` also runs it on the page at upgrade
and on a revision's roots.

Found by the nightly review of the commits since the last run.

Co-authored-by: leaf-agent <[email protected]>
leaf-agent added a commit that referenced this pull request Nov 22, 2026
This week's duplicate sweep of `dev/`, `build/`, `tests/` and `worker/`
(week 47) moves six duplicated helpers onto one home each and moves
every caller. Behavior stays the same. The touched model tests, the dev
js_facts tests and the Worker's routing, storage and index tests pass. A
script compared the old and new outputs of the consolidated `leaf_dev`
functions and the seeded-log reads across the corpus, and they match.

| Question | Home | Copies removed (introducing PR) |
|---|---|---|
| Which stylesheets do the core and the bundled packages ship, leaving
out vendored files? | new `interact_support.shipped_sheets` | `sheets()`
in `test_interface_fonts.py` (#4804) and `test_theme_tokens.py` (#6025).
Five inline loops in `test_interact_layer.py` (#3138, #3886) |
| Run `tests/js_facts.mjs` | `interact_support.js_facts` (#2666) | its
own subprocess call in `dev/tests/test_js_facts.py` (#5118) |
| Lowercase hex of bytes in the Worker | `routing.hex`, which is
`newSessionId` (#313) renamed, plus a `sha256Hex` in `storage.ts` | the
publication-identity and chunk-digest copies in `storage.ts` (#2652) |
| Is this pid alive? | `leaf.machine.pid_alive` | `_alive` in
`tests/process/test_codex_tool.py` (#3331). `running()` in
`test_interact_layer.py` (#1774) |
| Read an example's seeded log | `read_event_lines(seed_log(source))`
(#4484) | inline parsers in `test_render_pages.py`,
`test_interact_product.py` (#924) and `test_render_gate.py` (#509). The
last one split lines with `splitlines()`, which also breaks at U+2028 |
| Paths of the bundled registries and packages; which registry keys name
elements | `leaf.schema.ASSETS` / `BUNDLED_PACKAGES` /
`DEFAULT_PACKAGE`, `leaf.registry.contract.is_element_name`,
`docs.registries()` | `docs.py`'s own `ASSETS`/`PACKAGES` (#3593) and
its `startswith("lf-")` checks (#2660). `logs usage`'s hand-written
regex and registry list (#5970). `ROOT / "packages" / "default"` in
`stills.py` (#3927) and `test_product_page.py` (#3593) |

`is_element_name` and the two checks it replaces give the same answer
for every key in the bundled registries today. A selector key such as
`lf-options.selected` would have passed the `lf-` prefix test.

<details><summary>Sets found and left alone</summary>

- **Sets an open PR is changing.** Nothing in this diff overlaps another
open PR's hunks. #6732 moves tests out of `test_render_gate.py`,
`test_render_pages.py` and `test_interact_layer.py`, but none of the
tests changed here.
- **Changes to browser tests with nothing run to check them.** The WCAG
contrast computation exists as about 11 copies across browser, journey
and model tests. Other copies: about 9 `EDITOR_ROOTS` shadow-root
keepers, the `/api/interaction` batch predicates, CDP `touch()`
closures, one-line patch templates, reply-holding route handlers, and
the `data-lf-entry` runtime-module import snippet in
`dev/leaf_dev/states.py` and in tests. Each would mean editing browser
tests that this sweep can't run on a shared host. They suit a sweep that
can run those tests.
- **Vendor bundling.** `build/browser/build.mjs` builds signals-core and
Lit with esbuild calls that repeat `build/vendor.mjs`'s `bundle()`.
Merging them changes build options and needs a full `check:browser` byte
comparison, so it was left for a change that runs that.
- **Copies that are near but not the same.** `_build.py`'s `check_links`
repeats `leaf_website.released_path`, but it also needs the matched
page's root and kind. The list of API-key variables an eval drops is
repeated across Python and the Promptfoo configs, as subsets and
supersets of one another. The Codex token-expiry check has different
thresholds, 1 h and 60 s.
- **Too small to be worth it.** Picking a free loopback port
(`eval_user.py`, `interact_support.available_loopback_port`). The XDG
state root in `leaf_dev.state_home` and `leaf.state.state_home`. The
`settled` helper in two `tests/runtime` files.

</details>

Co-authored-by: leaf-agent <[email protected]>
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.

2 participants