- {{ $t('search.no_results', { query }) }}
+ {{ $t('search.no_results', { query: committedQuery }) }}
diff --git a/i18n/locales/en.json b/i18n/locales/en.json
index 00ba413a5b..2bcb964418 100644
--- a/i18n/locales/en.json
+++ b/i18n/locales/en.json
@@ -71,7 +71,9 @@
"instant_search_off": "off",
"instant_search_turn_on": "turn on",
"instant_search_turn_off": "turn off",
- "instant_search_advisory": "{label} {state} — {action}"
+ "instant_search_advisory": "{label} {state} — {action}",
+ "more_results_available_npm": "There are {total} results for this search, but npm registry limits search output. Refine your query to narrow results.",
+ "more_results_available_algolia": "There are {total} results for this search. Algolia search is capped at 1,000 — switch to npm Registry for up to 5,000 results, or refine your query."
},
"nav": {
"main_navigation": "Main",
diff --git a/i18n/schema.json b/i18n/schema.json
index e3c3c0a4b4..d328600b53 100644
--- a/i18n/schema.json
+++ b/i18n/schema.json
@@ -219,6 +219,12 @@
},
"instant_search_advisory": {
"type": "string"
+ },
+ "more_results_available_npm": {
+ "type": "string"
+ },
+ "more_results_available_algolia": {
+ "type": "string"
}
},
"additionalProperties": false
diff --git a/shared/types/npm-registry.ts b/shared/types/npm-registry.ts
index 250a9218e6..f3eb429d6c 100644
--- a/shared/types/npm-registry.ts
+++ b/shared/types/npm-registry.ts
@@ -103,6 +103,8 @@ export interface PackageVersionInfo {
deprecated?: string
}
+export type SearchProvider = 'npm' | 'algolia'
+
/**
* Person/contact type extracted from @npm/types Contact interface
* Used for maintainers, authors, publishers
@@ -122,6 +124,7 @@ export interface NpmPerson {
export interface NpmSearchResponse {
isStale: boolean
objects: NpmSearchResult[]
+ totalUnlimited?: number
total: number
time: string
}
diff --git a/shared/types/preferences.ts b/shared/types/preferences.ts
index 1714c404d3..96ef6073fe 100644
--- a/shared/types/preferences.ts
+++ b/shared/types/preferences.ts
@@ -3,6 +3,8 @@
* Used for configurable columns, filtering, sorting, and pagination
*/
+import type { SearchProvider } from './npm-registry'
+
// View modes
export type ViewMode = 'cards' | 'table'
@@ -163,7 +165,7 @@ export const SORT_KEYS: SortKeyConfig[] = [
* - npm returns 1 for all detail scores, and score.final === searchScore (= relevance)
* - Algolia returns synthetic values (quality: 0|1, maintenance: 0, score: 0)
*/
-export const PROVIDER_SORT_KEYS: Record<'algolia' | 'npm', Set> = {
+export const PROVIDER_SORT_KEYS: Record> = {
algolia: new Set(['relevance', 'downloads-week', 'updated', 'name']),
npm: new Set(['relevance', 'downloads-week', 'updated', 'name']),
}