Repository navigation
fix(app): a chat that shrinks to fit mid-turn keeps its top rows drawn - #193
Merged
Merged
Conversation
When a long reply folded into its turn's steps and the chat got short enough to fit, WebKit moved the view up without a scroll event. The virtualized list kept drawing rows for where the view had been, leaving the prompt and the first steps undrawn with blank space in their place. The list now checks where the view really is whenever its height changes, and tells the virtualizer when they differ. The demo's test hook can record any step (an edit, a command), and a browser test replays the turn with the browser's own scroll events dropped, as WebKit does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
All reported issues were addressed across 4 files
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
- The chat's own scroll handler ignores the list's synthetic scroll event, so telling the virtualizer where the view is can't unpin a chat the person touched a moment before. - The demo's record hook takes any kind of item without its id, typed per kind instead of the union's common fields. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merged
This branch was successfully deployed
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.
Summary
Mid-turn, a chat could go blank at the top: the prompt, the Working fold and the first steps were missing, with empty space where they belonged.
Cause. The chat draws only the rows near the view, and it learns where the view is from the browser's scroll events. When the agent's long reply folded into Working (a tool call and a newer reply arrived after it), the chat got short enough to fit and the view moved back to the top. WebKit, which runs the Mac app, does that without firing a scroll event. So the virtualizer kept drawing for the old, lower position, and nothing scrolled after that to correct it. I confirmed this by replaying the real session's record through the box's transcript reader: the blank band in the screenshot is exactly the prompt, the fold and the first
locations.goedit.Fix (
app/src/components/conversation/chat-list.tsx). Whenever the list changes height, it compares the virtualizer's offset with the realscrollTop. If they differ, it updates the virtualizer with a scroll event.Testing
app/e2e/draft.spec.tsthat replays the turn's shape: five edits, then a reply taller than the screen, then a command and a short reply that fold it away. It drops the browser's own (trusted) scroll events, as WebKit does. Without the fix it fails 4 times in 4; with it, the whole spec passes 24 times in 24 (6 tests × 4).chat-long.spec.tspasses 5 out of 5.window.__berthDraft, mock-only) hasrecordbesideland.go vetandgo test -race,cargo check, the app checks and build,npx tsc -p e2e, and the docs build all pass, apart from one Go flake.internal/leadline/apiTestDetachfails 3 times in 10 with-race. This branch changes no Go code, so the same flake is onmain. The package passes on a rerun.Review
review --base origin/main): no actionable findings.Omit<TranscriptItem, "id">flattened the union. It's now distributive (Unsaved<T>).🤖 Generated with Claude Code