Repository navigation
Keep the margin reply card's bottom steady while drafting - #1147
Merged
Merged
Conversation
leaf-agent
approved these changes
Sep 25, 2026
max-sixty
added a commit
that referenced
this pull request
Sep 25, 2026
#1147 drove the stand-in Reply button and its collapse hook, which this branch removes. Its cases now click the editor, and leave the empty editor by blurring it, which #1147's focusout already repositions on. 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.
The margin conversation card aligned its top to its source on every placement. When a reply gained a line, the textarea grew but the card's bottom moved under the user's hand.
Right-rail cards now follow their source by the top while reading and hold their bottom relative to the source while the reply has focus or draft text. CSS keeps that edge steady during intrinsic textarea growth, and geometry remeasures and clamps the card to its visible boundary. Browser cases cover incoming replies, typing, leaving an empty editor, long drafts, and a draft carried from a narrow layout into the right rail.
Tests:
uv run pytest tests/test_render_margin.py -q;uv run pytest tests -q;npm run test:runtime; pre-commit on changed files.