refactor(search): session sidebar and project-context filters use the shared matcher

Sidebar session/folder/group search and the Todos, Memory, Plans and
Notes filters required the whole query as one literal substring; they
now match tokens in any order and ignore punctuation via
matchesRankQuery, keeping their own list order and tree structure.
This commit is contained in:
Bohdan Triapitsyn
2026-08-24 15:04:14 +03:00
parent c02d7ff399
commit da309a2a8d
7 changed files with 27 additions and 26 deletions
@@ -1,3 +1,4 @@
import { matchesRankQuery } from '@/lib/search/fuzzySearch';
import React from 'react';
import type { Session } from '@opencode-ai/sdk/v2';
import type { WorktreeMetadata } from '@/types/worktree';
@@ -44,7 +45,7 @@ export const useSessionGrouping = (args: Args) => {
}
return nodes.flatMap((node) => {
const nodeMatches = buildSessionSearchText(node.session).includes(query);
const nodeMatches = matchesRankQuery([buildSessionSearchText(node.session)], query);
if (nodeMatches) {
return [node];
}