Skip to content

Seat a pin beside its target only where no other block stands - #3889

Merged
max-sixty merged 4 commits into
mainfrom
grind/s-pin-seat
Oct 27, 2026
Merged

max-sixty merged 4 commits into
mainfrom
grind/s-pin-seat

Conversation

@max-sixty

@max-sixty max-sixty commented Oct 25, 2026 •

Copy link
Copy Markdown
Owner

After a card moves between board columns, its "Sent" pin now stands on the moved card, down its right edge below the grip. Before, it stood in the gap between columns, over the next column's card.

Cause. A pin's first seat is just outside its target's top-right corner. That seat only had to stay clear of words, controls and media (coverIn's cover); a neighbouring block's own box wasn't checked. On triage-board the gap between columns is 8px, and a card's text starts about 35px past the moved card's edge. The 31px pin cleared the words but stood 11px into the next column's card (card-export), so it read as that card's. The same happened to a suggestion's pin inside a board card: on the test_suggestions board at 820px, sug-in-card's pin stood 26px into the "Done" column.

Change.

  • coverIn (browser/runtime/annotation-overlay/margin-layout.js) now also answers beside(rect). It is true when a shown box stands there that isn't the target, doesn't hold it, isn't held by it, and isn't display: inline. Inline boxes are left out because they span the empty ends of their lines, and their words are already cover.
  • seatsBy offers its two outside seats only where beside is false for the seat's span level with the part it stands by. That part is the subject's box for the corner seat and the last line for the seat after the last word.
    • The span is clipped because a seat is as tall as the pin (44px) while a line is about 27px. The overhang would otherwise refuse a seat whenever the next block starts just below the line, though a pin there still reads as the line's.
    • A neighbour beside the target, as the next board column is, still refuses the seat. The rule therefore holds for board columns, tiles, grid cells, workspace panes and a sidebar's aside alike.
  • A seat that isn't offered is null, so corner still indexes the inside seat. seatRows already let pinSpot skip a null seat. leastCovering now skips one too, and a folded pin reads its width from the corner seat instead of seats[0].
  • seatsBy moves to margin-placement.js beside seatRows. Given its rects and a beside predicate, it answers from its arguments alone, so tests/runtime covers it.
  • The walk only stores each element's rect. Style, containment, visibility and clipping are read only for a box a seat meets.

Evidence.

  • Board probe: uv run leaf-dev probe triage-board --do drive:card-grabbed --do press:Enter at 1440×900, reading the pin and card rects.
    • Before: the pin was at x 262–293, y 326–352, over card-export (x 282–474).
    • After: it is at x 223–254, y 363–389, on the moved card card-tz (x 66–258).
  • Phone (390×844, touch):
    • A board card moved by its "Move to" button has its pin at x 281–330 on both base and head.
    • release-notes' rn-sug-dry suggestion pin is at (282,632)–(379,676) on both base and head: two controls after its last word.
    • Phone pin placement is unchanged, including the open "pin covers words at a line's end on a phone" decision in notes/agent-usability-evals.md.
  • leaf-dev pins --base:
    • It gains a board case (a real lf-board) and a beside fault: a pin over another block level with its target.
    • The base shows beside (board-now-0) at desktop; head shows no faults.
    • The board desktop crop is the only one that changed.
    • tests/browser/margin/test_pins.py asserts the gallery, so it now fails on the old rule.
  • leaf-dev stills ran on 20 pin-bearing states:
    • It includes release-draft-phone, the new triage-moved (keyboard move, desktop) and triage-moved-touch (destination button, phone).
    • triage-moved changes as above. triage-moved-touch and release-draft-phone are unchanged.
    • margin-gallery-phone differs only in the panel's status text ("Codex away" vs "14 agent messages"), which is timing.
    • retained-quote-touch differs because its driver's if full.count(): full.click() races. The "Full quote" disclosure was open in base and closed in head on one run, and the other way round on the next.
  • tests/runtime/margin-placement.test.mjs adds two cases:
    • seatsBy with a block 15px under the last line (seat kept) and a block level with the words (both outside seats null). Without the clip, the overhang assertion fails.
    • seatRows passing over null seats at either size. This fails on main's seatRows with a TypeError.

Tests run.

  • pnpm run test:runtime: 551 pass.
  • tests/browser/margin/test_pins.py, test_clusters.py, test_card_placement.py, tests/browser/test_render_send_placement.py, tests/browser/widgets/test_suggestions.py: 103 pass, 2 fail.
  • 19 whole files that read .lf-margin-cluster or data-lf-place: 702 pass, 3 fail. They are:
    • the other margin files;
    • boards, outbox, thread layout;
    • workspaces, panes;
    • drawing, anchors, aim, reactions;
    • suggestions, press-away, code review;
    • chrome contracts, semantic selection.
  • The failures are test_suggestion_controls_stay_out_of_the_column (both motion settings) and test_workspace_root_scrollbar_appears_only_when_page_overflows. All three also fail on the merge base's margin runtime, so this change doesn't cause them.
    • The suggestion test counts sug-refill's pin as covering words at 820px on both base and head. Its word reading includes a text box at x 627–765 that the runtime's cover doesn't see.
    • sug-in-card's pin covers no words on head.
    • Main has since moved the suggestion test onto the render gate's word reading (Run every tier on macOS nightly, and fix the tests main and macOS fail #3939), which leaves out that box.
  • The merge with main rebuilds dist/kernel/ from the merged runtime; pnpm run test:runtime (670 pass), test_pins.py and test_clusters.py pass on it.

Not verified.

  • Firefox.
  • The journeys and nightly render tiers.
  • The layout pass's cost on a long page. The walk adds one small object per element in the band and no new style reads unless a seat meets a box.

Calls Max may reverse.

  • beside counts any non-inline box level with the target, including an unpainted wrapper.
  • The rule applies to the after-last-word seat as well as the corner seat. Above and below are unchanged: below already requires its row to be clear of words.

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

max-sixty and others added 3 commits October 24, 2026 21:33
After a card moved between board columns, its "Sent" pin stood in the 8px gap
between columns and 11px into the next column's card, so it read as that card's.
A pin's first seat, just outside its target's top-right corner, had to clear
only words, controls and media, not a neighbouring block's box.

coverIn now answers beside(seat): whether a shown box that is not the target's,
does not hold it and is not display: inline stands there. seatsBy offers its two
outside seats (beside the corner, after a run's last word) only where none does,
and leaves a null in their place so `corner` keeps indexing the inside seat.
seatRows's leastCovering skips a null seat, and a folded pin reads its width
from the corner seat. The rule holds for board columns, tiles, grid cells and
panes alike.

triage-board, 1440x900, keyboard move: the pin went from x 262-293 (over
card-export) to x 223-254 on the moved card. Phone placement is unchanged (390
wide, destination move: x 281-330 on both). `leaf-dev pins` gains a `board`
case and a `beside` fault, which the base shows and this tree doesn't; stills
gain triage-moved and triage-moved-touch.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…rhang

A seat beside a run of words is as tall as the pin (44px), while a line is
about 27px, so the seat overhangs the block below. beside() refused the seat
whenever that block started inside the overhang: on release-notes at 390x844
touch, the rn-sug-dry suggestion lost its seat after its last word and folded
to one toggle over the next paragraph, so accepting or rejecting took an extra
press.

seatsBy now asks beside() only about the seat's span level with the part it
stands by (the subject's box for the corner seat, the last line for the seat
after the last word). A neighbour beside the target, as the next board column
is, still refuses it; a block below no longer does.

seatsBy moves to margin-placement.js beside seatRows. Given its rects and a
`beside` predicate it answers from its arguments alone, so tests/runtime now
covers the overhang, the neighbour, and the null seat that keeps `corner`'s
index.

rn-sug-dry is back at (282,632)-(379,676), as on main. Stills on
release-draft-phone and 19 other pin-bearing states: only triage-moved changes.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
stills keeps both this branch's triage-moved states and main's walkthrough-wide.
The kernel is rebuilt from the merged runtime.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@max-sixty
max-sixty marked this pull request as ready for review October 27, 2026 05:30
stills keeps both this branch's triage-moved states and main's walkthrough
state. The kernel is rebuilt from the merged runtime.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@max-sixty
max-sixty merged commit 25a31bd into main Oct 27, 2026
4 of 5 checks passed
@max-sixty
max-sixty deleted the grind/s-pin-seat branch October 27, 2026 06:21
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