breakout new chat button from dropdown menu

This commit is contained in:
lemonknowsall committed 2026-01-16 13:55:29 -08:00
1 parent a4271de370
commit 05100d295e
3 files changed
+25 -16

No files matched your search

-12
View File
@@ -7,7 +7,6 @@ import {
DropdownMenuTrigger,
} from '@/components/ui/dropdown-menu';
import {
MessageSquarePlus,
History,
Folder,
Copy,
@@ -22,7 +21,6 @@ import { useQueryClient } from '@tanstack/react-query';
interface ProjectTitleMenuProps {
projectId: string;
projectName: string;
onNewChat: () => void;
onGitHistory: () => void;
onDuplicate: () => void;
onDelete: () => void;
@@ -35,7 +33,6 @@ interface ProjectTitleMenuProps {
export function ProjectTitleMenu({
projectId,
projectName,
onNewChat,
onGitHistory,
onDuplicate,
onDelete,
@@ -109,15 +106,6 @@ export function ProjectTitleMenu({
Rollback
</DropdownMenuItem>
<DropdownMenuItem
onClick={onNewChat}
disabled={isAILoading}
className="gap-2"
>
<MessageSquarePlus className="h-4 w-4" />
New Chat
</DropdownMenuItem>
<DropdownMenuItem
onClick={onDuplicate}
disabled={isAnyLoading}
+1
View File
@@ -117,6 +117,7 @@
"emailUpdates": "Email Updates",
"emailUpdatesDescription": "Subscribe to Shakespeare updates and resources",
"newProject": "New Project",
"newChat": "New Chat",
"importRepository": "Import Repository",
"noProjectsYet": "No projects yet",
"createFirstProject": "Create your first project to get started",
+24 -4
View File
@@ -11,7 +11,7 @@ import { DeleteProjectDialog } from '@/components/DeleteProjectDialog';
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, Loader2 } from 'lucide-react';
import { ArrowLeft, MessageSquare, Eye, Code, Menu, Loader2, MessageSquarePlus } from 'lucide-react';
import { useNavigate } from 'react-router-dom';
import { useIsMobile } from '@/hooks/useIsMobile';
import { ProjectTitleMenu } from '@/components/ProjectTitleMenu';
@@ -212,7 +212,6 @@ export function ProjectView() {
<ProjectTitleMenu
projectId={project.id}
projectName={project.name}
onNewChat={handleNewChat}
onGitHistory={() => setGitHistoryOpen(true)}
onDuplicate={() => setDuplicateDialogOpen(true)}
onDelete={() => setDeleteDialogOpen(true)}
@@ -230,6 +229,16 @@ export function ProjectView() {
<div className="flex items-center gap-4 px-3">
{project ? (
<>
<Button
variant="ghost"
size="sm"
onClick={handleNewChat}
disabled={isAILoading}
className="size-8 p-0 group"
title={t('newChat')}
>
<MessageSquarePlus className="size-5 group-hover:text-foreground text-muted-foreground" />
</Button>
<GitSyncButton
projectId={project.id}
className="h-8 w-8"
@@ -244,6 +253,7 @@ export function ProjectView() {
<>
<Skeleton className="h-8 w-8 rounded" />
<Skeleton className="h-8 w-8 rounded" />
<Skeleton className="h-8 w-8 rounded" />
</>
)}
</div>
@@ -442,7 +452,6 @@ export function ProjectView() {
<ProjectTitleMenu
projectId={project.id}
projectName={project.name}
onNewChat={handleNewChat}
onGitHistory={() => setGitHistoryOpen(true)}
onDuplicate={() => setDuplicateDialogOpen(true)}
onDelete={() => setDeleteDialogOpen(true)}
@@ -457,10 +466,20 @@ export function ProjectView() {
</div>
</div>
{/* Right side - Deploy and Sync buttons */}
{/* Right side - New Chat, Deploy and Sync buttons */}
<div className="flex items-center gap-2">
{project ? (
<>
<Button
variant="ghost"
size="sm"
onClick={handleNewChat}
disabled={isAILoading}
className="size-8 p-0 group"
title={t('newChat')}
>
<MessageSquarePlus className="size-5 group-hover:text-foreground text-muted-foreground" />
</Button>
<GitSyncButton
projectId={project.id}
className="h-8 w-8"
@@ -475,6 +494,7 @@ export function ProjectView() {
<>
<Skeleton className="h-8 w-8 rounded" />
<Skeleton className="h-8 w-8 rounded" />
<Skeleton className="h-8 w-8 rounded" />
</>
)}
</div>