Skip to content

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

Merged
Miracle656 merged 1 commit into
Miracle656:mainfrom
kaylachi:feat/mobile-dashboard-refresh-polling
Aug 9, 2026
Merged

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

Conversation

@kaylachi

Copy link
Copy Markdown
Contributor

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

@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.

@Miracle656

Copy link
Copy Markdown
Owner

Thanks! This needs a rebase — main has moved a lot on the dashboard since this branch was cut (app/(tabs)/dashboard.tsx and the activity/polling stores landed in early August). Could you rebase onto main and confirm what pull-to-refresh/polling here is still net-new versus what already ships? Happy to re-review once it applies cleanly.

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 force-pushed the feat/mobile-dashboard-refresh-polling branch from 3585544 to 53574ec Compare August 9, 2026 08:42
@drips-wave

drips-wave Bot commented Aug 9, 2026

Copy link
Copy Markdown

@kaylachi Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@kaylachi

kaylachi commented Aug 9, 2026

Copy link
Copy Markdown
Contributor Author

Hi! I've rebased this branch onto main. The background polling of the activity feed is indeed already handled on main via useInitActivityFeed. I've reconciled this PR by adding background polling for the XLM balance itself and wiring the dashboard gesture to pull-to-refresh (which refreshes both the balance and the activity feed). Ready for another look!

@Miracle656
Miracle656 merged commit de63099 into Miracle656:main Aug 9, 2026
11 of 15 checks passed
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

2 participants