Repository navigation
Make every one-line control its place's line, and meet the touch floor with a reach - #3738
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]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Its general rule anchors Copy over a code block with fallbacks of -9999px, which a relatively positioned box applies as an offset. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…and the aim sweeps press the reach Review of the prototype found reaches lying over neighbouring presses and fields, and clipped ones that the size-reading aim sweep passed. The sweeps now press each end of a reach and each edge of a face; they also catch two overlaps in the panel that predate the prototype (the thread's crumb and a view's icon buttons against the row's presses). Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…e aim sweep A notice of held news took the floor as a taller face, so it grew the margin card's controls row when it arrived. The sweep now counts a sibling's face lying over a control's edge, and a reach lying over a field it doesn't belong to. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The reach's two selector lists become one, with the pseudo nested, so a control joins the reach in one place. Its own ::after rules (a line comment's none, Discard and Save's upward reach) now outrank it at any weight. The line and reach comments each say their part once, without the history the commit log keeps. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
reviewed
Oct 23, 2026
leaf-agent
left a comment
Collaborator
There was a problem hiding this comment.
Code Copy's new touch reach does not activate Copy. wa-copy-button runs its copy handler on the shadow .copy-button__trigger; a pointer landing on the host's ::after reaches only the host. I verified this with a Chromium pointer press against a shadow-button control: the host reach left the handler untouched, while a reach on the shadow button fired it. The aim sweep also counts the host hit as a success, so it cannot catch this. Move the reach to ::part(button) and have the sweep measure that actionable target.
…im sweep Web Awesome's copy button copies on its shadow button's press. A reach on the host stood over that button and took every press, so Copy copied nothing, on its face or beside it. The reach is the button part's now, and the draft toolbar's Copy is static again. The aim sweep measures and presses a control's button part where it has one, and fails a host that takes the press at the button's middle. A test presses a draft's Copy just past its face under a finger; it fails with the reach on the host. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
previously approved these changes
Oct 23, 2026
Main's rewrite-in-place (#3737) and the thread walk's aside (#3733) read the old sizes; they read the line now. The aside shares the drafting rule's Send room, so the two can't drift. Discard and Save, positioned relatively to hold their reach, clear the message control's anchored offsets, which had lifted them 6px and cut Save's focus ring. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
approved these changes
Oct 23, 2026
max-sixty
added a commit
that referenced
this pull request
Oct 23, 2026
…ad's line (#3748) #3738 gave message controls (a message's Edit, its reaction trigger, Discard and Save) a 26px face that meets the 44px touch floor with a reach. But they are also offers (`data-lf-offer="button"`), and the offer floor's `min-height: var(--aim-floor)` still stood the Edit control and the reaction trigger at 44px under a finger. In a message head now 28px tall, the reaction trigger's face covered two lines of the message's words, so `test_a_message_reaction_trigger_meets_its_header_and_covers_no_words[360-True]` is red on main (browser tier, which a PR doesn't run). - **Fix** (`browser/styles/components/surfaces.css`): message controls leave the offer floor, as `.lf-btn` already does, and meet the floor by their reach. The test now reads the trigger's aim (face or reach) instead of its face height. - **Aim sweep** (`tests/page_scripts/aims.js`): with the trigger's reach live, the sweep flagged two things that aren't defects, so it now judges them the way a press resolves. - A reach "over a field" counted any field stacked anywhere under the point, including a page field the panel covers. It now asks what would take the press without the reach, which is the first box beneath the control. - An open popover or dialog, like the chrome over the page, now takes the presses it stands over. The reaction palette, open over the panel's buttons, had read as a control lying over them. Checked: the reaction tests and the offered-controls sweep under both pointers pass. `test_suggestion_picker_preserves_the_comment_draft` and `test_reactions_keep_all_six_buttons_on_an_occupied_target[390-keyboard]` fail on main as well; the first is flaky there (1 of 2 runs). The corpus gate's aim findings are unchanged at 166 under a finger, all the diff's line-comment presses plus a film line and a feed refresh, which also fail on main. > _This was written by Claude Code on behalf of max-sixty_ Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
added a commit
that referenced
this pull request
Oct 23, 2026
The screenshot control test now checks the touch target through the control's effective hit area. PR #3738 made one-line controls as tall as their line and supplies the 44 px touch floor with an unpainted reach. The test still required a 44 px visible face, so it failed on a 34 px button despite the button's working touch target. The revised test checks hit detection at the upper and lower ends of that reach and keeps its checks for control spacing, caption text, and image interactions. `test_shot_controls_have_disjoint_targets_and_labels_stay_passive[True]` failed on [main run 39951924125](https://github.com/max-sixty/leaf/actions/runs/39951924125) and reproduced on current `main`. Both mouse and touch cases pass after this change. Refs #3695. The separate tab panel write error from that run is addressed in #3758. --------- Co-authored-by: leaf-agent <[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.
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::afterbox 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
browser/styles/theme.css):--lf-linereplaces--lf-fp-line,--lf-control-compactand the.lf-compact-controlclass. 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-codedmax(Npx, var(--aim-floor))heights are gone, and so are Keep the floating panel's row one line tall whatever its field holds #3710's per-seat panel overrides.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.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 shadowbuttonpart 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
Limits
--lf-reach-roomresolves at the root, so a place that sets its own line doesn't move it.buttonstyling 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-linerename, and the rest is the reach rule and its tokens.aims.jsand 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.