fix(savings): keep page mounted on vault switch, show inline skeletons#2085
Merged
Merged
Conversation
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.
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
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
<Skeleton>placeholders while the new vault's balance/transactions refetch, instead of flashing through<Loading />.<ChartFallback />during refetch instead of flashing "No vault breakdown data available".Why
isLoading = isBalanceLoading || isTransactionsLoadingwas passed straight toPageLayout, which swaps the whole subtree for<Loading />. Both queries are keyed by the current vault, so every vault tab click flippedisLoadingtrue 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
useReftracks 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
/savings→ page loader shows once, then content<SavingsEmptyState />after initial load completeshttps://claude.ai/code/session_012rn1TuC6MDpYw9GPrGGFw7
Generated by Claude Code