Skip to content

Commit 8a8611c

Browse files
committed
refactor: remove almost all occurances of quality, popularity and maintainence score
1 parent cf5f9ff commit 8a8611c

File tree

21 files changed

+0
-858
lines changed

21 files changed

+0
-858
lines changed

app/components/ColumnPicker.vue

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,6 @@ const columnLabels = computed(() => ({
4949
updated: $t('filters.columns.published'),
5050
maintainers: $t('filters.columns.maintainers'),
5151
keywords: $t('filters.columns.keywords'),
52-
qualityScore: $t('filters.columns.quality_score'),
53-
popularityScore: $t('filters.columns.popularity_score'),
54-
maintenanceScore: $t('filters.columns.maintenance_score'),
55-
combinedScore: $t('filters.columns.combined_score'),
5652
security: $t('filters.columns.security'),
5753
selection: $t('filters.columns.selection'),
5854
}))

app/components/Package/ListToolbar.vue

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,6 @@ const sortKeyLabelKeys = computed<Record<SortKey, string>>(() => ({
102102
'downloads-year': t('filters.sort.downloads_year'),
103103
'updated': t('filters.sort.published'),
104104
'name': t('filters.sort.name'),
105-
'quality': t('filters.sort.quality'),
106-
'popularity': t('filters.sort.popularity'),
107-
'maintenance': t('filters.sort.maintenance'),
108-
'score': t('filters.sort.score'),
109105
}))
110106
111107
function getSortKeyLabelKey(key: SortKey): string {

app/components/Package/Table.vue

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -37,21 +37,13 @@ const columnToSortKey: Record<string, SortKey> = {
3737
name: 'name',
3838
downloads: 'downloads-week',
3939
updated: 'updated',
40-
qualityScore: 'quality',
41-
popularityScore: 'popularity',
42-
maintenanceScore: 'maintenance',
43-
combinedScore: 'score',
4440
}
4541
4642
// Default direction for each column
4743
const columnDefaultDirection: Record<string, 'asc' | 'desc'> = {
4844
name: 'asc',
4945
downloads: 'desc',
5046
updated: 'desc',
51-
qualityScore: 'desc',
52-
popularityScore: 'desc',
53-
maintenanceScore: 'desc',
54-
combinedScore: 'desc',
5547
}
5648
5749
function isColumnSorted(id: string): boolean {
@@ -97,10 +89,6 @@ const columnLabels = computed(() => ({
9789
updated: t('filters.columns.published'),
9890
maintainers: t('filters.columns.maintainers'),
9991
keywords: t('filters.columns.keywords'),
100-
qualityScore: t('filters.columns.quality_score'),
101-
popularityScore: t('filters.columns.popularity_score'),
102-
maintenanceScore: t('filters.columns.maintenance_score'),
103-
combinedScore: t('filters.columns.combined_score'),
10492
security: t('filters.columns.security'),
10593
selection: t('filters.columns.selection'),
10694
}))
@@ -264,38 +252,6 @@ function getColumnLabel(id: ColumnId): string {
264252
{{ getColumnLabel('keywords') }}
265253
</th>
266254

267-
<th
268-
v-if="isColumnVisible('qualityScore')"
269-
scope="col"
270-
class="py-3 px-3 text-xs text-start text-fg-muted font-mono font-medium uppercase tracking-wider whitespace-nowrap select-none text-end"
271-
>
272-
{{ getColumnLabel('qualityScore') }}
273-
</th>
274-
275-
<th
276-
v-if="isColumnVisible('popularityScore')"
277-
scope="col"
278-
class="py-3 px-3 text-xs text-start text-fg-muted font-mono font-medium uppercase tracking-wider whitespace-nowrap select-none text-end"
279-
>
280-
{{ getColumnLabel('popularityScore') }}
281-
</th>
282-
283-
<th
284-
v-if="isColumnVisible('maintenanceScore')"
285-
scope="col"
286-
class="py-3 px-3 text-xs text-start text-fg-muted font-mono font-medium uppercase tracking-wider whitespace-nowrap select-none text-end"
287-
>
288-
{{ getColumnLabel('maintenanceScore') }}
289-
</th>
290-
291-
<th
292-
v-if="isColumnVisible('combinedScore')"
293-
scope="col"
294-
class="py-3 px-3 text-xs text-start text-fg-muted font-mono font-medium uppercase tracking-wider whitespace-nowrap select-none text-end"
295-
>
296-
{{ getColumnLabel('combinedScore') }}
297-
</th>
298-
299255
<th
300256
v-if="isColumnVisible('security')"
301257
scope="col"

app/components/Package/TableRow.vue

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -164,38 +164,6 @@ const allMaintainersText = computed(() => {
164164
<span v-else class="text-fg-subtle">-</span>
165165
</td>
166166

167-
<!-- Quality Score -->
168-
<td
169-
v-if="isColumnVisible('qualityScore')"
170-
class="py-2 px-3 font-mono text-xs text-fg-muted text-end tabular-nums"
171-
>
172-
{{ formatScore(score?.detail?.quality) }}
173-
</td>
174-
175-
<!-- Popularity Score -->
176-
<td
177-
v-if="isColumnVisible('popularityScore')"
178-
class="py-2 px-3 font-mono text-xs text-fg-muted text-end tabular-nums"
179-
>
180-
{{ formatScore(score?.detail?.popularity) }}
181-
</td>
182-
183-
<!-- Maintenance Score -->
184-
<td
185-
v-if="isColumnVisible('maintenanceScore')"
186-
class="py-2 px-3 font-mono text-xs text-fg-muted text-end tabular-nums"
187-
>
188-
{{ formatScore(score?.detail?.maintenance) }}
189-
</td>
190-
191-
<!-- Combined Score -->
192-
<td
193-
v-if="isColumnVisible('combinedScore')"
194-
class="py-2 px-3 font-mono text-xs text-fg-muted text-end tabular-nums"
195-
>
196-
{{ formatScore(score?.final) }}
197-
</td>
198-
199167
<!-- Security -->
200168
<td v-if="isColumnVisible('security')" class="py-2 px-3">
201169
<span v-if="result.flags?.insecure" class="text-syntax-kw">

app/composables/npm/search-utils.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ export function metaToSearchResult(meta: PackageMetaResponse): NpmSearchResult {
1111
author: meta.author,
1212
maintainers: meta.maintainers,
1313
},
14-
score: { final: 0, detail: { quality: 0, popularity: 0, maintenance: 0 } },
1514
searchScore: 0,
1615
downloads: meta.weeklyDownloads !== undefined ? { weekly: meta.weeklyDownloads } : undefined,
1716
updated: meta.date,

app/composables/npm/useAlgoliaSearch.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -91,14 +91,6 @@ function hitToSearchResult(hit: AlgoliaHit): NpmSearchResult {
9191
}))
9292
: [],
9393
},
94-
score: {
95-
final: 0,
96-
detail: {
97-
quality: hit.popular ? 1 : 0,
98-
popularity: hit.downloadsRatio,
99-
maintenance: 0,
100-
},
101-
},
10294
searchScore: 0,
10395
downloads: {
10496
weekly: Math.round(hit.downloadsLast30Days / 4.3),

app/composables/useStructuredFilters.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -332,18 +332,6 @@ export function useStructuredFilters(options: UseStructuredFiltersOptions) {
332332
case 'name':
333333
diff = a.package.name.localeCompare(b.package.name)
334334
break
335-
case 'quality':
336-
diff = (a.score?.detail?.quality ?? 0) - (b.score?.detail?.quality ?? 0)
337-
break
338-
case 'popularity':
339-
diff = (a.score?.detail?.popularity ?? 0) - (b.score?.detail?.popularity ?? 0)
340-
break
341-
case 'maintenance':
342-
diff = (a.score?.detail?.maintenance ?? 0) - (b.score?.detail?.maintenance ?? 0)
343-
break
344-
case 'score':
345-
diff = (a.score?.final ?? 0) - (b.score?.final ?? 0)
346-
break
347335
case 'relevance':
348336
// Relevance preserves server order (already sorted by search relevance)
349337
diff = 0

app/pages/search.vue

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,6 @@ const ALL_SORT_KEYS: SortKey[] = [
134134
'downloads-year',
135135
'updated',
136136
'name',
137-
'quality',
138-
'popularity',
139-
'maintenance',
140-
'score',
141137
]
142138
143139
// Disable sort keys the current provider can't meaningfully sort by

i18n/locales/en.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -904,10 +904,6 @@
904904
"published": "Last Published",
905905
"maintainers": "Maintainers",
906906
"keywords": "Keywords",
907-
"quality_score": "Quality score",
908-
"popularity_score": "Popularity score",
909-
"maintenance_score": "Maintenance score",
910-
"combined_score": "Combined score",
911907
"security": "Security",
912908
"selection": "Select package"
913909
},

i18n/schema.json

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2716,18 +2716,6 @@
27162716
"keywords": {
27172717
"type": "string"
27182718
},
2719-
"quality_score": {
2720-
"type": "string"
2721-
},
2722-
"popularity_score": {
2723-
"type": "string"
2724-
},
2725-
"maintenance_score": {
2726-
"type": "string"
2727-
},
2728-
"combined_score": {
2729-
"type": "string"
2730-
},
27312719
"security": {
27322720
"type": "string"
27332721
},

0 commit comments

Comments
 (0)