Skip to content

Commit fc6a2e4

Browse files
jhfclaude
andcommitted
ui: Add loading skeletons to reports drilldown charts
The chart containers showed empty grey boxes for ~5s while the drilldown data loaded. Show animated skeleton placeholders during the loading state so the user gets immediate visual feedback. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 1bc33be commit fc6a2e4

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

app/src/app/reports/ReportsPageClient.tsx

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export default function ReportsPageClient({
1717
const [maxStatValuesNoFiltering, setMaxStatValuesNoFiltering] = useState<Record<string, { region: number, activity: number }>>({});
1818
const {
1919
drillDown,
20+
isLoading,
2021
region,
2122
setRegion,
2223
activityCategory,
@@ -120,7 +121,7 @@ export default function ReportsPageClient({
120121
className="space-y-8"
121122
>
122123
<div className="space-y-6 bg-gray-50 p-4">
123-
{drillDown && (
124+
{drillDown ? (
124125
<>
125126
<BreadCrumb
126127
topLevelText="All Regions"
@@ -140,10 +141,15 @@ export default function ReportsPageClient({
140141
<Skeleton className="w-full h-[200px]" />
141142
)}
142143
</>
143-
)}
144+
) : isLoading ? (
145+
<div className="space-y-3">
146+
<Skeleton className="h-5 w-32" />
147+
<Skeleton className="w-full h-[200px]" />
148+
</div>
149+
) : null}
144150
</div>
145151
<div className="bg-gray-50 p-6">
146-
{drillDown && (
152+
{drillDown ? (
147153
<>
148154
<BreadCrumb
149155
topLevelText="All Activity Categories"
@@ -163,7 +169,12 @@ export default function ReportsPageClient({
163169
<Skeleton className="w-full h-[200px]" />
164170
)}
165171
</>
166-
)}
172+
) : isLoading ? (
173+
<div className="space-y-3">
174+
<Skeleton className="h-5 w-48" />
175+
<Skeleton className="w-full h-[200px]" />
176+
</div>
177+
) : null}
167178
</div>
168179
</TabsContent>
169180
))}

0 commit comments

Comments
 (0)