fix(dashboard): show QueryError fallback when data fetches fail#85
Open
omipheo wants to merge 1 commit into
Open
fix(dashboard): show QueryError fallback when data fetches fail#85omipheo wants to merge 1 commit into
omipheo wants to merge 1 commit into
Conversation
useApiQuery has retry: false, so the first failed fetch left dashboard panels stuck on a shimmer skeleton with no recovery path: users had to reload the page to retry, and they had no signal that anything had gone wrong. Adds a small shared QueryError component (icon + label + Retry button, styled to match the existing card chrome) and wires it into each consumer that renders a skeleton: StatsPanel, MinerRatesTable, OrderbookDepth, EventFeed, SwapTracker, and the SwapDetailPage. Each consumer destructures isError + refetch from useApiQuery and renders QueryError only when the query has errored AND has no data to fall back on. SwapDetailPage renders the fallback inside PageWrapper so the header and back-link stay in place. Refetch failures while data already exists stay silent, so the existing keepPreviousData behavior is preserved and the panels don't flash an error over a working view during a transient SSE/network blip. Out of scope (per the issue): no change to useApiQuery's retry policy, no global ErrorBoundary, no telemetry hook, no SSE-reconnect timer. Closes entrius#34
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
Closes #34.
useApiQueryhasretry: false, so the first failed fetch leavesdashboard panels stuck on a shimmer skeleton with no recovery path.
Users have to reload the page to retry, and they have no signal that
anything went wrong.
This PR adds a small shared
QueryErrorcomponent (icon + label +Retry button, styled to match the existing card chrome) and wires it
into each consumer that renders a skeleton today:
StatsPanel,MinerRatesTable,OrderbookDepth,EventFeed,SwapTracker, andSwapDetailPage.Behavior
isErrorandrefetchfromuseApiQueryand short-circuits to<QueryError onRetry={refetch} />whenisError && !data. ClickingRetry re-runs the query.
keepPreviousDatabehavior is preserved, so a transient SSE / networkblip doesn't flash an error over a working view.
SwapDetailPage. The fallback renders inside<PageWrapper>sothe back-link and page chrome stay in place.
Out of scope (per the issue)
useApiQuery'sretry: falsepolicy.ErrorBoundaryfor render-time errors.Files
src/components/QueryError.tsx(new)src/components/index.tssrc/components/dashboard/StatsPanel.tsxsrc/components/dashboard/MinerRatesTable.tsxsrc/components/dashboard/OrderbookDepth.tsxsrc/components/dashboard/EventFeed.tsxsrc/components/dashboard/SwapTracker.tsxsrc/pages/SwapDetailPage.tsxVerification
npm run build— passes (TypeScript + Vite, 3.32 s).npm run lint— passes (ESLint, no warnings).npm run format:check— passes (Prettier).dropped fetch now shows the retry fallback; clicking Retry recovers
without a page reload.
Notes
This supersedes #36 (
wmagev), which is currentlymergeable: dirtyagainst
testand has been untouched since 2026-04-21.