Skip to content

Commit a2c8894

Browse files
Add scroll-to-element on branch toggle
Call scrollToAgent when toggling agent/tool branches to keep the toggled item visible in the top third of the scrollbox. Improves navigation in long chat sessions. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
1 parent d8bf6da commit a2c8894

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

cli/src/hooks/use-message-renderer.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,9 @@ export const useMessageRenderer = (props: UseMessageRendererProps): ReactNode[]
365365
}
366366
return next
367367
})
368+
scrollToAgent(id)
368369
}}
370+
registerAgentRef={registerAgentRef}
369371
/>
370372
</box>
371373
</box>
@@ -413,7 +415,9 @@ export const useMessageRenderer = (props: UseMessageRendererProps): ReactNode[]
413415
}
414416
return next
415417
})
418+
scrollToAgent(id)
416419
}}
420+
registerAgentRef={registerAgentRef}
417421
/>
418422
</box>
419423
)}

0 commit comments

Comments
 (0)