Skip to content

Commit a0ed79d

Browse files
committed
fix: skeleton CLS for facet bars
1 parent 07d374b commit a0ed79d

File tree

1 file changed

+9
-21
lines changed

1 file changed

+9
-21
lines changed

app/components/Compare/FacetBarChart.vue

Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,9 @@ const config = computed<VueUiHorizontalBarConfig>(() => {
170170
style: {
171171
chart: {
172172
backgroundColor: colors.value.bg,
173+
legend: {
174+
show: false,
175+
},
173176
},
174177
},
175178
},
@@ -278,7 +281,7 @@ const config = computed<VueUiHorizontalBarConfig>(() => {
278281

279282
<template>
280283
<div class="font-mono facet-bar">
281-
<ClientOnly v-if="dataset.length">
284+
<ClientOnly v-if="packages.length">
282285
<VueUiHorizontalBar :key="chartKey" :dataset :config class="[direction:ltr]">
283286
<template #hint="{ isVisible }">
284287
<p v-if="isVisible" class="text-accent text-xs pt-2" aria-hidden="true">
@@ -339,28 +342,13 @@ const config = computed<VueUiHorizontalBarConfig>(() => {
339342
aria-hidden="true"
340343
/>
341344
</template>
342-
</VueUiHorizontalBar>
343345

344-
<template #fallback>
345-
<div class="flex flex-col gap-2 justify-center items-center mb-2">
346-
<SkeletonInline class="h-4 w-16" />
347-
<SkeletonInline class="h-4 w-28" />
348-
</div>
349-
<div class="flex flex-col gap-1">
350-
<SkeletonInline class="h-7 w-full" v-for="pkg in packages" :key="pkg" />
351-
</div>
352-
</template>
346+
<template #skeleton>
347+
<!-- This empty div overrides the default built-in scanning animation on load -->
348+
<div />
349+
</template>
350+
</VueUiHorizontalBar>
353351
</ClientOnly>
354-
355-
<template v-else>
356-
<div class="flex flex-col gap-2 justify-center items-center mb-2">
357-
<SkeletonInline class="h-4 w-16" />
358-
<SkeletonInline class="h-4 w-28" />
359-
</div>
360-
<div class="flex flex-col gap-1">
361-
<SkeletonInline class="h-7 w-full" v-for="pkg in packages" :key="pkg" />
362-
</div>
363-
</template>
364352
</div>
365353
</template>
366354

0 commit comments

Comments
 (0)