Repository navigation
Seat a comment pin by its target, over it where nothing beside it is clear - #2795
Merged
Merged
Conversation
…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]>
…ncluded 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
reviewed
Oct 14, 2026
leaf-agent
left a comment
Collaborator
There was a problem hiding this comment.
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]>
leaf-agent
approved these changes
Oct 14, 2026
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]>
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.
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.mdandpage-authoring.mddescribe 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.mjsis rewritten for the new search; intests/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).