From 5407e0b61e1e57c755d95381dd4c44622dbf2309 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Wed, 1 Apr 2026 22:19:57 +0000 Subject: [PATCH] fix: remove empty-array placeholderData so archived threads loading state is reachable placeholderData with a fallback to an empty array caused TanStack Query v5 to start in 'success' status, making isPending always false. The loading UI was dead code and users saw a misleading 'No archived threads' flash. Now placeholderData only returns the previous value (undefined on first load), so the query correctly starts in pending status. --- apps/web/src/lib/orchestrationReactQuery.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/apps/web/src/lib/orchestrationReactQuery.ts b/apps/web/src/lib/orchestrationReactQuery.ts index f746f492d4..8aca297314 100644 --- a/apps/web/src/lib/orchestrationReactQuery.ts +++ b/apps/web/src/lib/orchestrationReactQuery.ts @@ -1,4 +1,3 @@ -import type { OrchestrationListArchivedThreadsResult } from "@t3tools/contracts"; import { queryOptions } from "@tanstack/react-query"; import { ensureNativeApi } from "~/nativeApi"; @@ -8,8 +7,6 @@ export const orchestrationQueryKeys = { }; const DEFAULT_ARCHIVED_THREADS_STALE_TIME = 15_000; -const EMPTY_ARCHIVED_THREADS: OrchestrationListArchivedThreadsResult = []; - export function archivedThreadsQueryOptions() { return queryOptions({ queryKey: orchestrationQueryKeys.archivedThreads(), @@ -18,6 +15,6 @@ export function archivedThreadsQueryOptions() { return api.orchestration.listArchivedThreads(); }, staleTime: DEFAULT_ARCHIVED_THREADS_STALE_TIME, - placeholderData: (previous) => previous ?? EMPTY_ARCHIVED_THREADS, + placeholderData: (previous) => previous, }); }