Repository navigation
feat(home): open the account switcher on a long-press of the You tab - #1624
Merged
Merged
Conversation
Matches iOS HomeTabView.handleLongPress(on:). Only the You tab takes the long-press, and only behind the same gate as Switch Accounts in Advanced Features (beta flags unlocked, or staff). With the gate closed the tab has no long-click at all, so there is no haptic and a long hold still selects it. The switcher is the existing AccountSelection route, opened as a sheet.
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.
Long-pressing the You tab now opens the account switcher, as iOS does in
HomeTabView.handleLongPress(on:).HomeViewModel.canSwitchAccountscombines the two, so both entry points agree.NavigationBargets a nullonYouTabLongClick, so the tab has no long-click at all: no haptic, and a long hold selects the tab like a tap does.AppRoute.Menu.AccountSelectionscreen opens throughopenAsSheet, and its app bar shows Close. Choosing an account uses the existing logout-and-switch path inApp.kt, which replaces the whole stack, sheet included.The haptic is the one
combinedClickablefires (HapticFeedbackType.LongPress), not a medium impact like iOS's.Tests:
NavigationBarLongPressTest(core-ui, Compose): gate closed means no haptic and no callback; gate open fires both; a tap still selects; the other tabs take no long-press.YouTabLongClickTest(app, Robolectric): gate closed gives no handler; gate open pushesAccountSelectionas a sheet. This addsrobolectricto the app's test dependencies and:shared:userflagsto its implementation dependencies.