Skip to content

fix(savings): keep page mounted on vault switch, show inline skeletons#2085

Merged
MusabShakeel576 merged 1 commit into
qafrom
claude/fix-vault-switch-preloader-oX5Fh-qa
May 20, 2026
Merged

fix(savings): keep page mounted on vault switch, show inline skeletons#2085
MusabShakeel576 merged 1 commit into
qafrom
claude/fix-vault-switch-preloader-oX5Fh-qa

Conversation

@MusabShakeel576
Copy link
Copy Markdown
Contributor

Summary

  • Switching vault tabs on the savings page no longer unmounts the entire page — only the very first visit shows the full-page loader.
  • Total Value and Interest Earned now render inline <Skeleton> placeholders while the new vault's balance/transactions refetch, instead of flashing through <Loading />.
  • Vault Breakdown analytics tab now shows <ChartFallback /> during refetch instead of flashing "No vault breakdown data available".

Why

isLoading = isBalanceLoading || isTransactionsLoading was passed straight to PageLayout, which swaps the whole subtree for <Loading />. Both queries are keyed by the current vault, so every vault tab click flipped isLoading true and tore down the page — including the reanimated vault cards, count-up numbers, and analytics chart. On Android that remount cycle over the JS/native bridge felt stuck.

A useRef tracks whether the page has ever finished loading; only the initial render shows the page loader. Subsequent refetches keep the page mounted and render skeletons in the affected slots.

Test plan

  • Web: visit /savings → page loader shows once, then content
  • Web: click between USDC / FUSE / ETH → vault cards stay in place, Total Value and Interest Earned show skeletons only, page does not blink
  • Web: switch to Vault Breakdown tab, then change vaults → loading spinner shows instead of "No vault breakdown data available"
  • Android native: switch vaults rapidly → no stuck/frozen state, animations remain smooth
  • Empty-state user (no balance anywhere) still sees <SavingsEmptyState /> after initial load completes

https://claude.ai/code/session_012rn1TuC6MDpYw9GPrGGFw7


Generated by Claude Code

PageLayout was unmounting the entire savings page whenever isBalanceLoading
or isTransactionsLoading flipped true — which now fires on every vault tab
switch since both queries are keyed by the current vault. On Android this
remounts the reanimated vault cards and analytics chart and feels stuck.

Only show the full-page loader on the very first load (tracked via a ref).
Subsequent vault switches keep the page mounted and render skeletons in
the Total Value / Interest Earned slots while the new vault's data loads.
Also surface a loading state on the Vault Breakdown tab so it stops
flashing "No vault breakdown data available" during the switch.
@vercel
Copy link
Copy Markdown

vercel Bot commented May 20, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Actions Updated (UTC)
solid-app Ignored Ignored May 20, 2026 12:28pm
solid-app-staging Ignored Ignored May 20, 2026 12:28pm

Request Review

@MusabShakeel576 MusabShakeel576 merged commit 99c8e36 into qa May 20, 2026
4 of 5 checks passed
@MusabShakeel576 MusabShakeel576 deleted the claude/fix-vault-switch-preloader-oX5Fh-qa branch May 20, 2026 12:31
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.

2 participants