Repository navigation
Stand a quoted passage's comments in a margin row of their own, by its words - #3083
Merged
Merged
Conversation
…s words A comment on a quoted passage used to share its paragraph's margin row, which stood at the paragraph's top in the rail and at its corner as a pin: on desktop up to a window's width from a one-word quote. A passage now gets its own row, as a row a pointing gesture names inside its target already did (groupFor): in the rail it stands level with the passage's first line, and as a pin it is seated by the passage's own line boxes with the seat order a run of text gets, starting just after its last word. - annotation-inventory.js groups threads by the words they resolve to, keyed by those words (whitespace collapsed) and their occurrence in the target, so a thread settling or arriving does not rebuild the row or close a card open on it; passage rows sort by where they start. - margin-layout.js measures a passage by each segment's own text (`passageBoxes`), never the box of an element it runs across, and withholds its row once a scroller hides its words though the paragraph still shows; marginSpot matches the card's passage, so the card keeps clear of its own row. - threadEntryAt prefers the row the open card shows, so returning focus to the paragraph does not switch the card to another passage's thread. Behaviour that changed in tests: the passage cases in `leaf-dev pins` no longer accept a far pin, and it reads each comment's own row; the lf-draft test now expects two rows, both seated on the widget. New tests cover the rail row's level and its sharing, and a passage scrolled out of a box that scrolls. Reactions on the same words still stand on the target's row; contribution entries carry no passage yet. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…ering words With every seat by its words taken, a passage's pin covered the neighbouring words, where main's pin stood clear at the paragraph's corner: on a phone, a one-word quote's pin sat over the line above it. It now tries the paragraph's own seats next, those lying wholly within half the scroller's height of the words, so the pin is still on screen when the words stand mid-screen in a long paragraph or pane; only when none of those is clear does it cover words, and then its neighbours' before its own, which count twice. The pins gallery gains a passage deep in a paragraph and one deep in a paragraph taller than the window, accepts the far pin a crowded passage now takes, and scrolls a case taller than the window to its first passage. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
# Conflicts: # .claude/skills/developing-leaf/references/glossary.md # skills/leaf/assets/runtime/annotation-overlay/margin-layout.js
A pin's pointed foot is its bottom-left corner. Above a word, the seat stood over the inside of the word's corner, so the foot pointed at the word's middle or start; for a run of words or a quoted passage it now hangs off the top-right corner, where the foot meets it. A block's above seat is unchanged. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
From review: the row key now reads the passage and the text before it with the page's own reading (textNodesUnder, quoteFrom), which crosses declared shadow roots, so the same words inside two widgets in one paragraph keep two rows; a scroll's reading of whether a row still stands now measures a passage row by its words, as the layout pass does, so a pane scrolling the quote away withholds its pin at once; seatsBy reads its subject's bounds with union; pointed-place's contract says a selection stands by the words it quotes. The pane test now scrolls the words away with no layout announced. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…ot-page # Conflicts: # skills/leaf/kernel/kernel.json
leaf-agent
reviewed
Oct 16, 2026
leaf-agent
left a comment
Collaborator
There was a problem hiding this comment.
The phone pin placement still misses the quoted words in the new quote-mid-line case. At the 390px viewport, test_each_pin_case_seats_its_pins_by_their_targets_clear_of_what_they_hide[phone] fails with {'quote-mid-line': [('far', 'quote-mid-line-p')]}: the pin is more than the gallery's 12px reach from “before it seats the pin.” This PR removes that case's previous far allowance, so the claimed close placement remains unmet. The pin's seat needs to meet that reach, or the gallery needs to explain why a distant seat is intended here.
…ot-page # Conflicts: # skills/leaf/kernel/kernel.json
CI's DejaVu wraps the phone paragraph so the quoted passage sits between full lines, where every seat by it is on words and the pin takes the paragraph's clear corner, as one-word does on a phone. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
approved these changes
Oct 16, 2026
leaf-agent
added a commit
that referenced
this pull request
Oct 16, 2026
The [failed main run](https://github.com/max-sixty/leaf/actions/runs/38867808372) exposed three margin outcomes after #3083: a release-notes suggestion pin covered its own words, a moved suggestion's folded row hid Accept, and a quoted passage marker moved one frame after its words scrolled. This change keeps the new quoted-passage placement while restoring the inset above seat for other inline targets. A passage row now uses the text's scrolling CSS anchor, so its marker travels in the same frame as the words. The three reported cases failed on current `main` before the repair and pass afterward. Focused quoted-passage rail and pane checks also pass. The committed kernel is rebuilt; `pnpm run test:runtime` passes 495 tests, and `pnpm run check` passes. The run's two composer return failures have a separate scrolling cause and are being repaired separately. 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 on a quoted passage used to share its paragraph's margin row. That row stood at the paragraph's top in the rail and at its corner as a pin, which on desktop could be a window's width from a one-word quote. Each quoted passage now gets a margin row of its own, the way a row that a pointing gesture names inside its target already does (
groupFor). In the rail, the row stands level with the passage's first line. As a pin, it is seated by the passage's own words.Grouping (
annotation-inventory.js): comments quoting the same words share one row. Its key is built from those words and which occurrence of them in the paragraph it is, read with the page's own text reading (textNodesUnder,quoteFrom). A thread settling or arriving therefore doesn't rebuild the row or close a card open on it. Passage rows sort by where they start.Placement (
margin-layout.js):passageBoxes), never by the box of an element it spans.seatsBy. A run's seat above its corner now hangs off its top-right corner, so the pin's pointed foot meets the words.Card and focus (
margin-projection.js):threadEntryAtprefers the row the open card shows, so returning focus to the paragraph doesn't switch the card to another passage's thread.marginSpotmatches the card's passage, so the card keeps clear of its own row.Gallery and tests:
leaf-dev pinsreads each comment's own row. A quote case accepts a far pin only where every seat by its words is on other words, so the pin takes its paragraph's clear corner, as on a phone or deep in a paragraph. Two new cases show a passage deep in a paragraph and deep in one taller than the window.Reactions on the same words still stand on the target's row, since contribution entries carry no passage yet.