Skip to content
Source
Sign inSign up
pingdotgg/t3code

feat(search): Cmd+K finds the right thread first, with indexed message search #24343

Mergedt3dotgg(GitHub profile, opens in a new tab)merged 66 commits intomain fromrefs/pull/24343/headmerged by t3dotgg(GitHub profile, opens in a new tab) View on GitHub

Showing 69 changed files with 39 additions and 22 deletions (loading 67).

x
0 of 69 viewed, 69 left
10 additions and 3 deletionsapps/mobile/src/features/archive/archivedThreadList.tsModified
View file
@@ -5,7 +5,9 @@
type EnvironmentProject,
type EnvironmentThreadShell,
} from "@t3tools/client-runtime/state/shell";
+import { threadSearchSubject } from "@t3tools/client-runtime/state/thread-search";
import type { EnvironmentId } from "@t3tools/contracts";
+import { foldSearchQuery, rankSearchItems, scoreThreadSearch } from "@t3tools/shared/paletteSearch";
import * as Arr from "effect/Array";
import * as Order from "effect/Order";
​
@@ -36,6 +38,7 @@
readonly sortOrder: ArchivedThreadSortOrder;
}): ReadonlyArray<ArchivedThreadGroup> {
const query = input.searchQuery.trim().toLocaleLowerCase();
+ const foldedQuery = foldSearchQuery(input.searchQuery);
const groups: ArchivedThreadGroup[] = [];
​
for (const entry of input.snapshots) {
@@ -62,11 +65,15 @@
matchesQuery(project.title, query) ||
matchesQuery(project.workspaceRoot, query) ||
matchesQuery(environmentLabel, query);
+ // Threads match as in every other thread search; the list keeps its own order.
const matchingThreads = groupMatches
? projectThreads
- : projectThreads.filter(
- (thread) => matchesQuery(thread.title, query) || matchesQuery(thread.branch, query),
- );