diff --git a/apps/web/src/components/CommandPalette.browser.test.tsx b/apps/web/src/components/CommandPalette.browser.test.tsx index 7a9de4ca746cf..6a2fe076c8932 100644 --- a/apps/web/src/components/CommandPalette.browser.test.tsx +++ b/apps/web/src/components/CommandPalette.browser.test.tsx @@ -138,7 +138,7 @@ describe("CommandPalette open intents", () => { await expect.element(input).toHaveValue("acme"); }); - it("opens a searched project's latest listed thread, not a newer subagent or delegated task", async () => { + it("opens a searched project's latest listed thread, not a newer subagent, delegated task, or parked thread", async () => { const environmentId = EnvironmentId.make("local"); const projectId = ProjectId.make("acme"); const parentId = ThreadId.make("parent"); @@ -182,6 +182,20 @@ describe("CommandPalette open intents", () => { projectId, latestUserMessageAt: "2026-03-04T00:00:00.000Z", }), + makeThreadFixture({ + id: ThreadId.make("settled"), + environmentId, + projectId, + latestUserMessageAt: "2026-03-05T00:00:00.000Z", + settledOverride: "settled", + }), + makeThreadFixture({ + id: ThreadId.make("snoozed"), + environmentId, + projectId, + latestUserMessageAt: "2026-03-06T00:00:00.000Z", + snoozedUntil: "2999-01-01T00:00:00.000Z", + }), ], }); await using screen = await render({null}); diff --git a/apps/web/src/components/CommandPalette.tsx b/apps/web/src/components/CommandPalette.tsx index 0ea2cd7a2015d..ec7393427b901 100644 --- a/apps/web/src/components/CommandPalette.tsx +++ b/apps/web/src/components/CommandPalette.tsx @@ -178,6 +178,7 @@ import { useRightPanelStore, } from "../rightPanelStore"; import { getLatestThreadForProject, sortThreads } from "@t3tools/client-runtime/state/thread-sort"; +import { effectiveSnoozed } from "@t3tools/client-runtime/state/thread-settled"; import { cn, getLocalFileManagerName, @@ -816,9 +817,14 @@ function OpenCommandPaletteDialog(props: { ), ) : null; + // oxlint-disable-next-line react/purity -- runs in an event handler (oxc#27309) + const now = new Date().toISOString(); + const openableThreads = threads.filter( + (thread) => thread.settledOverride !== "settled" && !effectiveSnoozed(thread, { now }), + ); const latestThread = groupedProjectKeys ? (sortThreads( - threads.filter( + openableThreads.filter( (thread) => thread.archivedAt === null && groupedProjectKeys.has(`${thread.environmentId}:${thread.projectId}`), @@ -826,7 +832,7 @@ function OpenCommandPaletteDialog(props: { clientSettings.sidebarThreadSortOrder, )[0] ?? null) : getLatestThreadForProject( - threads.filter((thread) => thread.environmentId === project.environmentId), + openableThreads.filter((thread) => thread.environmentId === project.environmentId), project.id, clientSettings.sidebarThreadSortOrder, );