mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-05 16:23:36 +00:00
Various UI polishing
This commit is contained in:
3 files changed
+23
-43
No files matched your search
@@ -1,9 +1,9 @@
|
||||
import React, { useState, memo } from 'react';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import { Plus, Folder, GitBranch, MoreVertical, Settings, Loader2, ChevronDown } from 'lucide-react';
|
||||
import { Plus, Folder, GitBranch, Settings, Loader2, ChevronDown } from 'lucide-react';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { Skeleton } from '@/components/ui/skeleton';
|
||||
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, DropdownMenuSeparator } from '@/components/ui/dropdown-menu';
|
||||
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from '@/components/ui/dropdown-menu';
|
||||
import { LoginArea } from '@/components/auth/LoginArea';
|
||||
import { StarButton } from '@/components/StarButton';
|
||||
import { useProjectsManager } from '@/hooks/useProjectsManager';
|
||||
@@ -34,7 +34,7 @@ const ProjectItem = memo(({ project, isSelected, onSelect }: ProjectItemProps) =
|
||||
isSelected && "bg-gradient-to-r from-primary/15 to-accent/15 shadow-sm"
|
||||
)}
|
||||
>
|
||||
<div className="w-full p-3 text-left text-sidebar-foreground">
|
||||
<div className="w-full px-3 py-2 text-left text-sidebar-foreground">
|
||||
<button
|
||||
onClick={handleClick}
|
||||
className="absolute inset-0"
|
||||
@@ -48,14 +48,14 @@ const ProjectItem = memo(({ project, isSelected, onSelect }: ProjectItemProps) =
|
||||
)}
|
||||
</div>
|
||||
<div className="flex justify-between gap-2 flex-1 min-w-0">
|
||||
<div className="min-w-0 flex-1">
|
||||
<h3 className="font-medium text-sm truncate mb-1">
|
||||
<div className="min-w-0 flex-1 flex items-center">
|
||||
<h3 className="font-medium text-sm truncate">
|
||||
{project.name}
|
||||
</h3>
|
||||
</div>
|
||||
|
||||
{/* Star Button */}
|
||||
<div className="flex-shrink-0 relative">
|
||||
<div className="flex-shrink-0 relative -mr-2">
|
||||
<StarButton
|
||||
projectId={project.id}
|
||||
projectName={project.name}
|
||||
@@ -139,22 +139,14 @@ export function ProjectSidebar({
|
||||
</h1>
|
||||
</button>
|
||||
<div className="flex items-center gap-1">
|
||||
<DropdownMenu>
|
||||
<DropdownMenuTrigger asChild>
|
||||
<Button variant="ghost" size="sm" className="h-8 w-8 p-0 hover:bg-primary/10">
|
||||
<MoreVertical className="h-4 w-4 text-primary/60 hover:text-primary" />
|
||||
</Button>
|
||||
</DropdownMenuTrigger>
|
||||
<DropdownMenuContent align="end" className="w-48">
|
||||
<DropdownMenuItem
|
||||
onClick={() => navigate('/settings')}
|
||||
className="flex items-center gap-2 w-full"
|
||||
>
|
||||
<Settings className="h-4 w-4" />
|
||||
Settings
|
||||
</DropdownMenuItem>
|
||||
</DropdownMenuContent>
|
||||
</DropdownMenu>
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
className="h-8 w-8 p-0 hover:bg-primary/10"
|
||||
onClick={() => navigate('/settings')}
|
||||
>
|
||||
<Settings className="h-4 w-4 text-primary/60 hover:text-primary" />
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -179,14 +171,6 @@ export function ProjectSidebar({
|
||||
</button>
|
||||
</DropdownMenuTrigger>
|
||||
<DropdownMenuContent align="end" className="w-48">
|
||||
<DropdownMenuItem
|
||||
onClick={handleNewProject}
|
||||
className="flex items-center gap-2 w-full"
|
||||
>
|
||||
<Plus className="h-4 w-4" />
|
||||
New Project
|
||||
</DropdownMenuItem>
|
||||
<DropdownMenuSeparator />
|
||||
<DropdownMenuItem
|
||||
onClick={() => navigate('/clone')}
|
||||
className="flex items-center gap-2 w-full"
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
import { useState, useEffect } from 'react';
|
||||
import { useNavigate, useLocation, Outlet } from 'react-router-dom';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { Menu, Columns2, Settings as SettingsIcon, Bot, GitBranch, Database } from 'lucide-react';
|
||||
import { Menu, Columns2, Bot, GitBranch, Database } from 'lucide-react';
|
||||
import { ProjectSidebar } from '@/components/ProjectSidebar';
|
||||
import { useProjectsManager } from '@/hooks/useProjectsManager';
|
||||
import { useIsMobile } from '@/hooks/useIsMobile';
|
||||
import { type Project } from '@/lib/ProjectsManager';
|
||||
import { useCallback } from 'react';
|
||||
import { cn } from '@/lib/utils';
|
||||
|
||||
interface SettingsItem {
|
||||
id: string;
|
||||
@@ -156,7 +157,7 @@ export function SettingsLayout() {
|
||||
{/* Middle Column - Settings Navigation */}
|
||||
<div className="w-96 border-r bg-white flex flex-col">
|
||||
{/* Header with toggle button */}
|
||||
<div className="p-4 border-b">
|
||||
<div className="h-12 px-4 py-2 border-b">
|
||||
<div className="flex items-center gap-3">
|
||||
<Button
|
||||
variant="ghost"
|
||||
@@ -168,13 +169,9 @@ export function SettingsLayout() {
|
||||
{isSidebarVisible ? <Columns2 className="h-4 w-4" /> : <Menu className="h-4 w-4" />}
|
||||
</Button>
|
||||
<h1 className="text-xl font-bold flex items-center gap-2">
|
||||
<SettingsIcon className="h-5 w-5 text-primary" />
|
||||
Settings
|
||||
</h1>
|
||||
</div>
|
||||
<p className="text-sm text-muted-foreground mt-1">
|
||||
Manage your application settings and preferences
|
||||
</p>
|
||||
</div>
|
||||
|
||||
{/* Settings Navigation */}
|
||||
@@ -188,11 +185,10 @@ export function SettingsLayout() {
|
||||
<button
|
||||
key={item.id}
|
||||
onClick={() => navigate(item.href)}
|
||||
className={`w-full text-left p-3 rounded-lg transition-colors ${
|
||||
isActive
|
||||
? 'bg-primary/10 border border-primary/20'
|
||||
: 'hover:bg-muted/50'
|
||||
}`}
|
||||
className={cn('w-full text-left p-3 rounded-lg transition-colors border border-transparent', {
|
||||
'bg-primary/10 border border-primary/20': isActive,
|
||||
'hover:bg-muted/50': !isActive,
|
||||
})}
|
||||
>
|
||||
<div className="flex items-start gap-3">
|
||||
<Icon className={`h-5 w-5 mt-0.5 ${isActive ? 'text-primary' : 'text-muted-foreground'}`} />
|
||||
|
||||
@@ -362,7 +362,7 @@ export function ProjectView() {
|
||||
<ResizablePanel defaultSize={40} minSize={25}>
|
||||
<div className="h-full flex flex-col">
|
||||
{/* Chat Header */}
|
||||
<div className="px-4 border-b flex-shrink-0">
|
||||
<div className="h-12 px-4 border-b flex-shrink-0">
|
||||
<div className="flex items-center justify-between h-12">
|
||||
{/* Left side - Sidebar toggle */}
|
||||
<div className="flex items-center gap-2">
|
||||
@@ -438,7 +438,7 @@ export function ProjectView() {
|
||||
<ResizablePanel defaultSize={60} minSize={30}>
|
||||
<div className="h-full flex flex-col">
|
||||
{/* Preview Header */}
|
||||
<div className="px-4 border-b flex-shrink-0">
|
||||
<div className="h-12 px-4 border-b flex-shrink-0">
|
||||
<div className="flex items-center justify-between h-12">
|
||||
<div className="flex space-x-2">
|
||||
<Button
|
||||
|
||||
Reference in new issue
Block a user