From 2bd8135b3fa0d8c92e470250c4edb5fd5049cdbf Mon Sep 17 00:00:00 2001 From: Ammar Date: Fri, 17 Oct 2025 21:09:10 -0500 Subject: [PATCH 1/3] =?UTF-8?q?=F0=9F=A4=96=20Improve=20loading=20workspac?= =?UTF-8?q?e=20UI=20and=20add=20debug=20helper?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Replace LoadingIndicator with EmptyState for consistent styling - Loading state now matches 'No Messages Yet' visual style - Add window.__showLoadingWorkspace() debug function to inspect UI - Remove unused LoadingIndicator component --- src/App.tsx | 17 +++++++++++++++++ src/components/AIView.tsx | 17 +++-------------- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 5738e2e10..725bef74e 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -768,6 +768,23 @@ function AppInner() { ); }, [projects, setSelectedWorkspace, setWorkspaceMetadata]); + // Debug: Register window function to show loading workspace state + useEffect(() => { + (window as any).__showLoadingWorkspace = () => { + const current = selectedWorkspace; + handleWorkspaceSwitch(null); + setTimeout(() => { + if (current) { + handleWorkspaceSwitch(current); + } + }, 2000); + }; + + return () => { + delete (window as any).__showLoadingWorkspace; + }; + }, [selectedWorkspace, handleWorkspaceSwitch]); + return ( <> diff --git a/src/components/AIView.tsx b/src/components/AIView.tsx index e4e94dbb7..034007748 100644 --- a/src/components/AIView.tsx +++ b/src/components/AIView.tsx @@ -94,15 +94,6 @@ const TerminalIconButton = styled.button` } `; -const LoadingIndicator = styled.div` - display: flex; - align-items: center; - justify-content: center; - height: 100%; - color: #888; - font-size: 14px; -`; - const OutputContainer = styled.div` flex: 1; position: relative; @@ -368,11 +359,9 @@ const AIViewInner: React.FC = ({ if (!workspaceState) { return ( - - - Loading workspace... - - + +

Loading workspace...

+
); } From c148fcc94544067cc66e57c60452cfed86201965 Mon Sep 17 00:00:00 2001 From: Ammar Date: Fri, 17 Oct 2025 21:14:15 -0500 Subject: [PATCH 2/3] Fix __showLoadingWorkspace to trigger actual loading state Previous implementation showed welcome screen instead of loading state. Now temporarily removes workspace from store, showing 'Loading workspace...' for 2 seconds before restoring the workspace data. --- src/App.tsx | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 725bef74e..1649721ca 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -771,19 +771,32 @@ function AppInner() { // Debug: Register window function to show loading workspace state useEffect(() => { (window as any).__showLoadingWorkspace = () => { - const current = selectedWorkspace; - handleWorkspaceSwitch(null); + if (!selectedWorkspace) { + console.warn("No workspace selected"); + return; + } + + const workspaceId = selectedWorkspace.workspaceId; + const metadata = workspaceMetadata.get(workspaceId); + + if (!metadata) { + console.warn("No metadata for workspace", workspaceId); + return; + } + + // Temporarily remove workspace from store to show loading state + workspaceStore.removeWorkspace(workspaceId); + + // Re-add after 2 seconds to restore state setTimeout(() => { - if (current) { - handleWorkspaceSwitch(current); - } + workspaceStore.addWorkspace(metadata); }, 2000); }; return () => { delete (window as any).__showLoadingWorkspace; }; - }, [selectedWorkspace, handleWorkspaceSwitch]); + }, [selectedWorkspace, workspaceMetadata, workspaceStore]); return ( <> From 48c6a65b50020149f43b8a383e5c42b8efb45867 Mon Sep 17 00:00:00 2001 From: Ammar Date: Fri, 17 Oct 2025 21:17:14 -0500 Subject: [PATCH 3/3] Remove debug window function, fix EmptyState centering - Add flex: 1 to EmptyState so it properly fills ViewContainer - Remove __showLoadingWorkspace debug function (too complex to implement correctly) - Loading and empty states now properly centered --- src/App.tsx | 30 ------------------------------ src/components/AIView.tsx | 1 + 2 files changed, 1 insertion(+), 30 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 1649721ca..5738e2e10 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -768,36 +768,6 @@ function AppInner() { ); }, [projects, setSelectedWorkspace, setWorkspaceMetadata]); - // Debug: Register window function to show loading workspace state - useEffect(() => { - (window as any).__showLoadingWorkspace = () => { - if (!selectedWorkspace) { - console.warn("No workspace selected"); - return; - } - - const workspaceId = selectedWorkspace.workspaceId; - const metadata = workspaceMetadata.get(workspaceId); - - if (!metadata) { - console.warn("No metadata for workspace", workspaceId); - return; - } - - // Temporarily remove workspace from store to show loading state - workspaceStore.removeWorkspace(workspaceId); - - // Re-add after 2 seconds to restore state - setTimeout(() => { - workspaceStore.addWorkspace(metadata); - }, 2000); - }; - - return () => { - delete (window as any).__showLoadingWorkspace; - }; - }, [selectedWorkspace, workspaceMetadata, workspaceStore]); - return ( <> diff --git a/src/components/AIView.tsx b/src/components/AIView.tsx index 034007748..9c31b621f 100644 --- a/src/components/AIView.tsx +++ b/src/components/AIView.tsx @@ -110,6 +110,7 @@ const OutputContent = styled.div` `; const EmptyState = styled.div` + flex: 1; display: flex; flex-direction: column; align-items: center;