Skip to content

Set every face Leaf's interface draws on its type ladder, and have stills list a face one side alone draws - #4758

Merged
max-sixty merged 5 commits into
mainfrom
list-ui-fixes
Oct 30, 2026
Merged

max-sixty merged 5 commits into
mainfrom
list-ui-fixes

Conversation

@max-sixty

@max-sixty max-sixty commented Oct 30, 2026 •

Copy link
Copy Markdown
Owner

Leaf's interface text had drifted into near-duplicate faces. Reading the computed face of every shown run of words in 279 of the 301 leaf-dev stills states (13,032 runs, 147 distinct faces) found the floating panel on a scale of its own (13px body, 12px for qualifiers, 11px pills, a 10.5px badge) beside the rest of the chrome's 14px and 11.5px ladder rungs; rows' ends at calc(1em - 1px), which lands on 13px, 12px or 10.5px depending on the row; three dialogs titled in the browser's bold (700) and one at 600; four 10px literals and a 10.5px badge for words on a mark; and weights 450 and 650 used once each.

What changed

  • The panel's type sits on the ladder. 13px is --t-working-label (the same 13px), 12px and 11px are --t-6 (11.5px), 14px is --t-5. The panel's qualifiers (option descriptions, statuses, filter tabs, the mode pill, Versions' v3) are half a pixel smaller and now match the group headings and statuses it shares with the other lists. The panel header in floating-panel.css says so.
  • A row's end is --t-6 (controls.css, .lf-row-end), the size of every other qualifier in the chrome, instead of a pixel less than its row. The Page Map's "1 unread" goes from 13px to 11.5px; the panel's "Your turn" from 12px to 11.5px.
  • --t-7 (10px) names the words on a mark: a margin mark's count, the margin preview's position, a mark label's second line, a drawing's status line and the panel leaf's badge (10.5px before). No density restates it.
  • One dialog head (chrome.css, .lf-dialog-head and .lf-dialog-title): the Page Map, About this page, the command reference and the image preview set their titles at weight 600.
  • Small literals become rungs: a thread quote and a message's author name (13px, now --t-working-label; the name resolves at the root, as --msg-font does, so page density leaves it alone), thread summary labels (11px to --t-6), the contents' title link (650 to 600), a mark label's second line (450 to 400), and the timeline, motion and visual-review controls' 12px and 13px.
  • On Claude's kind word ("Reply") sits on its title's baseline. It is the one row lead set a rung smaller than its row, so centring it in its own line, as a lead's mark is centred, stood it above the title's baseline: 1px at 12px, 2px at 11.5px.

Left as they are: visual review's 15px inspection heading, which at 14px read no larger than the 14px semibold field labels under it; the reading theme's eyebrow (its own small-caps voice, owned by a theme a page can decline), the trace timeline's deliberate max(12px, --t-6) floor, drawings' own units (svg.drawing, chart axes, timeline lanes), the reaction picker's 16px emoji, and the 500 weight that small inked text uses (tooltips, errors, a drawing's reference).

leaf-dev stills lists faces one arm alone draws

Across a run, stills now collects each arm's faces (family, size, weight, style, tracking and case of every shown element with words of its own) and writes faces.txt: each face only one arm draws, with the elements that wear it and the other arm's nearest face. For this change it lists the 11px face the panel retired:

faces only base draws
  400 11px system-ui  x20; head's nearest 400 11.5px system-ui

A change that adds a face half a pixel from an existing one shows it in the run that makes it. The catalogue also gains a page-map state, which it lacked.

Checks

  • pnpm run test:runtime (712 pass after merging main) and pnpm run check:browser pass; dev/tests/model/test_stills.py passes.
  • 24 of 26 focused browser tests that name the changed parts pass. test_contents_addresses_a_title_group_and_maps_its_complete_box and test_an_open_small_screen_map_reconciles_arriving_meanings fail locally at the merge base's runtime too.
  • leaf-dev stills on 30 states: every pixel difference is a size or weight named above, live data (ports, hashes) or a card's scroll position. A fresh reviewer given only the before/after crops found one regression, the kind word's baseline, fixed above and measured in Chromium (the word's baseline 1px above the title's at the base, level now) and Firefox (the same computed faces).

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

leaf-agent
leaf-agent previously approved these changes Oct 30, 2026

@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.

The focused desktop row-size test passes its behavioral assertions but reports unchanged write: hidden on div.lf-fp-quick at teardown. The same diagnostic reproduces on current main (481e3cc33618e2b373bc1c887fe7e68f7c331dcf); #4745 tracks it.

