feat(wallet): v2 token cards + collapsing stack - #560
Merged
Merged
Conversation
bmc08gt
force-pushed
the
feat/v2-ui-token-cards
branch
2 times, most recently
from
August 12, 2026 14:44
57f65e0 to
0ff24cf
Compare
Port Android's TokenCard/TokenCardStack: - TokenCardView — a bill-style card painting a horizontal gradient from the token's bill-customization colors (USDF's fixed gold, a dark-green fallback), with the token icon + name, an appreciation pill, and an autosizing balance. - TokenCardStack — a fanning deck that collapses then scrolls off as the list scrolls, driven by a scrolled-past offset. Reimplemented with offset placement (not SwiftUI's Layout) to keep the iOS 15 deployment target. - Session.billColors(for:) resolves a mint's stored bill palette.
The v2 Wallet tab now renders the big-balance header (reused BalanceHeaderButton + appreciation) over the collapsing TokenCardStack, tapping a card into currency info, with an add-money affordance and empty state. Balances are projected to card data once per change (resolving each token's bill colors) rather than per body eval. HomeTabView's Wallet tab switches from the embedded BalanceScreen to WalletScreen. The appreciation pill always shows; a rounds-to-zero value reads as positive (+$0.00), never -$0.00.
- Hide the navigation bar on the v2 Wallet root (per Figma) so the balance header sits directly under the status bar; pushed destinations keep theirs. - Rework the TokenCardStack scroll tracking from a named coordinate space (which wasn't updating scrolledPast, so the deck never collapsed) to global coordinates: an outer GeometryReader captures the fixed viewport top and the stack reports its global top as it scrolls, giving a reliable scrolled-past offset that drives the collapse.
The collapse never fired because a GeometryReader in scroll content only emits its preference at layout time, not during scroll (confirmed: the offset preference fired exactly once and stayed 0 through a full scroll) — so scrolledPast was always 0. Drive it instead from the underlying UIScrollView.contentOffset via KVO (ScrollOffsetReader), which updates every scroll frame. The collapse threshold is the measured header height, so the deck tightens once the stack reaches the top.
The bar was undersized: 26pt icons in a ~50pt bar. Match the Figma tab bar (node 8966:1557) — 32pt icons in 50pt items (9pt vertical padding) inside the 4pt-padded capsule, for a 58pt overall height.
Inset the bar ~42pt per side (was 20pt) so it renders ~318pt wide on the 402pt reference frame, matching the floating pill in the Figma.
bmc08gt
force-pushed
the
feat/v2-ui-token-cards
branch
from
August 12, 2026 14:53
0ff24cf to
613d21c
Compare
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.
What
Phase 2 of the v2 UI port (Android #1209): token cards + collapsing stack for the v2 Wallet tab, plus the fixes that came out of review.
Stacked on #559 (v2 nav shell) — review/merge that first; this targets it.
Changes
TokenCardView— bill-style card: horizontal gradient from the token's bill-customization colors, USDF gold, dark-green fallback; icon + name, appreciation pill, autosizing balance.TokenCardStack— fanning deck that collapses into a tightening deck then scrolls off, driven by a scrolled-past offset. Reimplemented withoffsetplacement (not SwiftUI'sLayout) for the iOS 15 target.WalletScreen— the v2 Wallet tab: big-balance header over the card stack, card tap → currency info, add-money, no top bar (per Figma).UIScrollView.contentOffset(KVO) — SwiftUIGeometryReaderpreferences in scroll content only fire at layout, not during scroll, so the deck never collapsed; the KVO bridge (ScrollOffsetReader) updates every frame. Verified with real drag gestures (Maestro).Testing
xcodebuild build: SUCCEEDED.+$0.00), autosizing balances.