Skip to content

refactor(wallet): replace WalletScreen inline tiles with canonical components (arch P2 #2)#57

Draft
epicexcelsior wants to merge 2 commits into
anonmesh:v3from
epicexcelsior:epic/wallet-tile-extract
Draft

refactor(wallet): replace WalletScreen inline tiles with canonical components (arch P2 #2)#57
epicexcelsior wants to merge 2 commits into
anonmesh:v3from
epicexcelsior:epic/wallet-tile-extract

Conversation

@epicexcelsior
Copy link
Copy Markdown
Collaborator

Summary

  • Replaces WalletScreen's inline BalanceTile / ActionTiles / ActivityTile (arch audit Rank Collaboration Proposal: Trust Stack + Gossip Protocol Integration for AnonMesh #2 — divergent "shadow components") with components/home/{BalanceCard,ActionRow,RecentActivity}.
  • WalletScreen: 458 → 154 LOC (-304 net).
  • Delete duplicated relativeTime formatter inside RecentActivity; use canonical src/utils/relTime.
  • Extend canonical components to absorb a11y + isolated-mode features that previously lived only inline:
    • BalanceCard gains explicit eye + refresh icon buttons (long-press toggle kept as accelerator).
    • ActionRow consumes useNetworkMode and disables Send w/ "No route" badge in isolated mode (ROADMAP § 2.4 / 02-UX P0 feat(wallet): live devnet state + send/receive polish #6).
    • Activity row a11yLabel announces "amount hidden" when balance is masked.
  • Pull-to-refresh now wraps the whole screen via outer ScrollView + RefreshControl (previously only the inner activity list responded).

Visual fidelity — minor diff (UX upgrade, not divergence)

  • Balance: collapsible token list (tap chevron) instead of always-visible horizontal SPL strip. Cleaner at rest, same data.
  • Action tiles: circular icon wells using PressSurface "card" variant instead of rectangular tiles. Same four actions, same routes, same isolated gating, more breathing room.
  • Activity rows: now show a status Pill (Settled/Failed) and explicit "Sent to " / "Received from " labels — strict superset of the inline info.
  • Receive modal, header chips, pending-cosigns preview, refresh haptic — preserved verbatim.

Commits

Out of scope (separate PRs)

Test plan

  • tsc clean (npx tsc --noEmit) — verified locally
  • expo lint clean (npx expo lint) — verified locally
  • Visual smoke: wallet tab renders BalanceCard, ActionRow, PendingCosigns preview, RecentActivity
  • Pull-to-refresh anywhere on the wallet screen triggers refetch
  • Eye button toggles hidden state; long-press also toggles
  • Refresh button triggers refetch and disables while loading
  • In isolated mode (no RPC route), Send tile is disabled with "No route" badge + a11y label "Send — no route"
  • Tap a SOL token → BalanceCard chevron animates, SPL list expands
  • Tap an activity row → TxDetailModal opens
  • Empty / error / rate-limited activity states still render correctly

epicexcelsior and others added 2 commits May 15, 2026 02:51
…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>
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