Skip to content

Commit e14f3fa

Browse files
committed
feat: increase max package compares to 10
1 parent 3d42fbf commit e14f3fa

File tree

4 files changed

+7
-8
lines changed

4 files changed

+7
-8
lines changed

app/components/Compare/PackageSelector.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const props = defineProps<{
88
max?: number
99
}>()
1010
11-
const maxPackages = computed(() => props.max ?? 4)
11+
const maxPackages = computed(() => props.max ?? MAX_PACKAGE_SELECTION)
1212
1313
// Input state
1414
const inputValue = shallowRef('')

app/components/Package/TrendsChart.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1895,7 +1895,7 @@ const isSparklineLayout = computed({
18951895
<div
18961896
role="region"
18971897
aria-labelledby="trends-chart-title"
1898-
:class="
1898+
:class="isSparklineLayout || !inModal ? undefined:
18991899
isMobile === false && width > 0
19001900
? showCorrectionControls
19011901
? 'h-[491px]'

app/composables/usePackageSelection.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export const MAX_PACKAGE_SELECTION = 4
1+
export const MAX_PACKAGE_SELECTION = 10
22

33
export function usePackageSelection() {
44
const selectedPackagesParam = useRouteQuery<string>('selection', '', { mode: 'replace' })

app/pages/compare.vue

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ definePageMeta({
1010
1111
const { locale } = useI18n()
1212
const { copied, copy } = useClipboard({ copiedDuring: 2000 })
13-
const maxPackages = 4
1413
1514
// Sync packages with URL query param (stable ref - doesn't change on other query changes)
1615
const packagesParam = useRouteQuery<string>('packages', '', { mode: 'replace' })
@@ -23,7 +22,7 @@ const packages = computed({
2322
.split(',')
2423
.map(p => p.trim())
2524
.filter(p => p.length > 0)
26-
.slice(0, maxPackages)
25+
.slice(0, MAX_PACKAGE_SELECTION)
2726
},
2827
set(value) {
2928
packagesParam.value = value.length > 0 ? value.join(',') : ''
@@ -61,12 +60,12 @@ const gridColumns = computed(() =>
6160
6261
// Whether we can add the no-dep column (not already added and have room)
6362
const canAddNoDep = computed(
64-
() => packages.value.length < maxPackages && !packages.value.includes(NO_DEPENDENCY_ID),
63+
() => packages.value.length < MAX_PACKAGE_SELECTION && !packages.value.includes(NO_DEPENDENCY_ID),
6564
)
6665
6766
// Add "no dependency" column to comparison
6867
function addNoDep() {
69-
if (packages.value.length >= maxPackages) return
68+
if (packages.value.length >= MAX_PACKAGE_SELECTION) return
7069
if (packages.value.includes(NO_DEPENDENCY_ID)) return
7170
packages.value = [...packages.value, NO_DEPENDENCY_ID]
7271
}
@@ -183,7 +182,7 @@ useSeoMeta({
183182
<h2 id="packages-heading" class="text-xs text-fg-subtle uppercase tracking-wider mb-3">
184183
{{ $t('compare.packages.section_packages') }}
185184
</h2>
186-
<ComparePackageSelector v-model="packages" :max="maxPackages" />
185+
<ComparePackageSelector v-model="packages" :max="MAX_PACKAGE_SELECTION" />
187186

188187
<!-- "No dep" replacement suggestions (native, simple) -->
189188
<div v-if="noDepSuggestions.length > 0" class="mt-3 space-y-2">

0 commit comments

Comments
 (0)