From e23785292f7882c6466aac8e7181473c39b210b8 Mon Sep 17 00:00:00 2001 From: Yannic Charlon <52761674+JustYannicc@users.noreply.github.com> Date: Fri, 3 Jul 2026 21:11:49 +0200 Subject: [PATCH] Remove root search ranking diagnostics --- .../src/hooks/useLauncherCommandModel.ts | 35 ------------------- src/renderer/src/utils/root-search-ranking.ts | 5 --- 2 files changed, 40 deletions(-) diff --git a/src/renderer/src/hooks/useLauncherCommandModel.ts b/src/renderer/src/hooks/useLauncherCommandModel.ts index 44ca0fbc..bfc40cf3 100644 --- a/src/renderer/src/hooks/useLauncherCommandModel.ts +++ b/src/renderer/src/hooks/useLauncherCommandModel.ts @@ -857,41 +857,6 @@ export function useLauncherCommandModel({ queryFileSectionCommands, } = rootSearchSectionAssembly; - // TEMP DIAGNOSTIC (SC-RANK2): pinpoint whether the internal>browser comparator - // is actually running, and whether Search Notes / Create Note are candidates. - // Remove once the override bug is confirmed fixed. - useEffect(() => { - if (!hasSearchQuery) return; - try { - const idOf = (c: any) => String(c?.command?.id || c?.stableKey || ''); - const sn = commandCandidates.find((c) => idOf(c).includes('search-notes')); - const cn = commandCandidates.find((c) => idOf(c).includes('create-note')); - const internalCount = rootRankedCandidates.filter((c) => !c.isOrganicBrowserResult).length; - const browserCount = rootRankedCandidates.filter((c) => c.isOrganicBrowserResult).length; - const firstBrowserIdx = rootRankedCandidates.findIndex((c) => c.isOrganicBrowserResult); - const snIdx = rootRankedCandidates.findIndex((c) => idOf(c).includes('search-notes')); - const cnIdx = rootRankedCandidates.findIndex((c) => idOf(c).includes('create-note')); - const describe = (c: any, idx: number) => c - ? { score: Math.round(c.finalScore), matchKind: c.matchKind, organic: c.isOrganicBrowserResult, rankIdx: idx } - : 'NOT_A_CANDIDATE'; - (window as any).electron?.whisperDebugLog?.('SC-RANK2', `q="${searchQuery}"`, { - cmdCands: commandCandidates.length, - browserCands: browserCandidates.length, - rootTotal: rootRankedCandidates.length, - internalCount, - browserCount, - // If the comparator works, firstBrowserIdx === internalCount (all internal first). - firstBrowserIdx, - comparatorWorking: firstBrowserIdx === -1 || firstBrowserIdx >= internalCount, - searchNotes: describe(sn, snIdx), - createNote: describe(cn, cnIdx), - RESULTS: queryResultCommands.map((c) => c.title), - }); - } catch (e) { - (window as any).electron?.whisperDebugLog?.('SC-RANK2', 'ERR', String(e)); - } - }, [hasSearchQuery, searchQuery, rootRankedCandidates, queryResultCommands, commandCandidates, browserCandidates]); - const displayCommands = useMemo(() => { if (rootBangState.mode === 'selecting') return rootSearchSectionAssembly.displayCommands; if (rootBangState.mode === 'active') return rootSearchSectionAssembly.displayCommands; diff --git a/src/renderer/src/utils/root-search-ranking.ts b/src/renderer/src/utils/root-search-ranking.ts index 6eec2570..2637783f 100644 --- a/src/renderer/src/utils/root-search-ranking.ts +++ b/src/renderer/src/utils/root-search-ranking.ts @@ -94,11 +94,6 @@ const SEARCH_SEPARATOR_REGEX = /[^\p{L}\p{N}]+/gu; const COMBINING_MARK_REGEX = /\p{M}/gu; const DAY = 24 * 60 * 60 * 1000; -// Build liveness stamp — confirms the running renderer has the internal>browser -// precedence fix. Grep the bundle (dist/renderer/assets/*.js) for this string, -// or look for it in the DevTools console at startup. Remove once verified. -try { console.info('[SC-RANK build 2026-06-19c internal>browser precedence ACTIVE]'); } catch {} - export const ROOT_SEARCH_RESULTS_LIMIT = 8; export const ROOT_SEARCH_PROMOTION_SCORE = 700;