Skip to content

Commit 1230cd1

Browse files
committed
fix: switch back to old versions by default
1 parent f6b93d5 commit 1230cd1

File tree

6 files changed

+17
-17
lines changed

6 files changed

+17
-17
lines changed

app/components/Package/VersionDistribution.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ const isMobile = computed(() => width.value > 0 && width.value < mobileBreakpoin
8080
8181
const {
8282
groupingMode,
83-
showOldVersions,
83+
showRecentOnly,
8484
showLowUsageVersions,
8585
pending,
8686
error,
@@ -376,9 +376,9 @@ const endDate = computed(() => {
376376

377377
<div class="flex flex-col gap-4 w-full max-w-1/2">
378378
<SettingsToggle
379-
v-model="showOldVersions"
380-
:label="$t('package.versions.show_old_versions')"
381-
:tooltip="$t('package.versions.show_old_versions_tooltip')"
379+
v-model="showRecentOnly"
380+
:label="$t('package.versions.recent_versions_only')"
381+
:tooltip="$t('package.versions.recent_versions_only_tooltip')"
382382
tooltip-position="bottom"
383383
:tooltip-to="inModal ? '#chart-modal' : undefined"
384384
:tooltip-offset="8"

app/composables/useVersionDistribution.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ interface ChartDataItem {
2222
*/
2323
export function useVersionDistribution(packageName: MaybeRefOrGetter<string>) {
2424
const groupingMode = ref<VersionGroupingMode>('major')
25-
const showOldVersions = ref(false)
25+
const showRecentOnly = ref(false)
2626
const showLowUsageVersions = ref(false)
2727
const pending = ref(false)
2828
const error = ref<Error | null>(null)
@@ -48,7 +48,7 @@ export function useVersionDistribution(packageName: MaybeRefOrGetter<string>) {
4848
{
4949
query: {
5050
mode,
51-
filterOldVersions: showOldVersions.value ? 'false' : 'true',
51+
filterOldVersions: showRecentOnly.value ? 'true' : 'false',
5252
filterThreshold: showLowUsageVersions.value ? '0' : '1',
5353
},
5454
cache: 'default', // Don't force-cache since query params change frequently
@@ -74,7 +74,7 @@ export function useVersionDistribution(packageName: MaybeRefOrGetter<string>) {
7474
let groups = data.value.groups
7575

7676
// Filter using server-provided recent versions list
77-
if (!showOldVersions.value && data.value.recentVersions) {
77+
if (showRecentOnly.value && data.value.recentVersions) {
7878
const recentVersionsSet = new Set(data.value.recentVersions)
7979

8080
groups = groups.filter(group => {
@@ -131,7 +131,7 @@ export function useVersionDistribution(packageName: MaybeRefOrGetter<string>) {
131131
})
132132

133133
// Refetch when filter changes - no immediate since we already have data
134-
watch(showOldVersions, () => {
134+
watch(showRecentOnly, () => {
135135
fetchDistribution()
136136
})
137137

@@ -160,7 +160,7 @@ export function useVersionDistribution(packageName: MaybeRefOrGetter<string>) {
160160
return {
161161
// State
162162
groupingMode,
163-
showOldVersions,
163+
showRecentOnly,
164164
showLowUsageVersions,
165165
pending,
166166
error,

i18n/locales/en.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,8 +292,8 @@
292292
"distribution_modal_title": "Versions",
293293
"grouping_major": "Major",
294294
"grouping_minor": "Minor",
295-
"show_old_versions": "Show old versions",
296-
"show_old_versions_tooltip": "Show versions older than 1 year",
295+
"recent_versions_only": "Recent versions only",
296+
"recent_versions_only_tooltip": "Show only versions published within the last year.",
297297
"show_low_usage": "Show low usage versions",
298298
"show_low_usage_tooltip": "Include version groups with less than 1% of total downloads",
299299
"date_range_tooltip": "Last week of version distributions only"

i18n/schema.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -880,10 +880,10 @@
880880
"grouping_minor": {
881881
"type": "string"
882882
},
883-
"show_old_versions": {
883+
"recent_versions_only": {
884884
"type": "string"
885885
},
886-
"show_old_versions_tooltip": {
886+
"recent_versions_only_tooltip": {
887887
"type": "string"
888888
},
889889
"show_low_usage": {

lunaria/files/en-GB.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,8 +291,8 @@
291291
"distribution_modal_title": "Versions",
292292
"grouping_major": "Major",
293293
"grouping_minor": "Minor",
294-
"show_old_versions": "Show old versions",
295-
"show_old_versions_tooltip": "Show versions older than 1 year",
294+
"recent_versions_only": "Recent versions only",
295+
"recent_versions_only_tooltip": "Show only versions published within the last year.",
296296
"show_low_usage": "Show low usage versions",
297297
"show_low_usage_tooltip": "Include version groups with less than 1% of total downloads",
298298
"date_range_tooltip": "Last week of version distributions only"

lunaria/files/en-US.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,8 +291,8 @@
291291
"distribution_modal_title": "Versions",
292292
"grouping_major": "Major",
293293
"grouping_minor": "Minor",
294-
"show_old_versions": "Show old versions",
295-
"show_old_versions_tooltip": "Show versions older than 1 year",
294+
"recent_versions_only": "Recent versions only",
295+
"recent_versions_only_tooltip": "Show only versions published within the last year.",
296296
"show_low_usage": "Show low usage versions",
297297
"show_low_usage_tooltip": "Include version groups with less than 1% of total downloads",
298298
"date_range_tooltip": "Last week of version distributions only"

0 commit comments

Comments
 (0)