Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion app/components/Package/TrendsChart.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1682,7 +1682,11 @@ watch(selectedMetric, value => {
</h2>

<!-- Chart panel (active metric) -->
<div role="region" aria-labelledby="trends-chart-title" class="min-h-[260px]">
<div
role="region"
aria-labelledby="trends-chart-title"
:class="isMobile === false && width > 0 ? 'min-h-[567px]' : 'min-h-[260px]'"
>
Comment thread
graphieros marked this conversation as resolved.
<ClientOnly v-if="chartData.dataset">
<div :data-pending="pending" :data-minimap-visible="maxDatapoints > 6">
<VueUiXy
Expand Down
11 changes: 6 additions & 5 deletions app/components/Package/WeeklyDownloadStats.vue
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ const config = computed<VueUiSparklineConfig>(() => {
</script>

<template>
<div class="space-y-8">
<div class="space-y-8 h-[110px] motion-safe:h-[140px]">
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @graphieros, I've noticed that this change causes a large blank area after the "Weekly Downloads" section collapses.

Image

I'm considering moving the height limit (min-h-[110px] motion-safe:min-h-[140px]) into the inner container of CollapsibleSection, but I'm unsure if this complies with the CLS specification.

If it does, please let me know, and I'd be happy to submit a follow-up PR!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes please :)

<CollapsibleSection id="downloads" :title="$t('package.downloads.title')">
<template #actions>
<ButtonBase
Expand Down Expand Up @@ -307,6 +307,10 @@ const config = computed<VueUiSparklineConfig>(() => {
<SkeletonInline class="h-px w-full" />
</div>
</div>
<!-- Animation toggle placeholder -->
<div class="w-full hidden motion-safe:flex flex-1 items-end justify-end">
<SkeletonInline class="h-[20px] w-30" />
</div>
</div>
</template>
</ClientOnly>
Expand Down Expand Up @@ -351,10 +355,7 @@ const config = computed<VueUiSparklineConfig>(() => {

<!-- This placeholder bears the same dimensions as the PackageTrendsChart component -->
<!-- Avoids CLS when the dialog has transitioned -->
<div
v-if="!hasChartModalTransitioned"
class="w-full aspect-[390/634.5] sm:aspect-[718/622.797]"
/>
<div v-if="!hasChartModalTransitioned" class="w-full aspect-[390/634.5] sm:aspect-[718/647]" />
</PackageChartModal>
</template>

Expand Down
Loading