Skip to content

fix(lobby): wallet Withdraw quick action lands on the Withdraw tab#28

Merged
netqo merged 1 commit into
devfrom
fix/wallet-tab-deeplink
May 27, 2026
Merged

fix(lobby): wallet Withdraw quick action lands on the Withdraw tab#28
netqo merged 1 commit into
devfrom
fix/wallet-tab-deeplink

Conversation

@netqo
Copy link
Copy Markdown
Owner

@netqo netqo commented May 27, 2026

Summary

  • The lobby's two quick action cards (Deposit / Withdraw) shared the same callback, so tapping Withdraw routed through Route.Wallet and landed on the wallet's default Deposit tab. The mockup carries the target via data-wallet-tab on each button — this PR ports that hint into the navigation layer.

How

  • Route.Wallet now declares the route pattern as wallet?tab={tab} plus a defaultPath = "wallet" so the bottom nav and other generic call sites still navigate to the bare path. Route.Wallet.build(tab) formats the deep-link string when a tab is supplied.
  • WalletScreen takes an initialTab: WalletTab = WalletTab.Deposit param and seeds the existing rememberSaveable from it.
  • StackNavHost registers the wallet composable with a nullable tab arg, parses it back into the enum (falls back to Deposit on unknown values) and forwards it to the screen.
  • LobbyScreen exposes a new onOpenWallet(initialTab: String?) callback; the Deposit and Withdraw quick actions wire to it with "Deposit" and "Withdraw" respectively. Other navigations (FAB, games, view-all) keep going through the generic onNavigate(Route).
  • The generic onNavigate lambdas in StackApp + StackNavHost now use route.defaultPath so future parametric routes do not need to touch every call site.

Test plan

  • ./gradlew assembleDebug
  • ./gradlew ktlintCheck
  • ./gradlew detekt
  • ./gradlew testDebugUnitTest
  • On device: lobby quick action Deposit -> Wallet on Deposit tab; lobby quick action Withdraw -> Wallet on Withdraw tab; bottom-nav Wallet still lands on Deposit.

The lobby's Withdraw quick action used to share the same callback as
Deposit, so tapping it landed on the wallet's default Deposit tab.

  * Route.Wallet now carries an optional `?tab={tab}` query arg plus
    a `defaultPath` field so bottom-nav + generic navigation still
    target plain "wallet" without dragging the placeholder along.
  * WalletScreen accepts an `initialTab` param that seeds the
    `rememberSaveable` tab state.
  * StackNavHost registers the wallet composable with the nullable
    arg, parses it back into WalletTab, and forwards it.
  * LobbyScreen exposes a dedicated `onOpenWallet(initialTab)` so
    the two quick action cards can deep-link independently:
    Deposit -> "Deposit", Withdraw -> "Withdraw".
  * StackApp + LobbyScreen's generic navigate lambdas now route via
    `route.defaultPath` so adding parametric query args to other
    routes later does not require touching every call site.
@netqo netqo merged commit e6bde7f into dev May 27, 2026
2 checks passed
@netqo netqo deleted the fix/wallet-tab-deeplink branch May 27, 2026 22:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant