From fd94f7a1915f2c7675a9f399ae6ea45deefd138c Mon Sep 17 00:00:00 2001 From: ddonaldson130 Date: Fri, 3 Jul 2026 03:15:17 -0400 Subject: [PATCH] fix(dashboard): prevent Windows Terminal popup and repair Manage Projects navigation Two user-facing bugs on Windows: 1. Windows Terminal version dialogs on dashboard load/settings - The embedded terminal auto-create flow was spawning a PTY on Windows, which could invoke wt.exe and trigger its native "Help" version message boxes (Windows Terminal 1.24.11321.0). - Fix: skip auto-creation of the first terminal tab on Windows. Users can still create a terminal explicitly; the failure no longer recurs automatically on every dashboard session. 2. Manage Projects opens Settings instead of project overview - handleViewAllProjects only reset viewMode; if the previous taskView was "settings", MainContent rendered the Settings page before the overview branch because the settings check precedes the overview branch. - Fix: also reset taskView to "command-center" when leaving a project so the overview surface (ProjectOverview) renders. - Thread setTaskView through useProjectActions so the action has access to the view router. Tested on Windows 11 with Fusion 0.52.0 dashboard. --- packages/dashboard/app/App.tsx | 3 ++- packages/dashboard/app/hooks/useProjectActions.ts | 7 +++++-- packages/dashboard/app/hooks/useTerminalSessions.ts | 7 +++++++ 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/packages/dashboard/app/App.tsx b/packages/dashboard/app/App.tsx index b640d9dd21..5d2a5855a0 100644 --- a/packages/dashboard/app/App.tsx +++ b/packages/dashboard/app/App.tsx @@ -336,7 +336,7 @@ function AppInner() { const { pushNav, replaceCurrent, removeNav } = useNavigationHistory({ enabled: true }); // View state must be defined before useTasks since useTasks depends on taskView for SSE gating - const { viewMode, setViewMode, taskView, handleChangeTaskView } = useViewState({ + const { viewMode, setViewMode, taskView, setTaskView, handleChangeTaskView } = useViewState({ projectsLoading, projectsError, currentProjectLoading, @@ -717,6 +717,7 @@ function AppInner() { setCurrentProject, clearCurrentProject, setViewMode, + setTaskView, currentProject, refreshProjects, toggleFavoriteProvider, diff --git a/packages/dashboard/app/hooks/useProjectActions.ts b/packages/dashboard/app/hooks/useProjectActions.ts index a066aa8e24..9f3a3342d3 100644 --- a/packages/dashboard/app/hooks/useProjectActions.ts +++ b/packages/dashboard/app/hooks/useProjectActions.ts @@ -3,13 +3,14 @@ import { useTranslation } from "react-i18next"; import { pauseProject, resumeProject, unregisterProject } from "../api"; import type { ProjectInfo } from "../api"; import { replaceProjectIdInUrl } from "../utils/projectUrlState"; -import type { ViewMode } from "./useViewState"; +import type { ViewMode, TaskView } from "./useViewState"; import type { ToastType } from "./useToast"; interface UseProjectActionsOptions { setCurrentProject: (project: ProjectInfo) => void; clearCurrentProject: () => void; setViewMode: (mode: ViewMode) => void; + setTaskView: (view: TaskView) => void; currentProject: ProjectInfo | null; refreshProjects: () => Promise; toggleFavoriteProvider: (provider: string) => Promise; @@ -41,6 +42,7 @@ export function useProjectActions(options: UseProjectActionsOptions): UseProject setCurrentProject, clearCurrentProject, setViewMode, + setTaskView, currentProject, refreshProjects, toggleFavoriteProvider, @@ -62,7 +64,8 @@ export function useProjectActions(options: UseProjectActionsOptions): UseProject replaceProjectIdInUrl(null); clearCurrentProject(); setViewMode("overview"); - }, [clearCurrentProject, setViewMode]); + setTaskView("command-center"); + }, [clearCurrentProject, setViewMode, setTaskView]); const handleOpenSettings = useCallback(() => { openSettings(); diff --git a/packages/dashboard/app/hooks/useTerminalSessions.ts b/packages/dashboard/app/hooks/useTerminalSessions.ts index f5565cef1c..db874a83df 100644 --- a/packages/dashboard/app/hooks/useTerminalSessions.ts +++ b/packages/dashboard/app/hooks/useTerminalSessions.ts @@ -241,7 +241,14 @@ export function useTerminalSessions(projectId?: string): UseTerminalSessionsRetu }, [projectId]); // Re-run when project scope changes // Auto-create first tab if no tabs exist after validation + // On Windows, do NOT auto-create because the embedded shell may invoke Windows Terminal + // (wt.exe) and produce native "Help" version dialogs. Users can still create a terminal + // explicitly from the UI. useEffect(() => { + if (typeof window !== "undefined" && window.navigator.userAgent.includes("Windows")) { + setIsReady(true); + return; + } if (tabs.length === 0 && isReady && serverAvailable && !bootstrapError) { // Capture current generation so only this attempt's result is accepted const gen = generationRef.current;