Skip to content

Commit 06909d3

Browse files
[autofix.ci] apply automated fixes
1 parent b1ddc84 commit 06909d3

File tree

2 files changed

+6
-14
lines changed

2 files changed

+6
-14
lines changed

app/components/Compare/FacetBarChart.vue

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -332,12 +332,8 @@ const config = computed<VueUiHorizontalBarConfig>(() => {
332332
<SkeletonInline class="h-3 w-36 rounded" />
333333
</div>
334334
<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}%` }" />
335+
<div v-for="(pkg, i) in packages" :key="pkg" class="flex items-center gap-3">
336+
<SkeletonInline class="h-3 shrink-0" :style="{ width: `${40 + ((i * 17) % 40)}%` }" />
341337
<SkeletonInline class="h-7 flex-1 rounded" />
342338
</div>
343339
</div>
@@ -352,12 +348,8 @@ const config = computed<VueUiHorizontalBarConfig>(() => {
352348
</div>
353349
<!-- Bar skeletons with varying widths for visual realism -->
354350
<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}%` }" />
351+
<div v-for="(pkg, i) in packages" :key="pkg" class="flex items-center gap-3">
352+
<SkeletonInline class="h-3 shrink-0" :style="{ width: `${40 + ((i * 17) % 40)}%` }" />
361353
<SkeletonInline class="h-7 flex-1 rounded" />
362354
</div>
363355
</div>

test/nuxt/components/compare/FacetBarChart.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ describe('FacetBarChart skeleton loaders', () => {
3131
// The formula used is: width = `${40 + (i * 17) % 40}%`
3232
// For 3 packages: i=0 -> 40%, i=1 -> 57%, i=2 -> 74%
3333
const packages = ['react', 'vue', 'svelte']
34-
const widths = packages.map((_, i) => `${40 + (i * 17) % 40}%`)
34+
const widths = packages.map((_, i) => `${40 + ((i * 17) % 40)}%`)
3535

3636
// Verify they are not all the same (the bug was all bars had the same width)
3737
const uniqueWidths = new Set(widths)
@@ -41,7 +41,7 @@ describe('FacetBarChart skeleton loaders', () => {
4141
it('skeleton width formula produces values within 40-80% range', () => {
4242
const indices = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
4343
for (const i of indices) {
44-
const width = 40 + (i * 17) % 40
44+
const width = 40 + ((i * 17) % 40)
4545
expect(width).toBeGreaterThanOrEqual(40)
4646
expect(width).toBeLessThan(80)
4747
}

0 commit comments

Comments
 (0)