-
Notifications
You must be signed in to change notification settings - Fork 1.8k
fix: message observers #3015
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: message observers #3015
Conversation
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
|
Caution Review failedThe pull request is closed. WalkthroughRefactors ChatMessages to use React forwardRef with an exposed scrollToBottom via useImperativeHandle, introducing a ScrollController and wrapping in a Conversation layout. Retains ChatMessagesInner as a MobX observer. Converts MessageContent from an observer-wrapped component to a plain functional component without changing rendering outcomes. Changes
Sequence Diagram(s)sequenceDiagram
participant P as Parent Component
participant CM as ChatMessages (forwardRef)
participant C as Conversation
participant SC as ScrollController
participant I as ChatMessagesInner (observer)
P->>CM: render(props, ref)
Note over CM: useImperativeHandle exposes<br/>scrollToBottom(ref)
CM->>C: render
C->>SC: mount with scroll handlers
SC->>I: render messages
P-->>CM: ref.scrollToBottom()
CM->>SC: invoke scroll to bottom
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Description
Related Issues
Type of Change
Testing
Screenshots (if applicable)
Additional Notes
Important
Remove
observerwrapper fromChatMessagesandMessageContentcomponents to simplify structure and reduce re-renders.observerwrapper fromChatMessagesinindex.tsxandMessageContentinmessage-content/index.tsx.index.tsxandmessage-content/index.tsxto improve code readability.This description was created by
for 352466f. You can customize this summary. It will automatically update as commits are pushed.
Summary by CodeRabbit