The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
fix(desktop): pause thinking preview pin while the reader is scrolled up (#109510)
Konstantin Khlopkov741fa6acc154
diff --git a/apps/desktop/src/components/assistant-ui/thread/message-parts.tsx b/apps/desktop/src/components/assistant-ui/thread/message-parts.tsxindex 4c94a1e2b33..8ec340639c2 100644--- a/apps/desktop/src/components/assistant-ui/thread/message-parts.tsx+++ b/apps/desktop/src/components/assistant-ui/thread/message-parts.tsx@@ -135,6 +135,9 @@ const ChainToolFallback: FC<TimelineToolCallProps> = props => {return <ToolFallback {...props} />}+// Match the compact terminal/log viewers rather than the full thread's slack.+const PREVIEW_RELOCK_THRESHOLD_PX = 24+type TimelineTextPartProps = TextMessagePartProps & { completedAt?: number; timestamp?: number }const TimelineMarkdownText: FC<TimelineTextPartProps> = ({ completedAt, timestamp }) => (@@ -218,7 +221,7 @@ const ThinkingDisclosure: FC<{let following = trueconst trackScroll = () => {- following = el.scrollHeight - el.scrollTop - el.clientHeight < 24+ following = el.scrollHeight - el.scrollTop - el.clientHeight < PREVIEW_RELOCK_THRESHOLD_PX}const pin = (entries: readonly ResizeObserverEntry[]) => {diff --git a/apps/desktop/src/components/assistant-ui/thread/streaming.test.tsx b/apps/desktop/src/components/assistant-ui/thread/streaming.test.tsxindex 844a334fffe..cf6a746e3cb 100644--- a/apps/desktop/src/components/assistant-ui/thread/streaming.test.tsx+++ b/apps/desktop/src/components/assistant-ui/thread/streaming.test.tsx@@ -44,9 +44,10 @@ class TestResizeObserver {this.callback([{+ borderBoxSize: [{ blockSize: height, inlineSize: 800 }],contentRect: { height } as DOMRectReadOnly,target: this.target- } as ResizeObserverEntry+ } as unknown as ResizeObserverEntry],this as unknown as ResizeObserver)@@ -687,7 +688,7 @@ describe('assistant-ui streaming renderer', () => {deliverGrowth()expect(body.scrollTop).toBe(100)- body.scrollTop = height - body.clientHeight+ body.scrollTop = height - body.clientHeight - 0.5fireEvent.scroll(body)rerender(<RunningMessageHarness message={assistantReasoningMessage('First thought. More reasoning. Latest thought.', true)} />