From 425beecfa78e98792b89ad8f3b75ada21082c171 Mon Sep 17 00:00:00 2001 From: Brandon McAnsh Date: Wed, 12 Aug 2026 12:20:20 -0400 Subject: [PATCH] fix(wallet): match iOS token order and card-stack spacing Sort balances descending by exact native value, tiebreaking on token name instead of mint address, so equal-value tokens (e.g. LaunchIt / Teddies) order the same as iOS Session.balances. Add a top inset and extra bottom content padding to the wallet list and trim the header spacer so the token-card stack fully collapses, with the spacing above the stack and below the last recent row matching iOS. --- .../flipcash/app/balance/internal/WalletScreenContent.kt | 6 ++++-- .../com/flipcash/app/tokens/ui/SelectTokenViewModel.kt | 7 +++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/apps/flipcash/features/balance/src/main/kotlin/com/flipcash/app/balance/internal/WalletScreenContent.kt b/apps/flipcash/features/balance/src/main/kotlin/com/flipcash/app/balance/internal/WalletScreenContent.kt index 504a59d3a2..596e624e05 100644 --- a/apps/flipcash/features/balance/src/main/kotlin/com/flipcash/app/balance/internal/WalletScreenContent.kt +++ b/apps/flipcash/features/balance/src/main/kotlin/com/flipcash/app/balance/internal/WalletScreenContent.kt @@ -26,6 +26,7 @@ import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.vector.rememberVectorPainter import androidx.compose.ui.res.stringResource +import androidx.compose.ui.unit.dp import androidx.lifecycle.compose.collectAsStateWithLifecycle import com.flipcash.app.core.AppRoute import com.flipcash.app.core.ui.TokenCardStack @@ -73,13 +74,14 @@ internal fun WalletScreenContent( state = listState, modifier = Modifier.fillMaxSize(), contentPadding = PaddingValues( + top = CodeTheme.dimens.inset, start = CodeTheme.dimens.inset, end = CodeTheme.dimens.inset, - bottom = LocalTabBarPadding.current.calculateBottomPadding(), + bottom = LocalTabBarPadding.current.calculateBottomPadding() + CodeTheme.dimens.grid.x12, ) ) { item { - Spacer(Modifier.height(CodeTheme.dimens.grid.x20)) + Spacer(Modifier.height(CodeTheme.dimens.grid.x15)) } item { diff --git a/apps/flipcash/shared/tokens/src/main/kotlin/com/flipcash/app/tokens/ui/SelectTokenViewModel.kt b/apps/flipcash/shared/tokens/src/main/kotlin/com/flipcash/app/tokens/ui/SelectTokenViewModel.kt index 1472e50f1e..f55f61d36b 100644 --- a/apps/flipcash/shared/tokens/src/main/kotlin/com/flipcash/app/tokens/ui/SelectTokenViewModel.kt +++ b/apps/flipcash/shared/tokens/src/main/kotlin/com/flipcash/app/tokens/ui/SelectTokenViewModel.kt @@ -163,8 +163,11 @@ class SelectTokenViewModel @Inject constructor( ) } .sortedWith( - compareByDescending { it.balance.nativeAmount.rounded() } - .thenBy { it.token.address.base58() } + // Match iOS (Session.balances): descending by exact value, then + // alphabetical by name (not by mint address, which reordered equal-value + // tokens like LaunchIt/Teddies differently than iOS). + compareByDescending { it.balance.nativeAmount } + .thenBy { it.token.name } ) .filter { val hasBalance = it.balance.nativeAmount.hasDisplayableValue