Skip to content

feat(mobile): pull-to-refresh + polling on the dashboard - #587

Open
kaylachi wants to merge 1 commit into
Miracle656:mainfrom
kaylachi:feat/mobile-dashboard-refresh-polling
Open

feat(mobile): pull-to-refresh + polling on the dashboard#587
kaylachi wants to merge 1 commit into
Miracle656:mainfrom
kaylachi:feat/mobile-dashboard-refresh-polling

Conversation

@kaylachi

Copy link
Copy Markdown

Summary

Keeps the mobile dashboard fresh both ways (backlog #34 / #462): an explicit pull gesture and quiet background polling of balance + activity.

Added / changed

  • lib/activity.tsfetchDashboardData(publicKey) loads the account's native XLM balance and its 20 most recent payments from Horizon. The pure mapPayments turns Horizon payment/create_account records into direction-aware activity rows (received-from / sent-to), dropping non-transfer ops. An unfunded account (Horizon 404) reads as a zero balance with no activity, not an error.
  • hooks/usePolling.ts — a ref-backed setInterval (the native stand-in for the web dashboard's service-worker polling) that re-fires every POLL_INTERVAL_MS and never restarts when the callback identity changes; always cleared on unmount / when disabled.
  • app/index.tsx — the placeholder home route is now the dashboard: a balance card + activity feed inside a ScrollView with RefreshControl (pull-to-refresh) and background polling while a wallet is present. Distinct loading / no-wallet / empty / error states.

Testing

  • tsc --noEmit
  • jest lib/__tests__/activity.test.ts ✅ (6/6 — direction, counterparty, non-native asset code, create_account, non-transfer filtering, timestamp conversion)

Closes #462

Turn the placeholder home route into a dashboard that stays fresh two
ways. `lib/activity.ts` loads the account's native XLM balance and recent
payments from Horizon; the pure `mapPayments` turns Horizon records into
direction-aware activity rows. `hooks/usePolling.ts` is a ref-backed
interval that re-fetches quietly every POLL_INTERVAL_MS without
restarting on each render. The screen wraps its ScrollView in a
RefreshControl so a pull refreshes balance + feed, and an unfunded
account reads as a zero balance with no activity rather than an error.

Closes Miracle656#462
@kaylachi
kaylachi requested a review from Miracle656 as a code owner July 29, 2026 17:45
@vercel

vercel Bot commented Jul 29, 2026

Copy link
Copy Markdown

@kaylachi is attempting to deploy a commit to the miracle656's projects Team on Vercel.

A member of the Team first needs to authorize it.

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.

34. Pull-to-refresh + polling

1 participant