Repository navigation
Keep the floating panel's row one line tall whatever its field holds - #3710
Merged
Merged
Conversation
Page search stood the row 6px taller than the comment field it replaces under a mouse, and 10px taller under a finger; the comment box seated in the row on a page that draws its own annotations stood it 10px taller under a finger. Each part sized itself: page search's WebAwesome input kept the vendor's control height, 38px at its type; its match steps kept the icon action's hit box, the 44px pointer floor; and the seated box kept its resting height, also the floor. Each now takes the row's line through its own sizing token: `--wa-form-control-height` on the row, and `--lf-icon-action-hit` and `--lf-response-height` set on the step buttons and the seated box. The steps reach the pointer floor above and below as the row's other presses do, and the seated box's Send keeps its floor-sized box in the row's padding. The shift watch passed the change because the row grew at its top edge with every word and control standing on its foot, and the page-search test only asked that the query stand inside the row, which a grown row always satisfies. The new tests compare the row with the line the theme reserves for it while page search, Threads' search, a thread's reply and the seated comment box take the field's place, under a mouse and a finger. `browser/AGENTS.md` states the rule this case belongs to, "What takes turns in a place doesn't size it": the place sets the box and only content grows it. `/ui-sweep` drives each mode of such a place and compares its box with that token. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
approved these changes
Oct 23, 2026
This was referenced Oct 23, 2026
max-sixty
added a commit
that referenced
this pull request
Oct 23, 2026
The floating panel decided what each of its views is by comparing the
route's name at each site that needed to know: about 60 `view ===
"thread"` / `"threads"` / `"queue"` / `"versions"` branches, with the
sizing rule ("a thread's view follows its messages; a list fits what its
tab shows and holds that") restated at five of them and in the prose
above each. A new view had to find and join every one of those branches,
the way a new seated component had to join the CSS exclusion list #3710
fixed.
Now `VIEWS` in `browser/runtime/floating-panel.js` is the one table of
what each route is: its key, its title (and heading, and whether its
tabs already name it), what it draws and what stands at its foot, what
Leaf's reader draws into it (`nominate`), whether it is a menu list or a
view over the row and which menu row opens it, the rows the arrows walk,
the lists it opens over, and which mark it presses. Every former branch
reads the table, and `routeKey`, `titleOf`, `pathTo`, the view switch,
the menu's list ternary, `LIST_ROWS`, `LISTS`, `OWN_VIEWS` and
`levelRow` are gone or derived from it.
The sizing rule turned out not to be an independent per-view fact: a
view follows its content exactly when it is a thread's view, the one
Leaf's reader draws a transcript into. So the table states it once: a
route that names a `thread` is that thread's view and follows its
messages; every other view fits what it shows and holds that. The sizing
sites (`holdThread`, `pressAt`, the rewrite hold, `holdRoom`,
`fitAnswer`, `data-lf-rises`) all read the route's `thread`, rather than
half of them reading a flag and half the route.
Two smaller idioms collapse with it:
- "the thread this route shows" is `threadOf(route)` wherever it was
spelled out as `top?.view === "thread" ? threadByKey(top.thread) :
null`.
- "is this view standing" was written four ways across the go-to doors,
Versions' keys and On's and Threads' own code; it is now
`showing(route)`, for menu lists and views alike.
`controlsTemplate` keeps the shared foot (the way back, what stands in
its row, then the view's presses), and each view's own presses moved
into `threadsControls`, `queueControls` and `threadControls`, which the
table names. Threads' search lasts while Threads stands in the trail,
which is what the old "not threads and not thread" exception meant.
Behaviour that belongs to one view and that no other would declare (On's
card seats and walk landing, Threads' resolve landing and its `/` key)
still names its view, through `showing`. The DOM attributes tests and
CSS read (`data-view`, `data-open`, `data-level`, `data-lf-rises`) are
unchanged, and the kernel is rebuilt.
No behaviour change is intended. `pnpm run test:runtime` passes, and so
do 25 focused tests in `tests/browser/test_render_floating_panel.py`
covering threads and their filters and search, a thread's sizing, answer
growth and press holds, unread replies, On, Versions, the menu's lists
and errors, About's copy fallback, the go-to doors, All pages, a
sample's threads and a conversation reader arriving later.
> _This was written by Claude Code on behalf of max-sixty_
---------
Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
max-sixty
added a commit
that referenced
this pull request
Oct 23, 2026
…r with a reach (#3738) Every one-line control is now as tall as its place's line, `--lf-line` (32px, 34px under a finger), and a control shorter than the 44px touch floor meets it with a reach: an unpainted `::after` box that takes the press, instead of a taller face. A finger's floor therefore grows no row, toolbar or field, which is the cause behind #3710 (page search standing the panel row taller than the comment field it replaced) and the Reopen-grows-the-card case found while building this. ## What changed - **The line** (`browser/styles/theme.css`): `--lf-line` replaces `--lf-fp-line`, `--lf-control-compact` and the `.lf-compact-control` class. Buttons, WebAwesome controls (`--wa-form-control-height`), text fields, the comment box, code copy, the video bar, motion and trace toolbars, and shot labels all read it in their own rule, so a place that sets it sets it for everything it seats (the margin card's controls row sets 28px). About a dozen hard-coded `max(Npx, var(--aim-floor))` heights are gone, and so are #3710's per-seat panel overrides. - **The reach** (`browser/styles/components/surfaces.css`): one rule gives `.lf-btn`, `.button`, icon actions, message and thread controls, thread notices, draft actions and corner marks a reach; Copy, whose press is its shadow button, hangs the same reach on `::part(button)`. It replaces three hand-written copies (corner mark, two in the draft toolbar). Where something else takes presses beside a control, a place keeps `--lf-reach-room`; rows stacked with no gap (closed diff files, a choice group's Done) keep a floor-tall face; a diff line's comment press has no reach since lines stack. - **The aim sweep** (`tests/page_scripts/aims.js`): it used to read only computed sizes, so it could not see a reach cut short or lying over a neighbour. It now presses both ends of every reach and each face edge of on-screen controls, fails a reach that lands on an ancestor, another control or a field, and names what the press hit. It presses a control's shadow `button` part where it has one, since a press that stops at the host runs nothing. It caught two panel overlaps that predate this change (the thread's back crumb against the leaf, a view's icon buttons against chips); both are fixed. - `browser/AGENTS.md`, "Stability", states the line and reach. ## What a user sees - Under a finger, controls are denser and line up: a sent comment's card goes from 288px to 246px and message heads from 44px to 28px, with the same 44px target. - Under a mouse, buttons grow 2–4px to the 32px line, and WebAwesome inputs shrink from their own 38px to 32px. ## Limits - Native fields, pickers and ranges can't host a pseudo-element reach, so under a finger they stand at the 34px line. - The sweep presses only controls in the window. - `--lf-reach-room` resolves at the root, so a place that sets its own line doesn't move it. - The panel's bare-`button` styling keeps its own vertical reach; the follow-up that replaces that bare-tag styling will move panel presses onto the shared rule. ## Size 27 files, +402/−255. Authored CSS is +158/−131: about 35 of those lines are the `--lf-fp-line` rename, and the rest is the reach rule and its tokens. `aims.js` and the options test are +155/−16. The remainder is regenerated sheets. ## Testing The aim gates (`test_render_gate`, `test_every_control_the_layer_offers_is_a_box_the_user_can_hit`), the floating panel's row-line tests, options, widget first paints, `tests/model`, and about 350 touch, coarse-pointer, phone and panel browser tests pass. Six browser tests fail identically on main. > _This was written by Claude Code on behalf of max-sixty_ --------- Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
This was referenced Oct 23, 2026
max-sixty
added a commit
that referenced
this pull request
Oct 23, 2026
The floating panel gave its face to every bare `button`, `input` and
`textarea` under it (`@layer lf-base { @scope (.lf-floating-panel) to
(.lf-fp-outlet, .lf-fp-response, .lf-composer-media, .lf-corner-mark)
}`), and a second exception, `button:where(:not(.lf-fp-editors *))`,
kept its own vertical reach off the editors. So every component the
panel seated wore the face until it joined the exclusion list: the
comment recorded three leaks (a chosen reaction's fill, the shelf's ×,
the seated box's Send), and the review of this change found a fourth
that the list still missed, a thread's held-news notice washing on
hover, which its own rule says it declines. It was the same shape as the
CSS #3710 fixed.
Now the panel's own controls opt in. `lf-fp-face` is on every control
the panel's templates and builders draw (`floating-panel.js`): the leaf,
the row's marks and presses, the menu's rows and lists, the views' rows,
tabs, back, search, Resolve, Next unread, On the page, New reply, On's
answers and presses, Full quote, the page editor's Send, the copy text
and the menu's links. The exclusion list and the editors exception are
gone, so a component the panel seats brings its own face and nothing
else. The rules keep their old specificity (`button:where(.lf-fp-face)`
for `button`, and so on) and their layer.
The panel's reach was a second copy of the shared reach #3738 added in
`browser/styles/components/surfaces.css`, kept only because it was
vertical-only. `button.lf-fp-face` joins that list and the copy goes.
Vertical-only did not need to stay: the shared rule reaches sideways
only where a face is narrower than the floor, and the panel's presses
are floor-wide, which a computed-style snapshot under a coarse pointer
confirms (no `::after` inset changed on any panel control). The one
exception the review found, an On answer as short as "A", now stands as
wide as the floor (`min-width: var(--aim-floor)`), so its reach lies
over no answer beside it; that is the one visible change, under a
finger, for answers shorter than the floor.
Checked with a computed-style snapshot of every control in the panel
(font, colour, background, border, radius, padding, height, cursor,
wrapping, position and the reach's insets) across rest, the menu and
each of its lists, Threads and its search, a thread and its drafted
reply, On, a page draft and page search, on two examples at desktop and
under `--touch`, comparing this change with its parent: the only
differences are seated icon-only buttons (the reply box's Send and
Dictate, page search's steps) no longer taking `white-space: nowrap`,
which draws nothing. `tests/journeys/test_render_controls.py -k
every_control_the_layer_offers --run-nightly`, the panel's row tests
(`-k keeps_its_line`) and 35 focused panel tests pass.
Drift: the shared reach is in the page's vendored stylesheet, so a page
vendored before this change has no reach on the panel's presses until it
is re-vendored (root `AGENTS.md`, "Pages across Leaf updates"); under a
finger the row's 34px presses then fall short of the 44px floor.
> _This was written by Claude Code on behalf of max-sixty_
---------
Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
max-sixty
added a commit
that referenced
this pull request
Oct 23, 2026
The browser fixture now fails a test when a flex row's height changes as one occupant gives way to another. That was the pattern of #3710, where page search stood the floating panel's row taller than the comment field it replaced, and of the margin card's Reopen growing its controls row. The shift watch passed both: a row standing on its foot rises at its top while every word and control in it stays put. On a sample of 1,086 browser tests the check fired 9 times in 8 tests, all on one real defect, which this PR fixes. ## The watch `tests/swap_watch.js` runs on every page the fixture opens, in every engine, beside the words watch. - **A swap** is a frame in which a box stays on the page while one child stops drawing a box and another starts: removed and inserted, moved in, hidden and shown. One ResizeObserver on every element supplies each element's last painted size; a MutationObserver supplies arrivals and departures. - **What fails:** a flex row whose height changes in a swap the way its tallest occupant's did, that occupant being the row's tallest child on its side of the swap, where the change reaches the box holding the row, and the taller occupant isn't taller for its content (words in a field that grows with them, or growth while it stood). - **Before the frame:** a test's next key or press often comes before the browser paints what the last one changed. A trusted `keydown` or `pointerdown` first judges what changed since the last frame, as the page then lays it out. Without this, page search opened and closed between two frames, and the #3710 regression passed. - It skips the page before it presents, a hidden-tab return and a window resize, each until two frames after, as the shift watch does. ## Measurements The sample was two-thirds of the 1,629 tests in `margin/`, `threads/`, `controls/`, `widgets/`, `drafts/`, `navigation/`, `projection/` and the floating panel, options, reactions and commands modules, run before merging #3738: | Rule | Firings | Tests | Real defects | |---|---|---|---| | Any place, any axis | 678 | 336 | mostly views, lists and cards growing with what they show | | Flex lines across their line, with the occupant and container readings | 19 | — | 8 were the defect; 8 were columns (cards, lists taking their words' width); 3 were drafts whose words sized the field | | As landed | 9 | 8 | all 9: the defect below | - **Precision:** 9 of 9 firings, on one defect (n = 9, so the rate is coarse). - **Recall:** the watch fails `test_whatever_the_field_holds_the_row_keeps_its_line` under a mouse and a finger when page search's WebAwesome box gets its vendor height back. That is #3710's cause, re-created on the merged tree by dropping `--wa-form-control-height`. On `main` before #3738, Reopen and Resolve were both 28px, so the Reopen case had no height change to catch. A swap a renderer spreads over two frames is missed. - **Cost:** a median of 11ms of the watch's own script per test (p90 27ms, max 219ms), measured in-page on the second sample. Rerunning the sample's failures with the watch off gave the same failures, so none of them came from the watch. ## The defect it found Under a finger, the Threads list's filter tabs stood at the 44px floor. The panel's controls row was therefore 52px in the list and 42px in a thread (47px and 40px before #3738). The tabs now stand 26px tall, as under a mouse, and reach the floor through the panel's unpainted reach. The strip keeps the reach's room inside its scroll box, so nothing clips it, and takes none in the row. Both views now show a 42px controls row, and the aim sweep finds no short aim in the Threads list under a finger. ## Known limits - A class on the root or the body, which the runtime sets as the pointer moves, is judged at the next frame rather than before a press, so a swap it drives and a test undoes before that frame is missed. - Observing every element has one side effect a page can see. A page's own ResizeObserver callback that resizes an element shallower than its target makes the browser report a loop error, which fails the test. Leaf's runtime defers such writes (`rendering.js`), and none of the roughly 1,400 test runs in this work hit one. - Reviewer suggestion, not built: since #3738, a one-line control's face should be its place's `--lf-line`. A sweep asserting that per control, in each mode, would catch control-height cases without a test having to swap them. It would not catch a composite occupant such as page search's surface, which this watch does. ## Checks - `tests/browser/test_render_swap_watch.py`: a growing occupant fails when replaced, moved in, shown, swapped across two tasks in one frame, or swapped inside a declarative shadow tree. These pass: a filling occupant, one its own words grew, a swap the same press undoes before any frame, a row that loses its tallest item while a sibling moves within it, and a row a neighbouring field grows in the same press, in light DOM or a shadow tree. Each passing case was checked to fail with its mechanism removed. - An independent review found a throw on `document.open()`, missed moved-in occupants, a false firing on reorders and on a press's own mouse events, and a 22-36ms cost per press when the runtime set a body class; all are fixed and re-reviewed. The auto-reviewer's findings (a neighbour sizing the row, a shadow host's children, declarative shadow roots) are fixed too. - The floating panel and aim tests above, `test_every_control_the_layer_offers_is_a_box_the_user_can_hit` (both pointers), the shift watch's document-replacement test and `tests/model` pass. - Inherited failures, which the sample also showed with the watch off: `test_composer_return_edits_or_sends_according_to_its_keyboard[android]`, `test_align_current_item_from_the_menu_on_touch_reserves_z`, `test_shot_controls_have_disjoint_targets_and_labels_stay_passive[True]`. > _This was written by Claude Code on behalf of max-sixty_ --------- Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
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.
Pressing
/for page search made the floating panel's row taller than the comment field it replaces: 44px → 50px under a mouse, 48px → 58px under a finger. The comment box seated in the row on a page that draws its own annotations did the same under a finger (48px → 58px). The row stands everything on its foot, so it grew to its tallest occupant, and three occupants sized themselves:Each now takes the row's line through its own sizing token:
--wa-form-control-heighton the row,--lf-icon-action-hiton the steps and--lf-response-heighton the seated box (browser/styles/floating-panel.css). The steps reach the 44px floor above and below through the row's unpainted reach, as its other presses do; the seated box's Send keeps its floor-sized box in the row's padding. WebAwesome's clear × scales with the control height, so it is slightly smaller.Why nothing caught it. The shift watch passed it because the row grew at its top edge while every word and control stayed put, and the page-search test only asked that the query stand inside the row, which a grown row always satisfies. The new tests compare the row's height with the line the theme reserves for it while page search, Threads' search, a thread's reply and the seated comment box take the field's place, under a mouse and a finger; they fail on main at 50px and 58px.
The rule.
browser/AGENTS.md, "Stability", now states the class this belongs to, "What takes turns in a place doesn't size it": the place sets the box from a theme token, each occupant fills it, and only content grows it.data-roomandkeeps-first-boxare earlier cases of it./ui-sweepnow drives each mode of such a place while it is empty and compares its box with that token.