Repository navigation
fix(chat): stop the recording chat's scroll effect from returning a Promise - #106
Merged
Merged
Conversation
…romise Current Chromium returns a Promise from scrollIntoView, and the effect's arrow returned it, so React logged an effect error when the chat opened. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Adeel
Description
Before: when you opened a recording's chat (for example with "Ask in chat" or "Chat about this"), the browser console showed a React error: an effect "must not return anything besides a function, which is used for clean-up".
After: the chat opens and scrolls to the latest message without the error.
Motivation and Context
Current Chromium returns a Promise from
scrollIntoView. The chat's scroll effect was a one-line arrow,useEffect(() => end.current?.scrollIntoView(...)), so it returned that Promise to React. It now has braces and returns nothing. No other effect in the frontend has this shape.Steps to reproduce (if appropriate):
Open a recording in Chrome, open its Chat tab, and check the console.
Types of changes
!in the title)Checklist:
make hookschecks it on commit).__tests__/recording-chat-tab.test.tsxmocksscrollIntoViewto return a Promise, as Chromium's does. It fails without the fix and passes with it.docs/accordingly.## UnreleasedinCHANGELOG.md.🤖 Generated with Claude Code