Fix bottom nav staying visible when opening deep links#2929
Merged
Conversation
Use rootNavigator when pushing deep link routes so they display above the tab scaffold instead of inside it. Fixes lichess-org#2910 Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
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.
Fix bottom nav staying visible when opening deep links
Summary
rootNavigator: truewhen pushing deep link routes so they display above the tab scaffold instead of inside it, hiding the bottom navigation barhandleAppLink()inapp_links_service.dartRoot Cause
handleAppLink()was callingNavigator.of(context).push(route)which pushed onto the tab navigator (since the context comes fromcurrentNavigatorKeyProvider, a tab-specific key). This meant deep link screens were rendered within the tab, leaving the bottom navigation bar visible and shrinking the screen.The fix changes this to
Navigator.of(context, rootNavigator: true).push(route), which pushes onto the root navigator aboveMainTabScaffold-- consistent with how every other full-screen navigation in the app works.Deep links tested
All deep link types go through
handleAppLink()and are affected by this fix. Tested on Android emulator (API 36) against lichess.dev:Game (
/3K42eD3l)Study (
/study/9hdiWME4)Tournament (
/tournament/HWT5E5Ja)Broadcast (
/broadcast/.../BoiVuw5O)