UI thread cleanup + tanstack virtualized#2424
Open
adamleithp wants to merge 3 commits into
Open
Conversation
Contributor
Prompt To Fix All With AIFix the following 1 code review issue. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 1
apps/code/src/renderer/features/sessions/components/VirtualizedList.tsx:94-97
**Stale scroll-button state on settle timeout**
When the RAF loop exhausts its 12 attempts without reaching the end, `settlingRef.current` is cleared but `onScrollStateChange` is never called. Because `setShowScrollButton(false)` was already fired in `ConversationView.scrollToBottom()`, the button stays hidden even though the list is not actually at the bottom. The state self-corrects on the next native scroll event, but if nothing triggers a scroll (e.g. streaming has paused), the user has no visible way to jump to the bottom until they manually scroll first.
Reviews (1): Last reviewed commit: "remove max-height + top border on pendin..." | Re-trigger Greptile |
Comment on lines
+94
to
+97
| if (++attempts > 12) { | ||
| settlingRef.current = false; | ||
| settleRafRef.current = null; | ||
| return; |
Contributor
There was a problem hiding this comment.
Stale scroll-button state on settle timeout
When the RAF loop exhausts its 12 attempts without reaching the end, settlingRef.current is cleared but onScrollStateChange is never called. Because setShowScrollButton(false) was already fired in ConversationView.scrollToBottom(), the button stays hidden even though the list is not actually at the bottom. The state self-corrects on the next native scroll event, but if nothing triggers a scroll (e.g. streaming has paused), the user has no visible way to jump to the bottom until they manually scroll first.
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/code/src/renderer/features/sessions/components/VirtualizedList.tsx
Line: 94-97
Comment:
**Stale scroll-button state on settle timeout**
When the RAF loop exhausts its 12 attempts without reaching the end, `settlingRef.current` is cleared but `onScrollStateChange` is never called. Because `setShowScrollButton(false)` was already fired in `ConversationView.scrollToBottom()`, the button stays hidden even though the list is not actually at the bottom. The state self-corrects on the next native scroll event, but if nothing triggers a scroll (e.g. streaming has paused), the user has no visible way to jump to the bottom until they manually scroll first.
How can I resolve this? If you propose a fix, please make it concise.- virtua → @tanstack/react-virtual for thread + raw logs - scroll-to-bottom now settles after row remeasure (no more double-click) - streaming safety-net: re-pin to end on in-place row growth - session footer: muted-foreground, opacity-50 → 100 on thread hover, right-aligned always - thread scroll container: scroll-mask edge fade - p line-height bumped to 1.9 in user + agent messages Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
ec84cb9 to
3b3a9af
Compare
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.
Changelog
🤖 Generated with Claude Code