From 0d57cd8bee3f0d9dbc7cb14a4f285eeaaafaad67 Mon Sep 17 00:00:00 2001 From: moreih29 Date: Thu, 19 Nov 2026 23:50:56 +0900 Subject: [PATCH] fix(workbench): show guidance when no workspace is selected Co-Authored-By: Claude Opus 5.5 --- src/renderer/app.tsx | 14 +++++++++----- .../components/workbench/welcome-screen.tsx | 12 +++++++----- src/shared/i18n/locales/en/common.json | 1 + src/shared/i18n/locales/ko/common.json | 1 + 4 files changed, 18 insertions(+), 10 deletions(-) diff --git a/src/renderer/app.tsx b/src/renderer/app.tsx index ff6e1287b..8c3cfbc81 100644 --- a/src/renderer/app.tsx +++ b/src/renderer/app.tsx @@ -1,5 +1,5 @@ import { useMonaco } from "@monaco-editor/react"; -import { useCallback, useEffect, useRef } from "react"; +import { useCallback, useEffect, useRef, useState } from "react"; import { createLogger } from "../shared/log/renderer"; import type { WorkspaceMeta } from "../shared/types/workspace"; import { bootstrapClaudeStatus, bootstrapWorkbench } from "./bootstrap"; @@ -62,6 +62,7 @@ export function App() { // workspace's tabs below it, for each connection status and progress. const workspaces = useWorkspacesStore((s) => s.workspaces); const activeWorkspaceId = useActiveStore((s) => s.activeWorkspaceId); + const [restoringWorkbench, setRestoringWorkbench] = useState(true); const settingsOpen = useSettingsUIStore((s) => s.settingsOpen); const settingsInitialActiveId = useSettingsUIStore((s) => s.initialActiveId); const closeSettings = useSettingsUIStore((s) => s.closeSettings); @@ -91,9 +92,10 @@ export function App() { initializeEditorServices(monaco); }, [monaco]); - // Restore the tabs and workspace selection before opening the CLI gate. + // The workspace list arrives before the restored selection. Wait for both + // before showing a welcome screen. useEffect(() => { - void bootstrapWorkbench(); + void bootstrapWorkbench().finally(() => setRestoringWorkbench(false)); void bootstrapClaudeStatus(); }, []); @@ -283,9 +285,11 @@ export function App() { > {/* In the one cell, as the panels are: the agent view, kept mounted there, would push it into a row of its own below. */} - {workspaces.length === 0 && !agentView && ( + {!restoringWorkbench && activeWorkspaceId === null && !agentView && (
- +
)} {mountedWorkspaces.map((ws) => ( diff --git a/src/renderer/components/workbench/welcome-screen.tsx b/src/renderer/components/workbench/welcome-screen.tsx index 1f5b52def..4f0d546f7 100644 --- a/src/renderer/components/workbench/welcome-screen.tsx +++ b/src/renderer/components/workbench/welcome-screen.tsx @@ -5,10 +5,10 @@ import { useTranslation } from "react-i18next"; import { Button } from "../ui/button"; interface WelcomeScreenProps { - readonly onAddWorkspace: () => void; + readonly onAddWorkspace?: () => void; } -/** Renders the entrypoint for opening the Add-Workspace flow (local folder OR SSH). */ +/** Prompts the user to add their first workspace or select an existing one. */ export function WelcomeScreen({ onAddWorkspace }: WelcomeScreenProps): React.JSX.Element { const { t } = useTranslation(); return ( @@ -16,13 +16,15 @@ export function WelcomeScreen({ onAddWorkspace }: WelcomeScreenProps): React.JSX

{t("welcome.no_workspace")}

-

{t("welcome.add_to_start")}

+

+ {onAddWorkspace ? t("welcome.add_to_start") : t("welcome.select_from_sidebar")} +

-
+ {onAddWorkspace && ( -
+ )}
); diff --git a/src/shared/i18n/locales/en/common.json b/src/shared/i18n/locales/en/common.json index 6ef8aed26..df7d365a8 100644 --- a/src/shared/i18n/locales/en/common.json +++ b/src/shared/i18n/locales/en/common.json @@ -77,6 +77,7 @@ "welcome": { "no_workspace": "No workspace selected", "add_to_start": "Add a workspace to get started.", + "select_from_sidebar": "Choose a workspace from the sidebar.", "add_workspace": "Add workspace" }, "statusBar": { diff --git a/src/shared/i18n/locales/ko/common.json b/src/shared/i18n/locales/ko/common.json index 8406bab3b..417981fdd 100644 --- a/src/shared/i18n/locales/ko/common.json +++ b/src/shared/i18n/locales/ko/common.json @@ -77,6 +77,7 @@ "welcome": { "no_workspace": "선택된 워크스페이스 없음", "add_to_start": "워크스페이스를 추가하여 시작하세요.", + "select_from_sidebar": "사이드바에서 워크스페이스를 선택하세요.", "add_workspace": "워크스페이스 추가" }, "statusBar": {