Skip to content

feat(home): open the account switcher on a long-press of the You tab - #1624

Merged
bmc08gt merged 1 commit into
code/cashfrom
feat/you-tab-longpress-switcher
Sep 30, 2026
Merged

bmc08gt merged 1 commit into
code/cashfrom
feat/you-tab-longpress-switcher

Conversation

@bmc08gt

@bmc08gt bmc08gt commented Sep 30, 2026

Copy link
Copy Markdown
Collaborator

Long-pressing the You tab now opens the account switcher, as iOS does in HomeTabView.handleLongPress(on:).

  • Only the You tab takes a long-press. Scan, Wallet and Chat don't.
  • The gate is the one that shows Switch Accounts in Advanced Features: the beta-flags override is on, or the user is staff. HomeViewModel.canSwitchAccounts combines the two, so both entry points agree.
  • With the gate closed, NavigationBar gets a null onYouTabLongClick, so the tab has no long-click at all: no haptic, and a long hold selects the tab like a tap does.
  • With the gate open, the existing AppRoute.Menu.AccountSelection screen opens through openAsSheet, and its app bar shows Close. Choosing an account uses the existing logout-and-switch path in App.kt, which replaces the whole stack, sheet included.
  • A tap still selects the tab. The indication stays null, so no ripple is added or lost.

The haptic is the one combinedClickable fires (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 pushes AccountSelection as a sheet. This adds robolectric to the app's test dependencies and :shared:userflags to its implementation dependencies.

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.
@bmc08gt bmc08gt self-assigned this Sep 30, 2026
@github-actions github-actions Bot added the type: feature New functionality label Sep 30, 2026
@bmc08gt
bmc08gt merged commit daa35ad into code/cash Sep 30, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: feature New functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant