feat(suggest): enrichissement web gratuit (Bing+Google) et titres Odysee Lighthouse

This commit is contained in:
2026-09-26 13:45:23 -04:00
parent 4578f5b887
commit d9c8a2e14e
5 changed files with 203 additions and 7 deletions
+13 -2
View File
@@ -45,8 +45,7 @@ function logOk(msg: string): void {
logOk('dedupeSort alpha fallback');
// --- Pure helpers: merge groups ---
const merged = mergeGroups({ dm: ['Tutoriel android'], yt: ['Tutoriel Angular', 'tutoriel android'], xx: ['zz'] });
assertEqual(
const merged = mergeGroups({ dm: ['Tutoriel android'], yt: ['Tutoriel Angular', 'tutoriel android'], xx: ['zz'] }); assertEqual(
merged,
[
{ text: 'Tutoriel Angular', provider: 'yt' },
@@ -57,6 +56,18 @@ function logOk(msg: string): void {
);
logOk('mergeGroups order + dedup');
// Web enrichment group renders last and stays deduped against providers
const mergedWeb = mergeGroups({ web: ['Tutoriel angular', 'tutoriel cuisine'], yt: ['Tutoriel Angular'] });
assertEqual(
mergedWeb,
[
{ text: 'Tutoriel Angular', provider: 'yt' },
{ text: 'tutoriel cuisine', provider: 'web' },
],
'mergeGroups keeps web enrichment last with no duplicates',
);
logOk('mergeGroups web tier');
// --- Pure helpers: dedupeStrings (whitespace + case variants) ---
assertEqual(
dedupeStrings([' Tutoriel Angular ', 'tutoriel angular', 'TUTORIEL ANGULAR', 'autre', '', ' ']),
@@ -318,6 +318,7 @@ export class SearchBoxComponent {
providerBadge(pid: string | null): string {
if (!pid) return '';
if (pid === 'web') return 'Web';
const found = PROVIDERS.find((p) => p.id === (pid as ProviderId));
return found ? found.shortLabel : String(pid).toUpperCase();
}