@max-sixty
max-sixty merged commit 5632929 into main Oct 30, 2026
5 checks passed
@max-sixty
max-sixty deleted the list-ui-fixes branch October 30, 2026 09:21
max-sixty added a commit that referenced this pull request Oct 30, 2026
…ion headings under its title (#4774)

Leaf's interface now sets its words in a closed set of named faces, the
voices (`--voice-*`, `browser/base.css`), and a model-tier test fails
any interface rule that sets a size, weight, line height or family of
its own. Before this, each rule chose its face where it stood, and the
last audit (#4758) found the drift that produces: near-duplicate sizes,
line heights from 1.2 to 1.5 across rules for the same kind of text, and
one-off weights. #4758 put every size on the type ladder; nothing
stopped the next rule from drifting again.

### The voices

Each voice is a whole `font` shorthand: weight, size on the ladder, line
height and family. They are declared with the ladder's other derived
tokens on `:is(:root, .density-working)`, so a working-density block
re-resolves them at its own sizes, as `--tip-font` and
`--lf-key-badge-size` already were.

| Voice | Face | Speaks for |
| --- | --- | --- |
| `--voice-ui` | `--t-5` / 1.45 sans | the chrome: menus, dialogs,
buttons, the default control face |
| `--voice-compact` | `--t-working-label` / 1.45 | the floating panel
and its rows |
| `--voice-small` | `--t-6` / 1.45 | qualifiers: a row's end, a status,
a description, a time |
| `--voice-heading` | 600 `--t-6` / 1.45 | a list's group heading |
| `--voice-title` | 600 `--t-5` / 1.45 | a dialog's title, a pane's
header |
| `--voice-label` | 600 `--t-6` / 1.3 | small capitals (`.lf-label` adds
case and tracking) |
| `--voice-tip` | 500 `--t-6` / 1.2 | a tooltip (was `--tip-font`) |
| `--voice-chip` | `--t-6` / `--chip-lh` | a chip |
| `--voice-count` | 600 `--t-7` / 1 | a number on a mark |
| `--voice-fine` | `--t-7` / 1.25 | a tooltip's second line, a drawing's
status |
| `--voice-code` | `--t-6` / 1.45 mono | an error or source shown
verbatim |
| `--voice-emoji` | 16px / 1 | the reaction palette's emoji |
| `--voice-message`, `--voice-name` | (root only) | a thread's words and
author name (were `--msg-font`, `--lf-msg-name-size`) |

Inside a voice, a run may still take weight 400, 500 or 600 for
emphasis, and a box may set its line height to a length it is laid out
by (a badge's 17px, a field's 22px). Everything else comes from the
voice. Every core interface rule is cut over; bundled package rules that
spelled a voice's exact face name it too.

### The check

`tests/model/test_interface_voices.py` reads every core sheet with
tinycss2 and fails each declaration in a rule that selects an `lf-`
class that sets `font` to anything but a declared voice or `inherit`, or
sets `font-size`, `font-family`, a weight outside 400/500/600, or a
unitless line height other than 0 or 1. The reading theme's prose rules
select no `lf-` class and keep the ladder. One rule is exempt by name:
the native control default in `surfaces.css` states the ui voice's parts
at a class's specificity, because a weight reset at that specificity
once took the pane header's 600 off playground presets (its header says
why). The test runs in the model tier, in under half a second.

### What changes on screen

Line heights settle on their voice's. The visible case is On me's choice
cards: their name and description lines go from 1.3 to 1.45, about 3px
taller a card. Elsewhere the change is under a pixel a line: a thread
quote (1.5 to 1.45), a pane header (1.4 to 1.45), the response bar (1.5
to 1.45, its buttons keep their height since their padding is computed
from the line), the element inspector's tag. The target picker's current
hint goes from 700 to 600, and a key badge inside a tooltip from the
tooltip's 500 to the badge's 400.

**About this page** (#7 of the last closeout): its section headings
("Page details", "Authored CSS", "This tab at opening") were the
browser's h2, 17px bold under a 14px title. Each section is a region of
the dialog, so its heading now wears `.lf-label`, the small capitals
that name a region. What names a single value (a copyable text's label
such as "Leaf version", a list's h3) is small and muted, as a metric's
term already was, and the disclosures ("Selected layer CSS") take the
dialog's ui voice instead of the reading theme's bold `summary`. The
result reads title, then section, then a value's name, then the value. A
heading now stands nearer its content than the text above it, and the
title starts on the report's left edge rather than 4.5px outside it.

### Checks

- `leaf-dev stills` on 65 interface states (panel views, threads,
dialogs, panes, marks, widgets; light and dark): every style difference
is a line height settling on its voice's, the About dialog's headings,
and the target picker's current hint. Its `faces.txt` lists no face the
head draws that the base doesn't; the only faces it retires are About's
17px and 14px bold headings. `thread-choice-hints` and `plan-capture`
time out on both arms.
- A fresh reviewer given only the before/after crops found the first
About pass over-corrected: section headings in the group heading voice
ranked below the 14px field labels under them. The label voice, smaller
field labels and tighter heading spacing above answer that. It judged
the choice cards' extra leading more readable at a cost in height, and
flagged a shorter panel in `ship-answered`, which a recapture showed was
capture noise (0 px).
- Firefox computes the same faces for the About dialog and the panel.
- `pnpm run test:runtime` (708 pass) and `pnpm run check:browser`;
`tests/model/test_interface_voices.py` fails when a rule is set back to
`font-size: 12px; line-height: 1.3`; 41 focused tests on fonts, the
panel's On views, the command reference, drafts and About pass.

> _This was written by Claude Code on behalf of max-sixty_
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