Skip to content

Commit c0c9ff2

Browse files
fix: address CLS in downloads modal (#1619)
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
1 parent f4943b9 commit c0c9ff2

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

app/components/Package/TrendsChart.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1682,7 +1682,11 @@ watch(selectedMetric, value => {
16821682
</h2>
16831683

16841684
<!-- Chart panel (active metric) -->
1685-
<div role="region" aria-labelledby="trends-chart-title" class="min-h-[260px]">
1685+
<div
1686+
role="region"
1687+
aria-labelledby="trends-chart-title"
1688+
:class="isMobile === false && width > 0 ? 'min-h-[567px]' : 'min-h-[260px]'"
1689+
>
16861690
<ClientOnly v-if="chartData.dataset">
16871691
<div :data-pending="pending" :data-minimap-visible="maxDatapoints > 6">
16881692
<VueUiXy

app/components/Package/WeeklyDownloadStats.vue

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ const config = computed<VueUiSparklineConfig>(() => {
264264
</script>
265265

266266
<template>
267-
<div class="space-y-8">
267+
<div class="space-y-8 h-[110px] motion-safe:h-[140px]">
268268
<CollapsibleSection id="downloads" :title="$t('package.downloads.title')">
269269
<template #actions>
270270
<ButtonBase
@@ -307,6 +307,10 @@ const config = computed<VueUiSparklineConfig>(() => {
307307
<SkeletonInline class="h-px w-full" />
308308
</div>
309309
</div>
310+
<!-- Animation toggle placeholder -->
311+
<div class="w-full hidden motion-safe:flex flex-1 items-end justify-end">
312+
<SkeletonInline class="h-[20px] w-30" />
313+
</div>
310314
</div>
311315
</template>
312316
</ClientOnly>
@@ -351,10 +355,7 @@ const config = computed<VueUiSparklineConfig>(() => {
351355

352356
<!-- This placeholder bears the same dimensions as the PackageTrendsChart component -->
353357
<!-- Avoids CLS when the dialog has transitioned -->
354-
<div
355-
v-if="!hasChartModalTransitioned"
356-
class="w-full aspect-[390/634.5] sm:aspect-[718/622.797]"
357-
/>
358+
<div v-if="!hasChartModalTransitioned" class="w-full aspect-[390/634.5] sm:aspect-[718/647]" />
358359
</PackageChartModal>
359360
</template>
360361

0 commit comments

Comments
 (0)