Repository navigation
Keep side response foot steady while drafting - #1159
Merged
Merged
Conversation
leaf-agent
approved these changes
Sep 25, 2026
max-sixty
added a commit
that referenced
this pull request
Sep 29, 2026
…d let pins use a neighbour's empty line end (#1429) Three design calls the user made on the UI sweep's decision page, after #1410. ## A comment or reply box grows down Before: the box kept its foot, so each wrap moved every line already written up a row (#1159), and a reply in the margin thread card carried the whole thread being answered up with it. Now both keep their top: what you've written and the thread you're answering hold still, and Send moves down a line per wrap. Only at the window's foot does the box or card rise, as far as the next line needs, and the card's transcript gives up height only once the card fills the window. When a new turn joins the thread while the user is replying, the card holds its bottom instead, so the reply box and a Send just pressed stay under the hand. This reverses #1159's `translate: 0 -100%` foot anchoring in `chrome.css`, `composing/surface.js` and `thread-card-geometry.js`; `margin-projection.js` writes the card's top in every case, and `data-lf-thread-held` is gone. ## A comment on a whole target stands by the line the user pointed at Before: Alt-clicking line 51 of a tall diff opened a comment on the whole diff (right by the registry) with its box and marker at the diff's top, ~400px above the line. Now the comment still names the whole target, and only its own place follows the gesture (`runtime/pointed-place.js`): - A point is the line the press landed in, read from computed layout: the nearest box around the pressed element that is a line of its own, a table cell's row, and none for inline text or a target's first line. Drawings and visual-part anchors never take one. - A pointed comment gets its own margin row at its line; other threads, an Ask's marker, widget actions and reactions on the target stay in the target's row at its top. Comments pointed at one line share a row. - The comment box, the thread card and its bring-back, `t`'s travel and the spoken position ("64 percent down, diff · “let value_50 = compute(50);”") all read the point (`entryPlace`). - Anchor paint's pass is the one writer of where a point stands (AGENTS.md's one-writer table): the composer queues a point under the thread's key, the pass takes it in once the thread is in the log, re-finds a replaced line by its words (resolved like a quote; repeated words detach), and drops points only of threads the log no longer holds, so settle-then-undo returns the comment to its line. - The point is presentation and not in the event log, so a reload puts a pointed comment back at its target's top. ## Pins may use a neighbour's empty line end Asked from a phone screenshot: "I don't understand how there's no room here?? there's lots of empty space there!!" — a suggestion's Accept/Reject pair covered its words while the room right of the short heading above it stood empty. `coverIn` counted every neighbouring block whole. Now a block that paints its box (fill, border or shadow, read from computed style) still counts whole, and one that paints nothing counts by its words; `pinSpot` takes a neighbour's empty room only when its target has none of its own, so pins that had room keep their seats. At 390px touch, suggestion pairs over their words went from 5 of 7 to 3 of 7, and all pins over words from 10 of 54 to 6 of 54; 900px is unchanged. `leaf-dev probe --touch` opens a page under a finger. `page-authoring.md` and `skills/leaf/assets/AGENTS.md` state the rule. ## Trade-offs to check - A pointed place doesn't survive a reload. - Two pins now stand nearer a neighbour than their target (release-notes' Operations pair, log-retention's comment marker); the user saw both on the decision page. - Whether a pointed line is the target's first is decided when the user points, from what was drawn then; a line hidden by a media query above it can leave the pointed row level with the target's. ## Testing The local pre-merge gate passes on the head (the everyday suite plus the nightly tests in the touched files, runtime, browser and Worker suites, bundles, lint). Each behaviour has a browser test that was watched failing with the change reverted, and each new test passed 18 of 18 concurrent copies under `leaf-dev flake`. The pointed-place change went through six rounds of independent review, each finding fixed with a test. Before/after pairs for each change were checked in the browser at desktop and phone widths. > _This was written by Claude Code on behalf of max-sixty_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
max-sixty
added a commit
that referenced
this pull request
Oct 5, 2026
A placement design review found that the comment box and the thread card share one rule for their side and line, but the card decided on its own which edge to hold as its thread grows. That held-edge policy has been reversed once and patched five more times (#1147, #1159, #1303, #1380, #1429, #1453, #1552, #1574). This change gives it one owner. - `comment-placement.js` now owns the policy (`holding`, `heldAt`, `heldHeight`) for both surfaces. `margin-projection.js` reports what it knows of the thread (the transcript's extent, whether the user is drafting, the latest turn and the draft's words) and no longer keeps `previewHold`. The logic moved verbatim. The comment box has no turns, so it never asks. - The "One writer for each fact" table in `skills/leaf/assets/AGENTS.md` names the owners of comment placement and of margin-row seating, so a change that decides either elsewhere shows up in review. - Margin-entry labels measure their room through `shownWindow` instead of reading `.lf-banner` and `.lf-shortcut-bar` themselves. - Two TODO items whose tests already pass are removed: landing a sent comment's thread where its box stood, and the composer on a page with a margin on `html`. `test_an_aimed_comment_keeps_its_place_with_the_asks_drawer_open` now also runs at 1200px, the width that TODO described. No user-visible behavior changes. An earlier commit on this branch also moved the box's scrolled-away trigger into the shared module and applied it to the card. That part came out when #1705 changed the box to follow its passage out of view. New runtime tests cover the held-edge policy. `npm run test:runtime` passes. The focused browser tests for send placement, the comment box, the margin card and replies pass, except three cases of `test_a_thread_resolved_while_its_reply_is_written_keeps_the_user_on_it`, which fail identically on `main`. > _This was written by Claude Code on behalf of max-sixty_ --------- Co-authored-by: Claude Opus 5.5 (1M context) <[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.
Beside a passage, the floating response previously kept its top fixed as a draft gained lines. That moved its bottom and Send button while the user typed, unlike the margin thread card's steady foot.
Keep the side response's initial foot through growth, shrinkage, and restored drafts. The floating response and margin card now share the CSS rule that anchors their positioned top to the foot; the floating response's placement logic preserves that attachment while retaining viewport clearance and passage-following behavior.
Browser coverage exercises both side placements, growth and shrinkage, and a restored draft. The margin-card and passage-scrolling cases remain covered.