Skip to content

Conversation

Copy link

Copilot AI commented Jan 10, 2026

The ScrollArea component wasn't forwarding refs, breaking auto-scroll functionality in the AI chat box.

Changes

  • Convert ScrollArea from function to React.forwardRef component
  • Forward ref to ScrollAreaPrimitive.Viewport (the actual scrollable element)
  • Add displayName for React DevTools

Impact

The auto-scroll logic in ai-chat-box.tsx now works correctly:

// Previously scrollRef.current was always null
// Now it correctly references the viewport element
useEffect(() => {
  if (scrollRef.current) {
    scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
  }
}, [messages]);

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI self-assigned this Jan 10, 2026
Co-authored-by: ztygod <142967939+ztygod@users.noreply.github.com>
Copilot AI changed the title [WIP] WIP address changes based on feedback from home page refactor Fix ScrollArea ref forwarding to enable auto-scroll Jan 10, 2026
Copilot AI requested a review from ztygod January 10, 2026 07:31
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.

2 participants