fix(chat): pin streaming responses to the composer; open remote-only branches as worktrees - #66
Merged
Merged
Conversation
Sending made the new user message a LegendList anchoredEndSpace target, which reserved a viewport-tall blank tail below it and disabled maintainScrollAtEnd. Until a turn outgrew that reserve, the response sat at the top of the timeline with a large gap above the composer. Drop the anchored tail: the list now always maintains scroll at the end, so a streaming turn hugs the composer. This removes the anchor plumbing that existed only to position and re-settle that reserve, and replaces timelineScrollAnchoring with timelineScroll, whose overflow probe the follow effect already needed. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
listRefs already carries the remote in a ref's name (`origin/claude/x`) and repeats it in `remoteName`, but the workspace picker's branch suggestions concatenated both and the pull-request dialog matched refs against that same doubled shape. Selecting a branch that exists only on origin therefore sent `origin/origin/claude/x`, matched no ref, and silently created no worktree — the common case for an agent-pushed branch. Pass and display the ref name as listed, and resolve a reference through findBranchRefForReference, which accepts either the qualified or the plain branch name and prefers a local ref over a remote one. Add a shared stripRemoteRefPrefix that strips only a ref's own remote prefix, so a local `claude/x` keeps every segment. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Two independent fixes reported from the same session.
Streaming responses sat far above the composer
Sending made the new user message a LegendList
anchoredEndSpacetarget, which reserved a viewport-tall blank tail below it and switchedmaintainScrollAtEndoff. Until a turn outgrew that reserve, the response stayed pinned near the top of the timeline with a large gap between the text and the composer.The anchored tail is gone: the timeline always maintains scroll at the end, so a streaming turn hugs the composer. That removes the anchor plumbing whose only job was positioning and re-settling that reserve (~200 lines in
ChatView), and replacestimelineScrollAnchoringwithtimelineScroll— keeping the overflow probe the follow effect already needed. Scroll-away behaviour is unchanged: a wheel/touch/pointer gesture still parks the view and shows the "Scroll to end" pill.Selecting a remote-only branch created no worktree
listRefsreports a remote ref as{ name: "origin/claude/x", remoteName: "origin" }— the prefix is already inname. The workspace picker's branch suggestions concatenated both fields, and the pull-request dialog matched candidate refs against that same doubled shape. Picking a branch that exists only on origin sentorigin/origin/claude/x, matched nothing, and silently produced no worktree. That is the normal case for an agent-pushedclaude/*branch; a branch already present locally worked, which made it look intermittent.Suggestions now pass and display the ref name as listed, and a reference resolves through
findBranchRefForReference, which accepts either the qualifiedorigin/claude/xor the plainclaude/xand prefers a local ref over a remote one. The new sharedstripRemoteRefPrefixstrips only a ref's own remote prefix, so a localclaude/xkeeps every segment;baseRefChoicesdrops its private copy of that logic.Picking such a branch now runs
git worktree add -b claude/x <path> origin/claude/x, roots the chat in that worktree, and the diff resolves its base via upstream → provider default, so it shows the branch's changes. The base-branch selector on the right is untouched.Verification
DesktopClientSettings.test.tsfixture from 3396b19, effect-lint noise inWorkspaceSearchIndex.test.ts).stashImageCompression.test.tstiming out under parallel load, passes on its own.timelineScroll.test.ts,stripRemoteRefPrefix,findBranchRefForReference, plus a rewrittenMessagesTimelinecase asserting no reserved tail.Not covered: a manually typed
origin/claude/xwhile a localclaude/xexists still dead-ends, because the server-side ref search filters by substring on the full string. Clicking a suggestion is unaffected.🤖 Generated with Claude Code