Fix empty topology create-root and cut navigation loading flash.

Keep the hidden system root built-in; speed tree bootstrap, unblock new-root UI, and soften query/Suspense refetch jank.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
oliver 2026-08-07 09:18:13 +08:00
parent c4911b6ddc
commit 990798987b
8 changed files with 246 additions and 61 deletions

View file

@ -25,8 +25,10 @@ export function AppLayout({ children }: Props) {
queryKey: ["opsTasks"],
queryFn: fetchOpsTasks,
enabled: Boolean(user),
refetchInterval: 4000,
staleTime: 1500,
// Idle installs: poll slowly; speed up only while tasks are active.
refetchInterval: (q) => ((q.state.data?.active ?? 0) > 0 ? 4000 : 20_000),
staleTime: 10_000,
refetchOnWindowFocus: false,
});
const activeTasks = opsTasksQuery.data?.active ?? 0;