Repository navigation
fix(chat): return to the chat list from a chat opened by handle - #811
Merged
Merged
Conversation
The username lookup replaces its route with the chat it pushes, so Back from that chat lands on the chat list rather than on the field that found the person. It guarded that rewrite on the tips stack being two deep, which is what it was in #661, when the lookup was pushed straight off the list. #790 put the New Chat picker in between. The chat now lands three deep, the guard never matches, and the rewrite is skipped — so Back goes to the username field. Measure the stack before the push instead of assuming its depth, so the guard tracks whatever route reaches this screen.
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.
Finding someone by their username and landing in their chat left the username field under the chat, so Back went back to the field rather than to the chat list.
The lookup screen already handles this: once it pushes the chat, it rewrites the tips stack to hold that chat alone. The rewrite was guarded on the stack being two deep, which is what it was in #661, when the lookup was pushed straight off the chat list. #790 put the New Chat picker in between, so the chat lands three deep, the guard never matches, and the rewrite is skipped.
The guard now measures the stack before the push instead of assuming its depth, so it tracks whatever route reaches the screen. Everything else about the hand-off is unchanged, including the 150ms delay that hides the chat's remount behind the push transition.
Two tests in
UsernameLookupRoutingTestscover the back stack: one pins that the route in has no fixed depth, and one that the rewrite leaves the chat at the root of the stack.