Repository navigation
fix(planreview): dock the comment box under the plan, and stop it stealing scroll - #118
Merged
Merged
Conversation
…aling scroll Writing a comment from the bottom of a long plan threw the reviewer back to the top. `useSelectionAnchor` returned before computing anything when `frozen` was set, so the composer's anchor was always null and it fell back to absolute positioning *inside* the scroll container — then autofocused itself, scrolling the plan to reach it. The frozen branch was mine and never worked; it is gone, and the option with it. The composer now docks below the document as a sibling of the scroll container, so taking focus cannot move the plan, with `preventScroll` as a second guard. It is also the size a review comment deserves: five lines to start, growing with what is typed up to 30vh so it can never swallow the plan it is about. Separately, "Approve with comments" was being cut in half — two buttons sharing a row in a 288px rail. They stack now, so no label truncates at any panel width. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: unavailable · PR result: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
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.
Four reported problems with the comment composer, three of them one root cause.
Scroll jumped to the top when the box opened
useSelectionAnchorreturned before computing anything whenfrozenwas set:The composer passed
frozen: true, so its anchor was permanentlynulland it always took the fallback branch —position: absolute; bottom: 1reminside the scrolling document — and then autofocused itself, which scrolled the plan to wherever that had landed. From the bottom of a long plan that reads as a jump to the top.The frozen branch was mine, from the previous PR, and never worked. It and the option are removed; the toolbar simply doesn't render while the composer is open.
The box was too small, and now it docks
Per the request, the composer goes back to being docked under the plan rather than floating over it. That also fixes the scroll problem structurally: it is a sibling of the scroll container, not a child, so focusing it cannot move the plan.
focus({ preventScroll: true })is a second guard.It starts at five lines and grows with what is typed, capped at 30vh so it can never swallow the plan it is about. Measured in JS rather than CSS
field-sizing, which Safari and Firefox still lack."Approve with comments" was cut in half
Two buttons sharing a row in a 288px rail. They stack now, so no label truncates at any panel width.
Verification
155 tests passedacross 11 scoped files;tsgo --noEmitclean forapps/web; lint andcheck-fork-markers.tspass.New tests pin the two properties that were asked for and could silently regress: the composer's root element carries no
absolute/fixed/stickypositioning, and it rendersmin-height:6rem/max-height:30vh. Both assert against the root element's own classes — a whole-markup search would match thebefore:absoluteanddisabled:utilities every button carries, and pass for the wrong reason.Reviewer check: scroll to the bottom of a long plan, select a line, hit Comment — the plan should not move, and the box should grow as you type and then stop at a third of the window.
🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.