refactor(wallet): replace WalletScreen inline tiles with canonical components (arch P2 #2)#57
Draft
epicexcelsior wants to merge 2 commits into
Draft
refactor(wallet): replace WalletScreen inline tiles with canonical components (arch P2 #2)#57epicexcelsior wants to merge 2 commits into
epicexcelsior wants to merge 2 commits into
Conversation
…ated formatter The inline `relativeTime` helper in RecentActivity.tsx was an exact byte-equivalent duplicate of `src/utils/relTime.ts` (added in PR anonmesh#47). Drop the local copy and import the canonical formatter — same output, one fewer formatter surface to drift. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…mponents (arch P2 #2) Architecture audit Rank #2 — eliminate the divergent "shadow component" copies of BalanceTile / ActionTiles / ActivityTile in WalletScreen.tsx by mounting the canonical components/home/{BalanceCard,ActionRow,RecentActivity} equivalents. Net WalletScreen reduction: 458 → 154 LOC. BalanceCard: - Add explicit eye-toggle + refresh icon buttons (preserves a11y from inline BalanceTile). Long-press hide-balance kept as accelerator. Icons positioned absolute top-right; rendered after the hero Pressable so taps register on the icons, not the outer expand-toggle. - Wire `refetch` from useWalletBalance. ActionRow: - Consume `useNetworkMode`. When mode === "isolated", Send tile renders disabled with a "No route" badge — port of the same render-time gate from inline ActionTiles (ROADMAP § 2.4 / 02-UX P0 anonmesh#6). - Tighten disabled-state accessibilityLabel to include the actual reason ("Send — no route" / "Swap — soon") rather than a blanket "coming soon". WalletScreen: - Outer ScrollView + RefreshControl now wraps the whole content column so pull-to-refresh works anywhere on the page (previously only on the inner activity scroll). - Delete inline BalanceTile (62 LOC), ActionTiles (47 LOC), ActivityTile (113 LOC), the local `relTime`/`fmtSol`/`fmtAmount`/`TOKEN_COLOR` helpers, and ~60 LOC of dead tile styles. - Add accessibilityRole/Label to the receive-QR header button. Visual fidelity: - BalanceCard uses a collapsible token-list (tap chevron) instead of the always-visible horizontal SPL strip from the inline tile. This is a UX upgrade (less clutter at rest) and matches the canonical design system. - Action tiles now use circular icon wells (PressSurface "card" variant) instead of the previous rectangular tiles. Same four actions, same routes, same isolated-mode gating, slightly more breathing room. - RecentActivity rows now show a status Pill (Settled/Failed) and explicit "Sent to <addr>" / "Received from <addr>" labels — a strict superset of the inline activity row info. - Receive modal, header chips, pending-cosigns preview, refresh haptic are all preserved verbatim. Out of scope (pending separate PRs): receive Modal → AppBottomSheet migration, multisig fixture removal. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Summary
BalanceTile/ActionTiles/ActivityTile(arch audit Rank Collaboration Proposal: Trust Stack + Gossip Protocol Integration for AnonMesh #2 — divergent "shadow components") withcomponents/home/{BalanceCard,ActionRow,RecentActivity}.relativeTimeformatter inside RecentActivity; use canonicalsrc/utils/relTime.BalanceCardgains explicit eye + refresh icon buttons (long-press toggle kept as accelerator).ActionRowconsumesuseNetworkModeand disables Send w/ "No route" badge in isolated mode (ROADMAP § 2.4 / 02-UX P0 feat(wallet): live devnet state + send/receive polish #6).ScrollView+RefreshControl(previously only the inner activity list responded).Visual fidelity — minor diff (UX upgrade, not divergence)
PressSurface"card" variant instead of rectangular tiles. Same four actions, same routes, same isolated gating, more breathing room.Pill(Settled/Failed) and explicit "Sent to " / "Received from " labels — strict superset of the inline info.Commits
7679cb8chore(wallet): use src/utils/relTime in RecentActivity; delete duplicated formatter2c2bb5crefactor(wallet): replace WalletScreen inline tiles with canonical components (arch P2 Collaboration Proposal: Trust Stack + Gossip Protocol Integration for AnonMesh #2)Out of scope (separate PRs)
<Modal>→AppBottomSheetmigration.Test plan
npx tsc --noEmit) — verified locallynpx expo lint) — verified locallyrefetchrefetchand disables while loading