Skip to content
Open
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
9 changes: 8 additions & 1 deletion app/pages/search.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,21 @@ const { settings } = useSettings()

/**
* Reorder results to put exact package name match at the top,
* and optionally filter out platform-specific packages.
* and optionally filter out platform-specific packages or security holding packages.
*/
const visibleResults = computed(() => {
const raw = rawVisibleResults.value
if (!raw) return raw

let objects = raw.objects

// Filter out "Security holding package" package takendown by npm registory
objects = objects.filter(
r =>
r.package.version !== '0.0.1-security' ||
r.package.description !== 'security holding package',
)
Comment on lines +84 to +89
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Keep the result metadata in sync with this filter.

This only removes entries from objects; raw.total and the pagination state still describe the unfiltered provider response. That leaves the search count/live-region text overstated and can surface empty pages or redundant “load more” behaviour once these rows are stripped. This filter needs to happen where the search response metadata is produced, or the returned total/pagination metadata needs adjusting alongside objects.


// Filter out platform-specific packages if setting is enabled
if (settings.value.hidePlatformPackages) {
objects = objects.filter(r => !isPlatformSpecificPackage(r.package.name))
Expand Down
Loading