Dedupe message-list pages on opening a notification#2059
Merged
gnprice merged 10 commits intozulip:mainfrom Jan 6, 2026
Merged
Dedupe message-list pages on opening a notification#2059gnprice merged 10 commits intozulip:mainfrom
gnprice merged 10 commits intozulip:mainfrom
Conversation
These already do something a bit more complex than opening the notification's conversation (they might pop a number of routes belonging to a different account, and push a new HomePage); and more wrinkles will be coming in the future.
Kind of silly that Navigator upstream doesn't provide this directly in its API. But here it is.
The behavior should be unchanged here, because the navigation observer _UpdateLastVisitedAccount was already keeping the global store's record of the current account up to date. But logically the information this bit of code wants is about the current navigation stack in the app's navigator. So now that we maintain an accessible record of that stack, let's inspect that directly.
This method will soon need to be more hands-on with the details of the route, in order to decide when an equivalent route is already in view, for zulip#1852.
Member
Author
|
Thanks for the review and testing! |
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.
Fixes #1852.
This required a bit of setup in order to get our hands on the right information about the current navigation state.
There were a few product choices to make about the details of the behavior. Quoting from the last commit:
Selected commit messages
783e1d1 nav: Track the whole navigation stack
Kind of silly that Navigator upstream doesn't provide this directly
in its API. But here it is.
bc396ff nav: Add currentPageRoute getter on NavigationStack
1345d0d nav: Add WidgetRoute.pageElement
5d0703b msglist: Add currentNarrow and stateOfRoute static methods
9e33d49 notif: Dedupe msglist page on opening notif
Fixes #1852.