From d00a9f22d9ec06a5baca678add443734512fc5bb Mon Sep 17 00:00:00 2001 From: Glary-Bot Date: Mon, 4 May 2026 16:34:54 +0000 Subject: [PATCH] feat(website): default cloud-nodes sort to most-installed Adds a 'Most installed' sort option (downloads desc) and uses it as the default. The packs in the snapshot already carry registry-served download counts so the index now leads with what the community uses most. Custom-styled chevron with extra right-padding (pr-12) so the text never crowds the dropdown indicator. --- .../cloud-nodes/PackGridSection.vue | 19 +++++++++++++++---- apps/website/src/i18n/translations.ts | 4 ++++ 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/apps/website/src/components/cloud-nodes/PackGridSection.vue b/apps/website/src/components/cloud-nodes/PackGridSection.vue index 89cebbdcee..e2b4d82268 100644 --- a/apps/website/src/components/cloud-nodes/PackGridSection.vue +++ b/apps/website/src/components/cloud-nodes/PackGridSection.vue @@ -10,7 +10,7 @@ import { t } from '../../i18n/translations' import SectionLabel from '../common/SectionLabel.vue' import PackCard from './PackCard.vue' -type SortMode = 'mostNodes' | 'az' | 'recentlyUpdated' +type SortMode = 'downloads' | 'mostNodes' | 'az' | 'recentlyUpdated' const { locale = 'en', packs } = defineProps<{ locale?: Locale @@ -18,7 +18,7 @@ const { locale = 'en', packs } = defineProps<{ }>() const query = defineModel('query', { default: '' }) -const sortMode = ref('mostNodes') +const sortMode = ref('downloads') const filteredPacks = computed(() => { const normalizedQuery = query.value.trim().toLowerCase() @@ -49,7 +49,11 @@ const filteredPacks = computed(() => { }) } - return matching.sort((a, b) => b.nodes.length - a.nodes.length) + if (sortMode.value === 'mostNodes') { + return matching.sort((a, b) => b.nodes.length - a.nodes.length) + } + + return matching.sort((a, b) => (b.downloads ?? 0) - (a.downloads ?? 0)) }) @@ -91,8 +95,15 @@ const filteredPacks = computed(() => {