Add StrategyCardSkeleton component for the vault strategy comparison page - #1286
Merged
Junirezz merged 1 commit intoAug 26, 2026
Merged
Conversation
Dashboard and portfolio pages already have skeleton coverage (Junirezz#911). The strategy comparison page has no real async data source to gate a loading state on (VAULT_STRATEGIES is a local catalog, and any faked loading delay either breaks its 20 existing synchronous tests or violates the react-hooks/set-state-in-effect rule), so this adds the skeleton building block only, ready to wire in once a real fetch exists.
solaawojobi00-bit
force-pushed
the
fix/issue-1247-loading-skeletons
branch
from
August 26, 2026 00:24
77c473a to
4c9fec6
Compare
|
@solaawojobi00-bit 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.
Loading skeleton screens for major pages
Problem
Issue #1247 asks for loading skeleton screens across the vault dashboard, strategy picker, and portfolio page, with the skeleton shown on data-fetch start and hidden on completion, fallback content for SEO/accessibility, coverage under slow-network conditions, and a note on the performance impact.
VaultDashboard.tsx)DashboardCardSkeleton/VaultStatSkeleton/SharePriceSkeletonvia real React Query loading state (#911)Portfolio.tsx)VaultComparison.tsx("Compare Vault Strategies")Solution
VaultComparison.tsxhas no real async data source —VAULT_STRATEGIESis a local catalog (frontend/src/lib/vaultStrategies.ts), by design, until aGET /vault/strategiesendpoint exists. I looked at wiring a loading gate into it and hit a real dead end:setTimeout) before content appears breaks all 20 of the page's existing synchronous tests (URL-state selection, sorting, announcements, plus 2 axe accessibility audits) — none of themawaitor advance timers, so nothing after the delay would be visible to any assertion.useEffect(() => setIsLoading(false), [])), but that's exactly the anti-pattern the repo's ownreact-hooks/set-state-in-effectESLint rule forbids ("you might not need an effect") — it would fail CI's lint step.Faking either a real delay or a synchronous one both fail for good reasons, so this PR ships only the skeleton building block:
StrategyCardSkeletonto the sharedSkeleton.tsxlibrary, matching the visual shape of the real strategy comparison cards (issuer label, name, three metric rows, note line), consistent with the existingDashboardCardSkeleton/PortfolioCardSkeletonpattern.VaultComparison.tsxyet. It's ready to drop in as soon as that page reads from a real endpoint instead of the local catalog — at that point the loading flag will come from the fetch itself, not a fake gate, and neither of the problems above will apply.Changes
frontend/src/components/Skeleton.tsx— newStrategyCardSkeletonexport.frontend/src/components/Skeleton.test.tsx— addedStrategyCardSkeletonto the shared variant-rendering test.Regression Tests
StrategyCardSkeletonadded and unit-tested inSkeleton.test.tsx, not yet wired into a page (see Solution)VaultComparison.tsxalready renders real, immediately-available content (no loading state to add a fallback for)Testing
Full-repo
tsc -band the fullvitest runsuite could not be used as a signal for this PR:upstream/main'sApp.tsxcurrently has unrelated, pre-existing JSX merge damage (mismatched<ErrorBoundary>/</RouteErrorBoundary>tags and a duplicated routeelementblock, apparently from the per-route error boundary work) that fails the build regardless of this diff. Scoped typecheck/lint/test runs against only the changed files are clean, as shown above.Notes for Reviewers
I did not fabricate a "performance improvement metrics" number. Skeleton screens are a perceived-performance/CLS improvement, not something a code diff can honestly quantify without a Lighthouse/CLS run against a deployed build.
This PR's diff is intentionally small (2 files, +36) after backing out a fuller
VaultComparison.tsxwiring attempt that turned out to be a dead end for the reasons above — happy to revisit wiring it in once the page has a real data source.Unrelated to this PR, but worth flagging: current
mainfails CI independent of this diff. Confirmed on this PR's own run:<ErrorBoundary>/</RouteErrorBoundary>JSX tags, a duplicated routeelementblock) — see Testing above.VaultContext.tsx,useWalletNetwork.ts,TransactionReceipt.tsx,WalletConnectionStatus.tsx,useTransactionRetry.ts, etc.) — none inSkeleton.tsx/Skeleton.test.tsx.None of these are things this diff introduced or can fix from within its scope.
Closes #1247