Skip to content

Commit ca144b1

Browse files
committed
fix: improve compare bar chart skeleton loaders with varying widths (#2106)
1 parent 662c37f commit ca144b1

File tree

1 file changed

+26
-10
lines changed

1 file changed

+26
-10
lines changed

app/components/Compare/FacetBarChart.vue

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -327,23 +327,39 @@ const config = computed<VueUiHorizontalBarConfig>(() => {
327327
</VueUiHorizontalBar>
328328

329329
<template #fallback>
330-
<div class="flex flex-col gap-2 justify-center items-center mb-2">
331-
<SkeletonInline class="h-4 w-16" />
332-
<SkeletonInline class="h-4 w-28" />
330+
<div class="flex flex-col gap-2 justify-center items-center mb-4" aria-hidden="true">
331+
<SkeletonInline class="h-4 w-20 rounded" />
332+
<SkeletonInline class="h-3 w-36 rounded" />
333333
</div>
334-
<div class="flex flex-col gap-1">
335-
<SkeletonInline class="h-7 w-full" v-for="pkg in packages" :key="pkg" />
334+
<div class="flex flex-col gap-2 px-2" aria-hidden="true">
335+
<div
336+
v-for="(pkg, i) in packages"
337+
:key="pkg"
338+
class="flex items-center gap-3"
339+
>
340+
<SkeletonInline class="h-3 shrink-0" :style="{ width: `${40 + (i * 17) % 40}%` }" />
341+
<SkeletonInline class="h-7 flex-1 rounded" />
342+
</div>
336343
</div>
337344
</template>
338345
</ClientOnly>
339346

340347
<template v-else>
341-
<div class="flex flex-col gap-2 justify-center items-center mb-2">
342-
<SkeletonInline class="h-4 w-16" />
343-
<SkeletonInline class="h-4 w-28" />
348+
<!-- Title skeleton -->
349+
<div class="flex flex-col gap-2 justify-center items-center mb-4" aria-hidden="true">
350+
<SkeletonInline class="h-4 w-20 rounded" />
351+
<SkeletonInline class="h-3 w-36 rounded" />
344352
</div>
345-
<div class="flex flex-col gap-1">
346-
<SkeletonInline class="h-7 w-full" v-for="pkg in packages" :key="pkg" />
353+
<!-- Bar skeletons with varying widths for visual realism -->
354+
<div class="flex flex-col gap-2 px-2" aria-hidden="true">
355+
<div
356+
v-for="(pkg, i) in packages"
357+
:key="pkg"
358+
class="flex items-center gap-3"
359+
>
360+
<SkeletonInline class="h-3 shrink-0" :style="{ width: `${40 + (i * 17) % 40}%` }" />
361+
<SkeletonInline class="h-7 flex-1 rounded" />
362+
</div>
347363
</div>
348364
</template>
349365
</div>

0 commit comments

Comments
 (0)