Skip to content

Report lines whose words split their baseline in stills, and stand eight more on one - #4886

Merged
max-sixty merged 9 commits into
mainfrom
baseline-audit
Nov 1, 2026
Merged

max-sixty merged 9 commits into
mainfrom
baseline-audit

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

Words of two sizes, each centred in a box of its own in a flex row or grid, stand on different baselines, the larger lower: the cause of the message head's split fixed in #4842. leaf-dev stills now measures every line in each state it captures and writes the lines whose words stand a quarter of a CSS pixel or more apart to baselines.txt, under "only head splits", "both arms split" (with each arm's spread) and "only base splits". It reports and fails nothing. Its first run over the catalogue found eight more lines, which now stand on one baseline in Chromium and Firefox.

The fixes

Where Split before (Chromium / Firefox) Fix
The panel row's On me count 0.92 / 0.52px Strut in the field's face
Versions' "Showing" 0.92 / 0.5px Baseline alignment
All pages, a page's title and its agent's activity 0.92 / 0.5px Baseline alignment, row still centred
The leaf's menu, a row's value 0.84 / 0.43px Strut in the menu's face
A trace's saved moment, its name and time 0.55 / 1.0px The number joins the row's baseline
The sort example's legend 0.54 / 1.0px Baseline alignment, radios centred
A worktree's path and its label 1 / 0.5px Baseline alignment; the row grows 1px
A call group's call and its count 1 / 1px Baseline alignment

A strut is a zero-width character in the neighbour's face on a box with line-height: 0, so both words stand on one line in one face. It stays where baseline alignment would move something else: a message head's notice of news, placed outside the head's flow, and the menu's Versions row, which would grow a pixel. test_all_pages_is_a_view_of_the_panel now asserts the All pages row's baseline.

The audit

dev/leaf_dev/commands/stills_baselines.js holds it; its header states which boxes it reads and which words it compares. It never touches the words it measures: a run's baseline is its text box's top plus an ascent read from a copy of the same words in the same face, set in a shadow root outside the page. It compares boxes whose words share a line and stand within eight ems of each other, leaves out words in two cards side by side and words under a fixed or top-layer box, and counts no words on a fill, border or shadow of their own that shows, such as a key's letter on its badge. The eight-em rule also leaves out a split at a row's two ends, as a trace's saved moment had. Reading a state costs up to a tenth of a second.

Review

Codex (gpt-6-astra) reviewed the audit three times. The last review asked whether the work leaves Leaf simpler, and answered that the interface reads better but the code isn't simpler: about 505 lines are developer tooling, and no change higher up (the theme, a shared row, the type scale) lets the per-site fixes go. It recommended keeping the audit report-only and not adding rules to chase each miss. The sort legend's strut was replaced by baseline alignment on its advice, and the audit now ignores transparent borders and shadows, which Leaf keeps on list rows and reaction chips and which had hidden a real split.

Testing

