Skip to content

UI thread cleanup + tanstack virtualized#2424

Open
adamleithp wants to merge 3 commits into
mainfrom
ux/thread-tanstack-virtual
Open

UI thread cleanup + tanstack virtualized#2424
adamleithp wants to merge 3 commits into
mainfrom
ux/thread-tanstack-virtual

Conversation

@adamleithp
Copy link
Copy Markdown
Contributor

@adamleithp adamleithp commented May 28, 2026

Changelog

  • virtua → @tanstack/react-virtual
  • scroll-to-bottom: 2 clicks → 1 click
  • streaming text drifts off bottom → safety-net keeps it pinned
  • session footer text: gray-10 → text-muted-foreground
  • session footer: always visible → opacity 50% until thread hover
  • session footer context indicator: flowed left when alone → always right
  • thread edges: hard cut → scroll-mask fade
  • message paragraphs: tight leading → leading-[1.9]
  • pending permission box: max-h-1/2 + top border → no cap, no border
  • prompt input wrapper: top border → no border
  • prompt input: no focus ring → purple-9 focus-within ring
  • prompt input block-end addon: no padding → p-1 for visual alignment
  • prompt input row bottom padding: pb-2 → pb-3
2026-05-28 23 34 59 --- 2026-05-28 23 31 42 --- 2026-05-28 23 30 46 --- 2026-05-28 23 29 13

🤖 Generated with Claude Code

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 28, 2026

Prompt To Fix All With AI
Fix 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;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 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.

adamleithp and others added 3 commits May 29, 2026 05:39
- 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>
@adamleithp adamleithp force-pushed the ux/thread-tanstack-virtual branch from ec84cb9 to 3b3a9af Compare May 29, 2026 04:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant