From 0edef42bf2007c8c803dbc19c48de32dd2344530 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sat, 13 Sep 2025 18:30:19 -0500 Subject: [PATCH] Start fixing loading state of ProjectView --- src/pages/ProjectView.tsx | 264 +++++++++++++++++++++++--------------- 1 file changed, 162 insertions(+), 102 deletions(-) diff --git a/src/pages/ProjectView.tsx b/src/pages/ProjectView.tsx index 9c193a78..ac5ce99e 100644 --- a/src/pages/ProjectView.tsx +++ b/src/pages/ProjectView.tsx @@ -8,6 +8,7 @@ import { ProjectSidebar } from '@/components/ProjectSidebar'; import { ProjectInfoDialog } from '@/components/ProjectInfoDialog'; import { ResizablePanelGroup, ResizablePanel, ResizableHandle } from '@/components/ui/resizable'; import { Button } from '@/components/ui/button'; +import { Skeleton } from '@/components/ui/skeleton'; import { ArrowLeft, MessageSquare, Eye, Code, Menu, Columns2 } from 'lucide-react'; import { useNavigate } from 'react-router-dom'; import { ActionsMenu } from '@/components/ActionsMenu'; @@ -175,15 +176,7 @@ export function ProjectView() { navigate('/'); }; - if (isLoading) { - return ( -
-
-
- ); - } - - if (!project) { + if (!project && !isLoading) { return (
@@ -210,34 +203,47 @@ export function ProjectView() {
- + {project ? ( + + ) : ( + + )}
- - + {project ? ( + <> + + + + ) : ( + <> + + + + )}
@@ -270,24 +276,40 @@ export function ProjectView() {
{mobileView === 'chat' && ( - + project ? ( + + ) : ( +
+ + + + +
+ ) )} {(mobileView === 'preview' || mobileView === 'code') && ( - + project ? ( + + ) : ( +
+ + +
+ ) )}
@@ -298,6 +320,7 @@ export function ProjectView() { size="sm" onClick={() => setMobileView('chat')} className="flex-1 rounded-none" + disabled={!project} > Chat @@ -307,6 +330,7 @@ export function ProjectView() { size="sm" onClick={() => setMobileView('preview')} className="flex-1 rounded-none" + disabled={!project} > Preview @@ -316,10 +340,11 @@ export function ProjectView() { size="sm" onClick={() => setMobileView('code')} className="flex-1 rounded-none" + disabled={!project} > Code - {mobileView !== 'code' && ( + {mobileView !== 'code' && project && ( )} @@ -327,11 +352,13 @@ export function ProjectView() {
{/* Project Info Dialog */} - + {project && ( + + )} ); } @@ -339,7 +366,7 @@ export function ProjectView() { return (
{/* Fixed Sidebar */} -
+
{ @@ -380,53 +407,75 @@ export function ProjectView() { {/* Center - Project title */}
- + {project ? ( + + ) : ( + + )}
{/* Right side - Star and Actions Menu */}
- - + {project ? ( + <> + + + + ) : ( + <> + + + + )}
{/* Chat Content */}
- + {project ? ( + + ) : ( +
+ + + + +
+ )}
@@ -445,6 +494,7 @@ export function ProjectView() { variant={activeTab === 'preview' ? 'default' : 'ghost'} size="sm" onClick={() => setActiveTab('preview')} + disabled={!project} > Preview @@ -453,9 +503,10 @@ export function ProjectView() { size="sm" onClick={() => setActiveTab('code')} className="gap-2" + disabled={!project} > Code - {activeTab !== 'code' && ( + {activeTab !== 'code' && project && ( )} @@ -465,10 +516,17 @@ export function ProjectView() { {/* Preview Content */}
- + {project ? ( + + ) : ( +
+ + +
+ )}
@@ -477,11 +535,13 @@ export function ProjectView() { {/* Project Info Dialog */} - + {project && ( + + )} ); }