Repository navigation
Leave a centred row's baseline gap: drop the two struts and the stills baseline audit - #6650
Merged
Merged
Conversation
The name in a thread message's head took its line box from a zero-width strut in the time's face (`line-height: 0` and a `\200b` ::before), so its baseline met the time's to a hundredth of a pixel. Without it the flex row centres the 13px name on its own line, which stands its baseline 0.92px lower than the 11.5px time's in Chromium, 0.5px in Firefox and 0.58px in WebKit (standalone head, Playwright Chromium 159.0.8154.6, Firefox 159.0, WebKit 27.2, 2026-11-20) -- the offset #4842 measured before adding the strut. That half pixel isn't worth a strut, a line box shorter than its glyphs, and the `overflow: clip visible` the short line forced on the name and on a held header item so accented capitals kept their tops. Both go back to `overflow: hidden`; `white-space: nowrap` still keeps the name to one line. The baseline assertion in test_a_new_sent_message_does_not_hide_work_on_an_earlier_message goes with the strut, since the behaviour it protected is the one removed. This reverses #4842, which Claude Code wrote on Max's behalf to close the sub-pixel gap; no request for that alignment is recorded.
…ts strut A row's value in the leaf's menu (a version, a time, a count) took its line box from a zero-width strut in the row's face, so its baseline met the row name's. #4886 added it to close a 0.84px split in Chromium and 0.43px in Firefox. Without it the value stands centred with its keys and symbols on the name's first line, as they already do, a fraction of a pixel high. It was the last strut of its kind: the On me count's went with that chip, and the message head's name lost its own in the previous commit. The `.lf-fp-copy-item` host's `font-size: 0; line-height: 0` stays, since it removes the host's own empty line rather than aligning words.
… baselines `leaf-dev stills` read every line in each captured state for words standing a quarter of a CSS pixel or more off one baseline and listed them in `baselines.txt` (#4886). Leaf no longer closes such a gap with a strut: it lines words up where layout's own means do (baseline alignment, a shared face) and lets a smaller split stand, so a report of every sub-pixel split asks for work Leaf has decided not to do. The audit's 365-line browser script, its plumbing in stills.py, its model test and its eslint entry go. The baseline assertion in test_all_pages_is_a_view_of_the_panel goes too. It held the All pages row's title and activity within 0.1px; the row keeps the `align-items: baseline` #4886 gave it, which costs nothing, but a sub-pixel guard on it is no longer a promise Leaf makes. The choice test in test_theme_and_device.py keeps its 0.5px baseline check, which guards a choice taking its baseline from its mark rather than a sub-pixel gap.
browser/AGENTS.md, "Layouts, styles and controls", now says a row whose words must share a baseline aligns its items by baseline or sets them in one face, and that a centred row of two type sizes keeps its sub-pixel baseline gap rather than closing it with a strut, a short line box or an offset. Max chose this after the previous commits removed the two struts and the stills audit. The message head's header names the rejected alternative agents reach for: baseline alignment with `flex-wrap: wrap` and `align-content: center` keeps the words centred and their baselines exact, but at 110px a Firefox head wraps the time below the name (leaf-dev probe, floating-thread state, 2026-11-20). A scratch A/B (claude -p, Opus, 3 runs an arm) gave each arm the section with or without the rule. On the message head with its constraints stated, all 3 runs with the rule shipped it unchanged; all 3 without it moved the head to baseline alignment with a 28px line box on the name. On a new card header and on a 4px gap, both arms aligned by baseline every run.
…aying under a pixel Codex measured the message head's gap at 1.64px in Chromium with a 20px root font, so 'up to a pixel' was no bound. The rule and the two headers now say the gap is a fraction of the difference in the words' sizes. Rerun of the with-rule arm on this wording: on the message head 2 of 3 runs shipped it unchanged and 1 moved it to a one-row grid aligned by baseline, none added a strut or offset; on a 4px gap from flex-start, 3 of 3 aligned by baseline.
leaf-agent
approved these changes
Nov 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Leaf no longer closes the small baseline gap that centring words of two sizes leaves. Two struts did: a zero-width character with
line-height: 0beside a message head's name, and one beside a leaf menu row's value. They go, with theleaf-dev stillsbaseline audit that reported every split of a quarter pixel (a 365-line browser script and its plumbing) and the test assertions that held those baselines to a tenth of a pixel. Without the struts the name stands 0.92px lower than the time in Chromium and 0.5px in Firefox at the default size, and the menu value a similar fraction higher than its name. The name's box goes back tooverflow: hidden; accented capitals and descenders still show whole.browser/AGENTS.md, "Layouts, styles and controls", now states the rule: words share a baseline by baseline alignment or a shared face, and a centred row keeps its gap rather than gaining a strut, a short line box or an offset. The message head's header names the layout-only alternative agents reach for (baseline alignment withflex-wrap: wrapandalign-content: center) and why it fails: a narrow head wraps the time below the name. In a scratch A/B, agents given the message head without the rule changed its layout in 3 of 3 runs; with it, 2 of 3 left it alone and none added a strut.Max asked for this after #6634's scan found the struts were precision nobody had asked for. Codex reviewed the branch; its one finding, that the gap isn't bounded by a pixel (1.64px at a 20px root font), is fixed.
Tests:
pnpm run check, pre-commit, the stills model tests, the composing test that held the head's baselines, and Firefox stills and probes of the message head and leaf menu.