mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-06 00:27:24 +00:00
Don't use flexible sidebar in ChatView
This commit is contained in:
2 files changed
+97
-620
No files matched your search
+97
-106
@@ -4,7 +4,6 @@ import { type Chat } from '@/lib/ChatsManager';
|
||||
import { useChatsManager } from '@/hooks/useChatsManager';
|
||||
import { ChatPane, type ChatPaneRef } from '@/components/Shakespeare/ChatPane';
|
||||
import { ProjectSidebar } from '@/components/ProjectSidebar';
|
||||
import { ResizablePanelGroup, ResizablePanel, ResizableHandle } from '@/components/ui/resizable';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { Skeleton } from '@/components/ui/skeleton';
|
||||
import { ArrowLeft, Menu } from 'lucide-react';
|
||||
@@ -115,51 +114,47 @@ export function ChatView() {
|
||||
|
||||
// Desktop layout for not found
|
||||
return (
|
||||
<div className="h-screen flex flex-col bg-background">
|
||||
<ResizablePanelGroup direction="horizontal">
|
||||
{isSidebarVisible && (
|
||||
<>
|
||||
<ResizablePanel defaultSize={20} minSize={15} maxSize={30}>
|
||||
<ProjectSidebar
|
||||
selectedProject={null}
|
||||
onSelectProject={() => {}}
|
||||
onToggleSidebar={() => setIsSidebarVisible(false)}
|
||||
/>
|
||||
</ResizablePanel>
|
||||
<ResizableHandle withHandle />
|
||||
</>
|
||||
)}
|
||||
<div className="h-screen flex bg-background">
|
||||
{/* Fixed Sidebar */}
|
||||
{isSidebarVisible && (
|
||||
<div className="w-72 border-r bg-sidebar">
|
||||
<ProjectSidebar
|
||||
selectedProject={null}
|
||||
onSelectProject={() => {}}
|
||||
className="h-screen sticky top-0"
|
||||
onToggleSidebar={() => setIsSidebarVisible(false)}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
|
||||
<ResizablePanel defaultSize={isSidebarVisible ? 80 : 100}>
|
||||
<div className="h-screen flex flex-col">
|
||||
<div className="flex-1 flex items-center justify-center p-4">
|
||||
{/* Menu button when sidebar is collapsed */}
|
||||
{!isSidebarVisible && (
|
||||
<div className="absolute top-4 left-4">
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
onClick={() => setIsSidebarVisible(true)}
|
||||
>
|
||||
<Menu className="h-4 w-4" />
|
||||
</Button>
|
||||
</div>
|
||||
)}
|
||||
|
||||
<div className="text-center">
|
||||
<h1 className="text-2xl font-bold mb-2">Chat Not Found</h1>
|
||||
<p className="text-muted-foreground mb-4">
|
||||
This chat may have been deleted or doesn't exist.
|
||||
</p>
|
||||
<Button onClick={() => navigate('/')} variant="outline">
|
||||
<ArrowLeft className="mr-2 h-4 w-4" />
|
||||
Back to Home
|
||||
</Button>
|
||||
</div>
|
||||
{/* Main Content Area */}
|
||||
<div className="flex-1 flex flex-col">
|
||||
<div className="flex-1 flex items-center justify-center p-4 relative">
|
||||
{/* Menu button when sidebar is collapsed */}
|
||||
{!isSidebarVisible && (
|
||||
<div className="absolute top-4 left-4">
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
onClick={() => setIsSidebarVisible(true)}
|
||||
>
|
||||
<Menu className="h-4 w-4" />
|
||||
</Button>
|
||||
</div>
|
||||
)}
|
||||
|
||||
<div className="text-center">
|
||||
<h1 className="text-2xl font-bold mb-2">Chat Not Found</h1>
|
||||
<p className="text-muted-foreground mb-4">
|
||||
This chat may have been deleted or doesn't exist.
|
||||
</p>
|
||||
<Button onClick={() => navigate('/')} variant="outline">
|
||||
<ArrowLeft className="mr-2 h-4 w-4" />
|
||||
Back to Home
|
||||
</Button>
|
||||
</div>
|
||||
</ResizablePanel>
|
||||
</ResizablePanelGroup>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -246,81 +241,77 @@ export function ChatView() {
|
||||
|
||||
// Desktop layout
|
||||
return (
|
||||
<div className="h-screen flex flex-col bg-background">
|
||||
<ResizablePanelGroup direction="horizontal">
|
||||
{isSidebarVisible && (
|
||||
<>
|
||||
<ResizablePanel defaultSize={20} minSize={15} maxSize={30}>
|
||||
<ProjectSidebar
|
||||
selectedProject={null}
|
||||
onSelectProject={() => {}}
|
||||
onToggleSidebar={() => setIsSidebarVisible(false)}
|
||||
/>
|
||||
</ResizablePanel>
|
||||
<ResizableHandle withHandle />
|
||||
</>
|
||||
)}
|
||||
<div className="h-screen flex bg-background">
|
||||
{/* Fixed Sidebar */}
|
||||
{isSidebarVisible && (
|
||||
<div className="w-72 border-r bg-sidebar">
|
||||
<ProjectSidebar
|
||||
selectedProject={null}
|
||||
onSelectProject={() => {}}
|
||||
className="h-screen sticky top-0"
|
||||
onToggleSidebar={() => setIsSidebarVisible(false)}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
|
||||
<ResizablePanel defaultSize={isSidebarVisible ? 80 : 100}>
|
||||
<div className="h-screen flex flex-col">
|
||||
<header className="pt-safe bg-gradient-to-r from-primary/10 via-accent/5 to-primary/10 backdrop-blur">
|
||||
<div className="h-12 border-b px-4 py-3 flex items-center justify-between">
|
||||
<div className="flex items-center space-x-2 overflow-hidden">
|
||||
{!isSidebarVisible && (
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
onClick={() => setIsSidebarVisible(true)}
|
||||
>
|
||||
<Menu className="h-4 w-4" />
|
||||
</Button>
|
||||
)}
|
||||
<div className="flex min-w-0 flex-1">
|
||||
{chat ? (
|
||||
<div className="text-sm font-semibold truncate">
|
||||
{chat.name}
|
||||
</div>
|
||||
) : (
|
||||
<Skeleton className="h-5 w-32" />
|
||||
)}
|
||||
{/* Main Content Area */}
|
||||
<div className="flex-1 flex flex-col">
|
||||
<header className="pt-safe bg-gradient-to-r from-primary/10 via-accent/5 to-primary/10 backdrop-blur">
|
||||
<div className="h-12 border-b px-4 py-3 flex items-center justify-between">
|
||||
<div className="flex items-center space-x-2 overflow-hidden">
|
||||
{!isSidebarVisible && (
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
onClick={() => setIsSidebarVisible(true)}
|
||||
>
|
||||
<Menu className="h-4 w-4" />
|
||||
</Button>
|
||||
)}
|
||||
<div className="flex min-w-0 flex-1">
|
||||
{chat ? (
|
||||
<div className="text-sm font-semibold truncate">
|
||||
{chat.name}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="flex items-center gap-2">
|
||||
{chat ? (
|
||||
<ActionsMenu
|
||||
projectId={chat.id}
|
||||
projectName={chat.name}
|
||||
onNewChat={handleNewChat}
|
||||
isLoading={isAILoading}
|
||||
isBuildLoading={false}
|
||||
onFirstInteraction={handleFirstInteraction}
|
||||
isChat={true}
|
||||
onChatDeleted={handleChatDeleted}
|
||||
/>
|
||||
) : (
|
||||
<Skeleton className="h-8 w-8 rounded" />
|
||||
)}
|
||||
</div>
|
||||
) : (
|
||||
<Skeleton className="h-5 w-32" />
|
||||
)}
|
||||
</div>
|
||||
</header>
|
||||
</div>
|
||||
|
||||
<div className="flex-1 overflow-hidden">
|
||||
{chat && (
|
||||
<ChatPane
|
||||
ref={chatPaneRef}
|
||||
<div className="flex items-center gap-2">
|
||||
{chat ? (
|
||||
<ActionsMenu
|
||||
projectId={chat.id}
|
||||
projectName={chat.name}
|
||||
onNewChat={handleNewChat}
|
||||
onFirstInteraction={handleFirstInteraction}
|
||||
onLoadingChange={handleAILoadingChange}
|
||||
isLoading={isAILoading}
|
||||
isBuildLoading={false}
|
||||
onFirstInteraction={handleFirstInteraction}
|
||||
isChat={true}
|
||||
onChatDeleted={handleChatDeleted}
|
||||
/>
|
||||
) : (
|
||||
<Skeleton className="h-8 w-8 rounded" />
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</ResizablePanel>
|
||||
</ResizablePanelGroup>
|
||||
</header>
|
||||
|
||||
<div className="flex-1 overflow-hidden">
|
||||
{chat && (
|
||||
<ChatPane
|
||||
ref={chatPaneRef}
|
||||
projectId={chat.id}
|
||||
onNewChat={handleNewChat}
|
||||
onFirstInteraction={handleFirstInteraction}
|
||||
onLoadingChange={handleAILoadingChange}
|
||||
isLoading={isAILoading}
|
||||
isChat={true}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user