@devries-cameron20 / t3code-1 / commits / 712f8cad32
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

feat(web): command palette search matches thread IDs (#11185)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

Alex Southwell committed Sep 17, 2026 at 14:49 UTC 712f8cad32bf8961c3c4b53497dd65c32672d59d
2 files changed +36
apps/web/src/components/CommandPalette.logic.test.ts
+34
@@ -584,6 +584,40 @@ describe("buildThreadActionItems", () => {
584 expect(item?.description).toBe("T3 Code · #feat/search");
585 });
586
587 + it("surfaces threads when the query is their ID, without outranking title matches", () => {
588 + const idThread = makeThread({
589 + id: ThreadId.make("thread-alpha-1234"),
590 + title: "Unrelated work",
591 + updatedAt: "2026-03-05T00:00:00.000Z",
592 + });
593 + const titleThread = makeThread({
594 + id: ThreadId.make("thread-other-9999"),
595 + title: "Fix thread-alpha-1234 flakes",
596 + updatedAt: "2026-03-04T00:00:00.000Z",
597 + });
598 + const items = buildThreadActionItems({
599 + threads: [idThread, titleThread],
600 + projectTitleById: new Map([[PROJECT_ID, "T3 Code"]]),
601 + sortOrder: "updated_at",
602 + icon: null,
603 + runThread: async (_thread) => undefined,
604 + });
605 +
606 + const groups = filterCommandPaletteGroups({
607 + activeGroups: [],
608 + query: " THREAD-ALPHA-1234 ",
609 + isInSubmenu: false,
610 + projectSearchItems: [],
611 + settingsSearchItems: [],
612 + threadSearchItems: items,
613 + });
614 +
615 + expect(groups.flatMap((group) => group.items)).toEqual([
616 + expect.objectContaining({ value: `thread:${titleThread.id}` }),
617 + expect.objectContaining({ value: `thread:${idThread.id}` }),
618 + ]);
619 + });
620 +
621 it("prefers renderDescription when provided", () => {
622 const [item] = buildThreadActionItems({
623 threads: [makeThread({ branch: "feat/search", worktreePath: "/tmp/wt" })],
apps/web/src/components/CommandPalette.logic.ts
+2
@@ -307,6 +307,8 @@ export function buildThreadActionItems<TThread extends BuildThreadActionItemsThr
307 projectTitle ?? ``,
308 thread.branch ?? ``,
309 contentMatch?.snippet ?? ``,
310 + // Last so pasted IDs never outrank title matches for shared substrings.
311 + thread.id,
312 ],
313 title: thread.title,
314 description,