[PR #13137] [MERGED] app/ui: use requestAnimationFrame to prevent bottom line cutoff in streaming thinking display #76382

Closed
opened 2026-05-05 08:55:22 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/13137
Author: @hoyyeva
Created: 11/18/2025
Status: Merged
Merged: 12/10/2025
Merged by: @hoyyeva

Base: mainHead: hoyyeva/thinking-rendering


📝 Commits (1)

  • 3f6d669 app/ui: use requestAnimationFrame to prevent bottom line cutoff in streaming thinking display

📊 Changes

1 file changed (+21 additions, -9 deletions)

View changed files

📝 app/ui/app/src/components/Thinking.tsx (+21 -9)

📄 Description

When models with thinking capability stream their reasoning in real-time, the bottomline of thinking content is cut off and not visible to users in the collapsed thinking panel.

The reason why is because the thinking component uses CSS translateY() transform to position content and show the bottom portion in collapsed mode. During active streaming, a race condition occurs where the transform calculation happens before the browser completes layout of newly added content, resulting in positioning based on stale dimensions.

This PR modified 2 things:

  1. Wrapped transform calculations in requestAnimationFrame: Ensures DOM layout is complete before calculating content dimensions and positioning (to avoid race condition)
  2. Added auto-scroll for expanded mode: When the thinking panel is expanded during active streaming, automatically scrolls to show the latest content

This PR is resolving #13094


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ollama/ollama/pull/13137 **Author:** [@hoyyeva](https://github.com/hoyyeva) **Created:** 11/18/2025 **Status:** ✅ Merged **Merged:** 12/10/2025 **Merged by:** [@hoyyeva](https://github.com/hoyyeva) **Base:** `main` ← **Head:** `hoyyeva/thinking-rendering` --- ### 📝 Commits (1) - [`3f6d669`](https://github.com/ollama/ollama/commit/3f6d669a65dd79f9138504a3e4f5c3ada5464fd0) app/ui: use requestAnimationFrame to prevent bottom line cutoff in streaming thinking display ### 📊 Changes **1 file changed** (+21 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `app/ui/app/src/components/Thinking.tsx` (+21 -9) </details> ### 📄 Description When models with thinking capability stream their reasoning in real-time, the bottomline of thinking content is cut off and not visible to users in the collapsed thinking panel. The reason why is because the thinking component uses CSS `translateY()` transform to position content and show the bottom portion in collapsed mode. During active streaming, a race condition occurs where the transform calculation happens before the browser completes layout of newly added content, resulting in positioning based on stale dimensions. This PR modified 2 things: 1. Wrapped transform calculations in `requestAnimationFrame`: Ensures DOM layout is complete before calculating content dimensions and positioning (to avoid race condition) 2. Added auto-scroll for expanded mode: When the thinking panel is expanded during active streaming, automatically scrolls to show the latest content This PR is resolving #13094 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-05-05 08:55:22 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#76382