fix(ui): reserve loaded-card height on workouts + drug-level loading states

`RecentWorkoutsTile` loading branch and the GLP-1 `DrugLevelChart`
loading branch both rendered an unsized centred spinner / hint, so
the surrounding dashboard layout reflowed once the data resolved.
Add `min-h-[10rem]` to the workouts tile and align the drug-level
loading height with the loaded chart's 240 px so neither tile
shifts the rest of the page when data lands.
This commit is contained in:
Marc-André Bombeck committed 2026-05-21 22:09:12 +02:00
1 parent ae4bfc646e
commit 287eafc47e
2 files changed
+7 -2

No files matched your search

@@ -123,9 +123,12 @@ export function RecentWorkoutsTile() {
</div>
{isLoading ? (
// v1.4.43 W11-L6 — reserve roughly the loaded tile height
// (3 workouts × ~3 rem rows + spacing) so the surrounding
// dashboard layout doesn't reflow once the data lands.
<p
data-slot="recent-workouts-loading"
className="text-muted-foreground text-xs"
className="text-muted-foreground min-h-[10rem] text-xs"
>
{t("dashboard.recentWorkouts.loading")}
</p>
@@ -228,8 +228,10 @@ export function DrugLevelChart({ medication, asOf }: DrugLevelChartProps) {
knownState={researchMode}
/>
) : isLoading ? (
// v1.4.43 W11-L6 — match the loaded chart height (240 px) so the
// dashboard tile doesn't reflow when the levels render.
<div
className="flex h-[220px] items-center justify-center"
className="flex h-[240px] min-h-[240px] items-center justify-center"
data-slot="drug-level-chart-loading"
>
<Loader2 className="text-primary h-6 w-6 animate-spin motion-reduce:animate-none" />