fix: Use assistant-ui scroll primitives to fix auto-scroll and bottom padding #5
No reviewers
Labels
No labels
backend
bug
chore
duplication
effort:complex
effort:medium
effort:trivial
enhancement
frontend
fullstack
priority:high
ready-for-agent
refactor
security
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
dries/ocman!5
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/scroll-to-bottom-auto-scroll"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
ThreadPrimitive.Viewport,ViewportFooter, andScrollToBottomProblem
The conversation view had two scroll issues:
Root cause
AssistantThreadrolled its own scroll management instead of using@assistant-ui/react's built-in primitives. The custom code had a race condition:wasAtBottomRefwas read lazily inside arequestAnimationFramecallback, but a scroll event between the MutationObserver and the RAF could flip it tofalse(becausescrollHeightgrew), suppressing auto-scroll.The padding issue came from manually tracking
bottomInset(composer height) via a separate MutationObserver + ResizeObserver — fragile and could get out of sync.Changes
AssistantThread.tsx<div>viewport with<ThreadPrimitive.Viewport autoScroll>, wrap composer in<ThreadPrimitive.ViewportFooter>, replace custom scroll button with<ThreadPrimitive.ScrollToBottom>. Remove custom scroll logic.AssistantThread.csspadding-bottom, add.oc-viewport-footersticky positioning, dynamic scroll button placement via--oc-footer-heightCSS variable.Composer.cssposition: absolute(now inside sticky ViewportFooter).PermissionPrompt.cssQuestionPrompt.cssWhat's preserved
onLoadMore)scrollTopafter older messages load)