Repository navigation
fix(search): bring the tab bar back after a predictive back from Search - #1855
Merged
Merged
Conversation
A predictive back from Search left Chat without its tab bar. When Search left without closing through the morph, its DisposableEffect reset the morph with a launch on Search's own rememberCoroutineScope. That scope is cancelled as the entry leaves composition, so the reset never ran and SearchMorph.fraction stayed where the gesture left it, keeping the bar's pill and search button hidden. Launch the reset on rootScope, which ✕ already uses for its shrink.
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.
A predictive back from Search lands on the tab home with no tab bar.
Search hands the bar's pill and search button over to its field through
SearchMorph.fraction. When Search leaves without closing through the morph, as a committed back does,Publish()'sDisposableEffectresets the morph withscope?.launch { fraction.snapTo(0f) }.scopeis the Search entry'srememberCoroutineScope, which is cancelled as that entry leaves composition, so the launched reset never runs.fractionstays where the last seek frame left it, and the bar's chrome stays hidden.The reset now launches on
rootScope, which outlives the entry and which the ✕ close path already uses for its shrink.On a Pixel 7a API 36 emulator, a back gesture from Search left Chat without its tab bar on a build without this change, and with the tab bar on a build with it.