Skip to content

Note at the pin's size rule what a smaller phone pin needs - #5526

Merged
max-sixty merged 1 commit into
mainfrom
grind/4041
Nov 5, 2026
Merged

max-sixty merged 1 commit into
mainfrom
grind/4041

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

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-entry in annotation-theme.css) saying what the change needs.

Why it isn't simple

The seat search in margin-placement.js reads 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.

  • Row as the aim. The attempt gave the face 9px margins, so the row's box was the 44px aim and every seat stayed as on main, plus a ::before reach 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 width leaf-dev pins --base flagged 18 more of its 26 cases as far (more than 12px from the target), 20 in all against 2 on main, and test_each_pin_case_seats_its_pins_by_their_targets_clear_of_what_they_hide[phone] would fail on them.
  • Row as the face. Seating the 26px face lets the 44px aim lie over a neighbouring row or button and take its press, on 9 of 270 sentences in the earlier measurement.

Doing it properly means passing the reach through seatsBy, seatRow, pinSpot, leastCovering, slid and packRow, and through the fold widths in margin-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 --base on 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.
  • A sweep of 13 examples at 390×844 under touch, with a comment on every sentence (up to 25 a page, all at once), read in Chromium: of 176 sentences with a pin on both arms, the face covered a word on 68 on main and 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

  • The sweep in Firefox. The fixture probe showed the same seats and faces there.
  • A real phone.

Part of #4041.

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

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
max-sixty marked this pull request as ready for review November 5, 2026 18:38
@max-sixty
max-sixty merged commit 04c8c71 into main Nov 5, 2026
5 checks passed
@max-sixty
max-sixty deleted the grind/4041 branch November 5, 2026 18:55
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