Skip to content
Closed
Show file tree
Hide file tree
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
35 changes: 0 additions & 35 deletions src/renderer/src/hooks/useLauncherCommandModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 0 additions & 5 deletions src/renderer/src/utils/root-search-ranking.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Loading