The audit was run over 306 of the 307 stills states in Chromium; thread-choice-hints times out on a loaded machine. Taking out each fix brings its split back, and every fixed line measures 0 in Chromium and Firefox (0.07px for the menu's value in Firefox). dev/tests/model/test_stills.py covers the report, and test_versions_travel_opens_in_the_panel, test_all_pages_is_a_view_of_the_panel and test_call_diff_keeps_the_user_on_a_row_a_new_capture_moves pass.

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

In a thread message's head, the name (13px semibold) stood below the time, the
receipt and a notice of news (11.5px): by 0.5px in Firefox and 0.92px in
Chromium, and by 1.2px at a task seat's 10.5px scale. The head centres each box
of words on its line, and text centred on a line of its own face sits lower the
larger it is.

The name now gives up its own line and holds a strut, a zero-width character in
the head's face, whose line is the name's box. That box is then the same line in
the same face as the time's, both engines round its baseline the same way, and
every word on the head's line shares it. The name rises to the others; nothing
else moves, and the head stays 28px tall. The name's box clips only at its
inline end (`overflow: clip visible`, here and on a held header item), since
the shorter line cut the top pixel of accented capitals. The strut opens only
the first line, so the name keeps to one line and ellipsizes in a head that
wraps, one holding a progress disclosure, where it could wrap to two before.

Rejected: aligning the head's items by baseline, which stands the words at the
top of the 28px head rather than centred on it; and a strut in the metadata on
the name's line, which left the notice of news, centred beside the head, 1 to
1.6px above the rest.

test_a_new_sent_message_does_not_hide_work_on_an_earlier_message also checks
that the name, time and receipt in a margin card's head share a baseline.
…ive more on one

#4842 stood a message head's name on its time's baseline: centred each in its own
box, the 13px name stood 0.92px below the 11.5px time in Chromium, 0.5px in Firefox,
and a reader saw the line step. Any row that centres words of two faces separately
does the same, so `leaf-dev stills` now looks for it in every state it captures.

`stills_baselines.js` reads each item of a flex row or of a grid of more than one
column (a subgrid by its parent's columns), and each box placed out of flow, such as
a notice anchored beside a head, that holds one line of words. A run of words stands
its baseline at its text box's top plus its ascent, read from a sample of the same
words in the same face, set outside the page in a shadow root of its own, so the page's
rules don't restyle the sample and the words measured are never touched. Items whose
words share a line and stand within eight ems of each other read as one run; in the
catalogue, words read together stood three ems apart or less, and words at a row's two
ends, such as the panel's field and its count, thirty or more. Words in a box fixed
over the page share no line with words outside it. The run's `baselines.txt` lists
each run whose baselines stand a quarter of a CSS pixel or more apart, half a device
pixel of the 2x stills: those only the head splits, those both arms split, and those
only the base splits, each line keyed by which of the lines alike in row and words it
is. It reports and fails nothing, and costs 0.1s on the feature gallery.

A layout split is what a reader sees, though the paint rounds it: shifted by tenths of
a pixel, a saved moment's time 0.55px above its name painted a whole pixel above it at
six of ten positions in Chromium, and 1.0px above at every position in Firefox.

Across the 307 catalogue states, the audit found lines that step here, each now on one
baseline in Chromium and Firefox:

- the floating panel's row: the On me count stood above the field's words, 0.92px
  (0.52px in Firefox) beside "Away" at rest and 1.42px beside page search's status
  under a finger. The count takes a strut in the field's font, as the head's name
  takes one in its time's.
- Versions: "Showing" stood 0.92px (0.5px) above the shown version's name. The row
  aligns them by baseline, as `.lf-row` aligns a row's name and end.
- the sort example's inputs: its smaller legend stood 0.54px (1.0px) above its
  choices. The legend takes a strut in their font.

and two the audit leaves out:

- All pages, which no catalogue state reaches, since it lists only while another page
  is live: a page's title stood 0.92px (0.5px) below what its agent is doing. The row
  now aligns them by baseline and centres their line, so the title doesn't move.
  `test_all_pages_is_a_view_of_the_panel` holds them to one baseline.
- a trace's saved moments, whose name and time stand at a row's two ends: the time
  stood 0.55px (1.0px) above the name, against `.lf-row`'s rule that a row's end
  stands on its name's baseline. The moment's number now joins that baseline, so its
  ring, taller than the line, holds the line on its middle; the row keeps its height.
…s in the other

Two notification previews side by side in a playground put a time in one card beside
an app name in the other, and the audit, grouping every item on a line, reported the
pair 3px apart. Words in two rows now share a line only where one row stands inside
the other, as a head's time row in the head, or where one stands in a box placed out
of flow beside the other, as a notice anchored beside a head does.
…her line

Keeping two rows' words apart unless one row stood in the other lost the panel's
count beside page search's status, since the field's words and the count each stand in
a row of their own, and Versions' name and Showing. What sets two cards side by side
apart is that each holds words on other lines. So two runs share a line where no box
between each and the box holding both holds words on another line; a box's height says
nothing, since a field under a finger is 44px tall around one line. On the commit
before #4842 the audit reports the message heads in the floating panel, a margin card
and a task's seat with its notice of news, on main the panel count beside search
(1.42px) and Versions (0.92px), none of them on the branch, and nothing across the
playground's two cards.
…oward a split

The whole catalogue, audited after the last commit, found three more lines that step:

- the leaf's menu: a row's value ("v3" beside Versions) stood 0.84px above its name,
  centred with the keys on the name's line, though the rule above it says the value
  keeps the name's baseline. The value now takes a strut in the menu's font, as the
  On me count takes one in the field's.
- a worktree's path stood 1px above its "Worktree" label: the grid stretched both, and
  the mono and the sans stand their baselines differently. The row aligns them by
  baseline.
- a call group's count ("9 added · 8 removed") stood 1px above the call it counts,
  centred on its own. The call and its count align by baseline.

Each of the three reads 0 on the branch, and its split again with its fix taken out.

It also reported a key's letter on its badge beside its row's name, and a call's name
on its bar beside its lane's, where the eye reads the badge or the bar, not the
letter's baseline. The audit missed those boxes: the badge is a row of its own around
the letter, and the bar holds its name in a child. Words alone in a row now stand on
that row's box, and words on a box are listed and marked but count toward no split.
…t only a box that shows

An independent review of whether the baseline work leaves Leaf simpler found
three changes worth making.

The Rust sort example's legend stood on its choices' baseline through a strut,
a zero-width character in the choices' face. Its row and each choice's label
now align their items by baseline and centre each radio on its label, so the
browser's own alignment does what the strut did. Every box in the row (row,
legend's words, labels, radios, Shuffle) measures where it did with the strut,
in Chromium and Firefox, at 1440 and 390px wide; only the legend's own box is
its own line's height again.

The baseline audit counted words as on a box of their own wherever a box between
them and their item declared a fill, border or shadow, transparent ones
included, and a split on such words counts toward nothing. Leaf keeps
transparent borders on list rows and buttons, so a real split in them would have
gone unreported: with the sort legend split again and given a transparent
border or shadow, the old rule reported nothing and the new one reports the
0.55px (Chromium) / 1px (Firefox). A border that shows still counts as a box.
Across 306 of the 307 stills states the two rules report the same lines.

baselines.txt now gives a line both arms split as base -> head, so a split that
grows from 0.3px to 3px shows it.

The audit's header now says what the eight-em rule costs: it also leaves out a
split a reader may see between words at a row's two ends, as a trace's saved
moment had.
@max-sixty
max-sixty merged commit 4405581 into main Nov 1, 2026
4 checks passed
@max-sixty
max-sixty deleted the baseline-audit branch November 1, 2026 05:49
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