fix(nav): stop the faded-out tab bar taking taps - #1358
Merged
Conversation
Expanding a token card on the wallet fades the tab bar out with `alpha = 1f - cardExpansion.progress.value`. Alpha doesn't gate pointer input, so the invisible bar still took taps and switched tabs — and that tap was unrecoverable: `CardExpansionController` is owned at the app root so its fly-state survives a push, but the only code that returns `progress` to 0 is `collapse` in `CardExpandHost`, which lives inside the wallet nav entry. Leaving the wallet mid-expansion left nothing able to collapse it, so `progress` stuck at 1 and the bar stayed invisible on every tab for the rest of the Activity's life. Two changes, both needed — dropping the bar from the tree alone would leave a stuck expansion with no visible *and* no tappable bar, which is worse: - Scope the fade to the wallet tab, so a route change can't strand the bar faded out with nothing left to bring it back. - Drop `NavigationBar` from the tree once the fade completes, inside the existing `AnimatedVisibility` content so the slide-out doesn't also play and the return is still a fade in place. `derivedStateOf` keeps that to the two frames the boolean flips on rather than one recomposition per frame of the expansion. The fade itself moves from the `AppContent` call site into `AppNavigationBar`, which now takes the controller rather than a Float — reading `progress` inside the `graphicsLayer` keeps a frame of the expansion from recomposing the bar.
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.
Expanding a token card on the wallet fades the tab bar out with
alpha = 1f - cardExpansion.progress.value. Alpha doesn't gate pointer input, so the invisible bar still took taps and switched tabs — and that tap was unrecoverable.CardExpansionControlleris owned at the app root (App.kt) so its fly-state survives a push over the wallet, but the only code that ever returnsprogressto 0 iscollapseinCardExpandHost, which lives inside the wallet nav entry. Tapping the invisible bar left the wallet, so nothing was left able to collapse the expansion:progressstuck at 1 and the tab bar stayed invisible on every tab for the rest of the Activity's life. Only relaunching the Activity brought it back.Changes
Both are needed. Dropping the bar from the tree on its own would leave a stuck expansion with no visible and no tappable bar, which is worse than today.
NavigationBarfrom the tree once the fade completes. Theif (!fadedOut)sits inside the existingAnimatedVisibilitycontent, not in itsvisible, so the slide-out doesn't also play over an already-transparent bar and the return is still a fade in place.derivedStateOflimits the recomposition to the two frames the boolean flips on, rather than one per frame of the expansion.The fade moves from the
AppContentcall site intoAppNavigationBar, which now takes the controller rather than aFloat— readingprogressinside thegraphicsLayerkeeps a frame of the expansion from recomposing the bar.Repro
Wallet → tap a token row → card expands, tab bar fades out → tap where a tab button was. Before: navigates to that tab and the bar is invisible everywhere until the app is relaunched. After: nothing happens; back collapses the card and the bar fades back in.