feat: add per-widget refresh controls with stale-data indicators#677
Merged
Junirezz merged 2 commits intoJun 1, 2026
Merged
Conversation
Junirezz#574 Documentation: Add environment variable reference table for backend and frontend #closes 574
…irezz#546) - Add RefreshControl + stale indicator to VaultDashboard stats panel (TVL/APY widget) using usePolling(refresh, 30s) from VaultContext - Add RefreshControl + stale indicator to Analytics page stats section using the same VaultContext refresh/lastUpdate - Add RefreshControl + stale indicator to APYTrendChart with a local refresh function that updates the lastUpdated timestamp - Fix useStaleIndicator: cache snapshot result to prevent useSyncExternalStore infinite re-render loop when getSnapshot returns new object references - Memoize lastUpdate in VaultContext to prevent unnecessary re-renders Closes Junirezz#546
|
@temi-Dee 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! 🚀 |
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
Implements per-widget refresh controls with stale-data indicators across the frontend, resolving #546.
Changes
VaultDashboard stats panel (TVL/APY widget)
RefreshControl+ stale indicator below the stats headerVaultContext.refreshviausePolling(30s interval, pauses on hidden/offline)useStaleIndicator(lastUpdate)from VaultContextAnalytics page stats section
RefreshControl+ stale indicator above the stats cardsAPYTrendChart
RefreshControl+ stale indicator above the chartrefreshFnthat updates alastUpdatedtimestamp (data is static/mock)Bug fixes
useStaleIndicator: cached snapshot result to preventuseSyncExternalStoreinfinite re-render loop (new object reference on everygetSnapshotcall)lastUpdateinVaultContextto prevent unnecessary re-rendersNote:
VaultPerformanceChartalready hadRefreshControlintegrated prior to this PR.Testing
Test suite: 8 failed files / 56 failed tests before and after — no regressions introduced. All pre-existing failures are unrelated to this change (missing
QueryClientProvider/PreferencesProviderin test wrappers).Closes #546