fix(dashboard): render risk overview shell while data loads#3017
fix(dashboard): render risk overview shell while data loads#3017simplesagar wants to merge 1 commit into
Conversation
Mirror the project-home pattern: always render both Page.Section blocks on /risk-overview and swap individual metric/chart card bodies for skeletons during the initial fetch. Also pass placeholderData: keepPreviousData to useRiskOverview so changing the time range no longer blanks the page after first load. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.
Tip: disable this comment in your organization's Code Review settings.
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🚀 Preview Environment (PR #3017)Preview URL: https://pr-3017.dev.getgram.ai
Gram Preview Bot |
Summary
/risk-overviewwas collapsing to aLoading…blob and hiding the entire Policy Activity section until data arrived, which felt slow on first paint and blinked on every time-range change.ProjectDashboard(project home) uses: always render bothPage.Sectionblocks, swap each KPI card / ranked list / trend chart's body for a<Skeleton>while the data is loading, and only collapse toNoPoliciesEmptyStateonce data has actually arrived.placeholderData: keepPreviousDatatouseRiskOverviewso date-range changes don't blank the page after the first successful load.useRiskOverview(unlike the project-overview hook) includesfrom/toin its query key, so without this every range change re-triggersisLoading=true.InsightsConfignow mounts only whenoverviewis populated so itscontextInfonever embeds undefined counts.Test plan
/risk-overview— confirm the page header, both section headers, KPI grid skeletons, three ranked-list card skeletons, and the chart skeleton all paint immediately; noLoading…text.MetricCard/RankedBarList/RiskTrendChartwith no layout shift.NoPoliciesEmptyStatestill renders for a project withactivePolicies === 0.🤖 Generated with Claude Code