Repository navigation
Note at the pin's size rule what a smaller phone pin needs - #5526
Merged
Merged
Conversation
Under a finger a comment's pin draws 44px across, its face as large as the aim floor (#1164), and stands over the words beside it. Drawing it at 26px inside a 44px aim, as a button's reach gives one, was the candidate, built only if it stayed simple. It doesn't: the seat search in margin-placement.js reads one box per pin, and the smaller face needs two, the face kept off words and touching its target, and the aim kept off controls and other rows. The CSS-only attempt gave the face 9px margins, so the row's box was the aim, and a reach positioned only under a finger. In Chromium and Firefox at 390x844 it kept every seat, and presses 18px off the face's centre landed on the pin. Across 176 sentences of 13 examples with a comment on each, the face over a word fell from 68 to 41 sentences, 27 better and none worse. But a pin seated outside its target drew 9px further from it, and `leaf-dev pins --base` flagged that as `far` on 18 of its 26 cases at phone width. Seating the row by the 26px face instead lets the aim lie over a neighbour's press, on 9 of 270 sentences in the earlier measurement. So the code stays, and a TODO(#4041) at the rule records what the change needs. Part of #4041. Co-authored-by: Claude Opus 5.5 <[email protected]>
max-sixty
marked this pull request as ready for review
November 5, 2026 18:38
leaf-agent
approved these changes
Nov 5, 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.
Under a finger a comment's pin draws 44px across, its face as large as the aim floor (#1164), and it stands over the words beside it. The candidate was to draw it at 26px, as under a mouse, inside a 44px aim given by a reach, as Leaf's buttons have, and to build it only if that stayed simple. It doesn't, so this PR changes no behaviour: it adds a
TODO(#4041)at the pin's size rule (--margin-entryinannotation-theme.css) saying what the change needs.Why it isn't simple
The seat search in
margin-placement.jsreads one box per pin. The smaller face needs two: the face, kept off words and touching its target, and the aim, kept off controls and other rows. CSS can give a pin one box or the other, and each choice breaks one of those.main, plus a::beforereach positioned only under a finger, so mouse pages keep the unpositioned faces Draw the options' picks, Add, Done and the margin's rows without positioned boxes #5375 gave them. That came to 26 added and 6 removed lines of CSS, comments included. But a pin seated outside its target (above, below or beside it) now draws its face 9px further from it. At phone widthleaf-dev pins --baseflagged 18 more of its 26 cases asfar(more than 12px from the target), 20 in all against 2 onmain, andtest_each_pin_case_seats_its_pins_by_their_targets_clear_of_what_they_hide[phone]would fail on them.Doing it properly means passing the reach through
seatsBy,seatRow,pinSpot,leastCovering,slidandpackRow, and through the fold widths inmargin-layout.js, with runtime tests for each. That is new geometry code in Leaf, which the bar for "simple" excluded. I haven't built it.What the CSS-only attempt measured
leaf-dev probe --viewport phone --baseon a three-paragraph fixture, in Chromium and Firefox: every row kept its seat (49×44 at the same coordinates), the face drew 26×26 centred in it, and presses 18px left, right, above and below the face's centre landed on the pin.mainand 41 with the attempt. 27 got better and none got worse, and no row moved. Because the seat search still avoided words with the 44px box, this falls short of the earlier measurement's 4%, which seated the 26px face.Not verified
Part of #4041.