@devries-cameron20 / t3code-1 / commits / b732621b51
Fork 0

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

fix(clients): command palette skips tasks shown under their parent (#37315)

Co-authored-by: Julius Marminge <julius0216@outlook.com>

Onkar Pradip Jadhav committed Nov 16, 2026 at 02:38 UTC b732621b5194c47e415f864296d0e9145e420b0d
6 files changed +42 -7
apps/mobile/src/features/keyboard/CommandPalette.tsx
+14 -2
@@ -9,7 +9,8 @@ import {
9 type EnvironmentThreadSearchMatch,
10 type ShownOrder,
11 } from "@t3tools/client-runtime/state/thread-search";
12 -import { isListedThreadLineage, THREAD_JUMP_KEYBINDING_COMMANDS } from "@t3tools/contracts";
12 +import { isShownUnderParent } from "@t3tools/client-runtime/state/threads";
13 +import { THREAD_JUMP_KEYBINDING_COMMANDS } from "@t3tools/contracts";
14 import {
15 foldSearchQuery,
16 PALETTE_MESSAGE_LIMIT,
@@ -43,6 +44,7 @@ import { scopedProjectKey, scopedThreadKey } from "../../lib/scopedEntities";
44 import { useNativeLayoutMetrics } from "../../native/native-layout-metrics";
45 import { T3KeyboardCommands } from "../../native/T3KeyboardCommands";
46 import {
47 + useDelegatedUnderParent,
48 useProjects,
49 useServerConfigs,
50 useThreadShell,
@@ -227,6 +229,7 @@ export function CommandPalette(props: {
229 const runCommand = props.onCommand;
230 const projects = useProjects();
231 const threads = useVisibleThreadShells();
232 + const delegatedUnderParent = useDelegatedUnderParent();
233 const activeThreadRef = parseActiveThreadPath(props.pathname);
234 const activeThread = useThreadShell(activeThreadRef);
235 const visitThread = useAtomCommand(threadEnvironment.visit, { reportFailure: false });
@@ -426,7 +429,15 @@ export function CommandPalette(props: {
429 }),
430 }));
431 const threadItems: CommandPaletteItem[] = threads
429 - .filter((thread) => thread.archivedAt === null && isListedThreadLineage(thread.lineage))
432 + .filter(
433 + (thread) =>
434 + thread.archivedAt === null &&
435 + !isShownUnderParent(
436 + { environmentId: thread.environmentId, threadId: thread.id },
437 + thread.lineage,
438 + delegatedUnderParent,
439 + ),
440 + )
441 .map((thread) => {
442 const project = projectByKey.get(scopedProjectKey(thread.environmentId, thread.projectId));
443 const environment =
@@ -473,6 +484,7 @@ export function CommandPalette(props: {
484 selectDetail,
485 startTriage,
486 threads,
487 + delegatedUnderParent,
488 triageEnvironmentId,
489 ]);
490 const rankedMessageKeys = useMemo(() => {
apps/mobile/src/state/entities.ts
+5
@@ -200,6 +200,11 @@ export function useVisibleThreadShells(): ReadonlyArray<EnvironmentThreadShell>
200 return useAtomValue(environmentThreadShells.visibleThreadShellsAtom);
201 }
202
203 +/** Tasks linked environments run for a listed thread, by thread key; lists show them under it. */
204 +export function useDelegatedUnderParent(): ReadonlySet<string> {
205 + return useAtomValue(environmentThreadShells.delegatedUnderParentAtom);
206 +}
207 +
208 export function useNavigationThreadShells(): ReadonlyArray<EnvironmentThreadShell> {
209 return useAtomValue(environmentThreadShells.navigationThreadShellsAtom);
210 }
apps/web/src/components/CommandPalette.logic.test.ts
+7 -1
@@ -1,3 +1,4 @@
1 +import { threadKey } from "@t3tools/client-runtime/state/entities";
2 import { describe, expect, it, vi } from "vite-plus/test";
3 import { EnvironmentId, ProjectId, ProviderInstanceId, ThreadId } from "@t3tools/contracts";
4 import type { Thread } from "../types";
@@ -666,11 +667,13 @@ describe("buildThreadActionItems", () => {
667 ]);
668 });
669
669 - it("hides subagent threads but keeps forks", () => {
670 + it("hides subagent threads and tasks shown under their parent but keeps forks", () => {
671 const parentId = ThreadId.make("parent");
672 + const delegatedId = ThreadId.make("delegated");
673 const items = buildThreadActionItems({
674 threads: [
675 makeThread({ id: parentId, title: "Parent" }),
676 + makeThread({ id: delegatedId, title: "Delegated task" }),
677 makeThread({
678 id: ThreadId.make("subagent"),
679 title: "Subagent",
@@ -690,6 +693,9 @@ describe("buildThreadActionItems", () => {
693 },
694 }),
695 ],
696 + delegatedUnderParent: new Set([
697 + threadKey({ environmentId: LOCAL_ENVIRONMENT_ID, threadId: delegatedId }),
698 + ]),
699 projectByKey: new Map(),
700 icon: null,
701 runThread: async () => undefined,
apps/web/src/components/CommandPalette.logic.ts
+12 -2
@@ -30,12 +30,13 @@ import {
30 THREAD_JUMP_KEYBINDING_COMMANDS,
31 } from "@t3tools/contracts";
32 import { filterFilesystemBrowseEntries } from "@t3tools/client-runtime/state/filesystem";
33 +import { isShownUnderParent } from "@t3tools/client-runtime/state/threads";
34 import { type ReactNode } from "react";
35 import { formatRelativeTimeLabel } from "../timestampFormat";
36 import { type Project, type SidebarThreadSummary, type Thread } from "../types";
36 -import { isSidebarHiddenThread } from "./Sidebar.logic";
37
38 export const RECENT_THREAD_LIMIT = 12;
39 +const NO_THREAD_KEYS: ReadonlySet<string> = new Set();
40 export const ITEM_ICON_CLASS = "size-4 text-icon-muted";
41 export const ADDON_ICON_CLASS = "size-4";
42
@@ -436,10 +437,19 @@ export function buildThreadActionItems<TThread extends BuildThreadActionItemsThr
437 runThread: (thread: TThread) => Promise<void>;
438 /** Makes the environment searchable; pass it only with two or more environments. */
439 environmentLabelOf?: (thread: TThread) => string | null;
440 + /** Tasks linked environments run for a listed thread; they open from under that thread. */
441 + delegatedUnderParent?: ReadonlySet<string>;
442 }): CommandPaletteActionItem[] {
443 + const delegatedUnderParent = input.delegatedUnderParent ?? NO_THREAD_KEYS;
444 // Callers order these: recents by last use, search results by rank.
445 const visibleThreads = input.threads.filter(
442 - (thread) => thread.archivedAt === null && !isSidebarHiddenThread(thread),
446 + (thread) =>
447 + thread.archivedAt === null &&
448 + !isShownUnderParent(
449 + { environmentId: thread.environmentId, threadId: thread.id },
450 + thread.lineage,
451 + delegatedUnderParent,
452 + ),
453 );
454
455 return visibleThreads.map((thread) => {
apps/web/src/components/CommandPaletteThreadItems.tsx
+3 -1
@@ -23,7 +23,7 @@ import {
23 deriveProviderInstanceEntries,
24 type ProviderInstanceEntry,
25 } from "../providerInstances";
26 -import { useVisibleThreadShells } from "../state/entities";
26 +import { useDelegatedUnderParent, useVisibleThreadShells } from "../state/entities";
27 import {
28 useEnvironmentProviders,
29 useEnvironments,
@@ -100,6 +100,7 @@ export function useCommandPaletteThreadItems(input: {
100 const { activeThread, threadSearchQuery } = input;
101 const navigate = useNavigate();
102 const threads = useVisibleThreadShells();
103 + const delegatedUnderParent = useDelegatedUnderParent();
104 const { projectEnvironmentLocationById } = useEnvironmentLookups();
105 const providerEntryByEnvironmentAndInstanceId = useProviderEntryByEnvironmentAndInstanceId();
106 const messageSearch = useConnectedThreadSearch(threadSearchQuery);
@@ -111,6 +112,7 @@ export function useCommandPaletteThreadItems(input: {
112 const { environments } = useEnvironments();
113 const threadItems = buildThreadActionItems({
114 threads,
115 + delegatedUnderParent,
116 ...(environments.length > 1
117 ? {
118 environmentLabelOf: (thread: (typeof threads)[number]) =>
apps/web/src/components/Sidebar.logic.ts
+1 -1
@@ -582,7 +582,7 @@ export async function deleteSelectedThreadEntries<
582 return { deletedThreadKeys, firstFailure };
583 }
584
585 -export function isSidebarHiddenThread(thread: Pick<SidebarThreadSummary, "lineage">): boolean {
585 +function isSidebarHiddenThread(thread: Pick<SidebarThreadSummary, "lineage">): boolean {
586 return !isListedThreadLineage(thread.lineage);
587 }
588