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.
This commit is contained in:
ddonaldson130
2026-07-03 03:15:17 -04:00
parent c7641f9d5e
commit fd94f7a191
3 changed files with 14 additions and 3 deletions

View File

@@ -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,

View File

@@ -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<void>;
toggleFavoriteProvider: (provider: string) => Promise<void>;
@@ -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();

View File

@@ -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;