Merged
Conversation
isekovanic
commented
Apr 7, 2026
| expect(screen.getByTestId('channel-list')).toBeTruthy(); | ||
| await expectAllChannelsWithStateToBeInDB(screen.queryAllByLabelText); | ||
| }); | ||
| }, { timeout: 5000 }); |
Contributor
Author
There was a problem hiding this comment.
This test started timing out locally, maybe due to the hook barrel imports becoming larger ? It was likely on the edge before. Anyway, the offline support tests are really due a refactor anyway so for now we just extend the timeout.
isekovanic
commented
Apr 7, 2026
| closePollCreationDialog, | ||
| compressImageQuality, | ||
| CreatePollContent, | ||
| // TODO: probably not needed anymore, please check |
Contributor
Author
There was a problem hiding this comment.
It's definitely not used by the underlying unmemoized component but let's do the cleanup in a separate PR to make sure some parts of the state do not weirdly depend on this rerender.
Contributor
SDK Size
|
oliverlaz
approved these changes
Apr 7, 2026
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.
🎯 Goal
This PR fixes an Android timing bug in the message edit flow when edit is triggered from the message overlay that caused the keyboard to be immediately closed afterwards. It also fixes severe visual stuttering when changing the state to editing within the
MessageComposeron both platforms.The bug was caused by the edit action focusing the message input before
PortalWhileClosingViewhad fully returned the teleported composer back into its normal tree. On Android, that caused theTextInputto lose focus mid keyboard animation, which immediately closed the keyboard again.The stuttering part is caused by the fact that the keyboard opening and the state changing to editing essentially animate the layout of the same component, but through 2 different state values - often offset by a single frame. This means that it is very realistic for the
MessageComposerto animate its layout height, bottom padding and other layout props all offset from each other by a frame, making the animations feel wonky.The fix separates the problem into two explicit stages:
This preserves the original edit behavior while making the focus timing safe.
When long pressing a message and tapping
Edit, the expected behaviour is:On Android, that flow was unstable when the overlay was still closing through PortalWhileClosingView.
What was actually happening:
react-native-teleportmoved the composer back into the normal tree after focus had already been appliedThis showed up much more clearly in release builds than in debug builds, because of the fact that no animation frames are actually skipped. In other words, the invocation of the scheduled actions to execute after the context menu closes happens way too fast in the React lifecycle.
So, the fix for both of these things looks something like this:
requestAnimationFramesworked reliably:TextInputhost to settleWe also considered solving this directly in the overlay queue, but the committed fix keeps the behavior local to the edit action instead.
In the future, if we figure that 2 RAFs are not enough (on
120mhzphones for example), there is an alternative solution that can introduce a relatively complex registry on thePortalWhileClosingViewlayer that waits for true layout settle before doing any teleport sensitive actions (like focusing an input). I've yet to reproduce a case where they aren't enough, though - so let's keep it simple for now.🛠 Implementation details
🎨 UI Changes
iOS
Android
🧪 Testing
☑️ Checklist
developbranch