Skip to content

Seat a comment pin by its target, over it where nothing beside it is clear - #2795

Merged
max-sixty merged 8 commits into
mainfrom
diagnose-oversized-shot-page
Oct 14, 2026
Merged

max-sixty merged 8 commits into
mainfrom
diagnose-oversized-shot-page

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

A comment pin with no clear seat used to walk outward through its enclosing boxes until it found room, ending at main's edge. On a page of edge-to-edge cards, the pin for Card 1 stood about 500px below it, under the last card. Clear room was also judged against every painted box whole, which needed a registry key (x-face) so a widget's own slots could count as room.

A pin now stays by its target. pinSeating (margin-layout.js) offers four seats touching the target, in order: just outside its top-right corner, after a run of text's last word, just inside the corner (which may slide down the right edge past full lines), and just above the corner. seatRows (margin-placement.js) takes the first that covers no words, controls, media or shadow hosts; where none is clear, the seat clear of controls that covers least; else the corner slid left past the controls along the target's top, kept inside its bounds; else the corner itself. Pins already seated count as occupied. Hiding annotations (o) reveals whatever a pin covers.

Removed: external seats and their attachment through comment placement, the withheld state for an unseated pin, the painted-box rule with its walls and neighbours, and x-face (registry, default package, schema.py, packages.md). Glossary, assets/AGENTS.md and page-authoring.md describe the new rule.

Visible changes beyond the cards case: in release-notes at phone width a suggestion's Accept/Reject pin stands beside its suggestion, folded to one toggle; in the margin gallery at phone width a section pin that was hidden now shows; in alert-review's pane a pin moves from inside its target's corner to just outside it.

Tests: tests/runtime/margin-placement.test.mjs is rewritten for the new search; in tests/browser/test_render_margin.py, tests of the removed behaviour are deleted and the cards, drawing, run, contents, release-notes and option-cards tests now assert the new seats (test_a_pin_by_a_card_full_of_controls_stands_on_it_clear_of_them).

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

max-sixty and others added 7 commits October 13, 2026 16:18
…lear

A pin with no clear seat walked out through its enclosing boundaries, ending
at `main`'s edge, so on a page of edge-to-edge cards the marker for the second
card stood 500px below it, under the last card. Clear room was also judged
against every painted box whole, which needed a registry key (`x-face`) to let
a widget's own slots count as room.

A pin now offers four seats touching its target, in order: just outside its
top-right corner, after a run of text's last word, just inside the corner, and
just above it. It takes the first that covers no words, controls or media.
Where none is clear it stays by its target: the seat clear of controls that
covers least, else its corner slid left past the controls along the target's
top, else the corner itself. Hiding annotations reveals what a pin covers.

Removed: external seats and their attachment through comment placement, the
withheld state for an unseated pin, the painted-box rule with its walls and
neighbours, and `x-face`. Tests of those behaviours go with them; the
edge-to-edge cards test now holds the pin on its card, clear of its Action.

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

The corner of a block whose first line runs full now gives way to the first
clear spot lower down the same edge, such as the empty end of the next line,
before the pin tries the room above.

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

The layout pass seats one pin at a time, so the pins it had placed reached the
clear-seat search but not the last fallback, which stacked crowded pins on one
spot; seatRows now takes them as `occupied`. A seat slid left or pushed down
is kept only inside the pin's bounds, and the buttons in a widget's shadow tree
count as controls a pin keeps off.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…dget controls through every shadow tree

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
# Conflicts:
#	tests/browser/test_render_margin.py
# Conflicts:
#	skills/leaf/assets/registry.json

@leaf-agent leaf-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new above-target seat can put a pin above the document's scrollable top, leaving its action unreachable. Bound root seats by the document's top as well as by clipping regions.

… below the document's top

The seat after a run's last word was centred on that line, so a touch-sized pin
taller than the line reached up over the run's previous line: on Linux fonts the
release-notes suggestion's pin covered words it decides. It now stands level
with the last line's top. The seat above the corner takes the corner's own
right edge, so a full-width target's seat above stays inside the pin's inset
bounds. A scrollable document bounds every seat by its own top, so no seat
stands where no scroll can reach it.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@max-sixty
max-sixty merged commit 835c478 into main Oct 14, 2026
4 checks passed
@max-sixty
max-sixty deleted the diagnose-oversized-shot-page branch October 14, 2026 01:33
leaf-agent added a commit that referenced this pull request Oct 14, 2026
The [main CI
run](https://github.com/max-sixty/leaf/actions/runs/38496899586) failed
both motion variants of
`test_suggestion_controls_stay_out_of_the_column` after a viewport
resize. #2795 deliberately changed pin seating so a clear pin may touch
any part of its target; the test still required proximity to the
target's last text fragment. This updates that assertion to check the
target's rendered fragments while retaining the checks that the pin
covers no words and stays within the page.

The same two cases failed before this test change and pass afterward
(`uv run pytest
'tests/browser/test_render_widgets.py::test_suggestion_controls_stay_out_of_the_column'
-q -n0`).

Co-authored-by: leaf-agent <[email protected]>
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