mirror of
https://github.com/jamiepine/voicebox.git
synced 2026-09-29 07:05:14 -07:00
Enhance App UI with logo and animations
- Added a voicebox logo to the loading screen in the App component for improved branding. - Introduced fade-in animations for the logo and loading text to enhance user experience. - Updated Sidebar component styles for better visual consistency. - Refactored HistoryTable to implement a new fixed-height row layout, improving readability and interaction. - Removed unused Badge component from GenerationForm for cleaner code.
This commit is contained in:
+12
-3
@@ -11,6 +11,7 @@ import { Sidebar } from '@/components/Sidebar';
|
|||||||
import { AudioPlayer } from '@/components/AudioPlayer/AudioPlayer';
|
import { AudioPlayer } from '@/components/AudioPlayer/AudioPlayer';
|
||||||
import { UpdateNotification } from '@/components/UpdateNotification';
|
import { UpdateNotification } from '@/components/UpdateNotification';
|
||||||
import { isTauri, startServer, setupWindowCloseHandler } from '@/lib/tauri';
|
import { isTauri, startServer, setupWindowCloseHandler } from '@/lib/tauri';
|
||||||
|
import voiceboxLogo from '@/assets/voicebox-logo.png';
|
||||||
|
|
||||||
// Track if server is starting to prevent duplicate starts
|
// Track if server is starting to prevent duplicate starts
|
||||||
let serverStarting = false;
|
let serverStarting = false;
|
||||||
@@ -77,9 +78,17 @@ function App() {
|
|||||||
if (isTauri() && !serverReady) {
|
if (isTauri() && !serverReady) {
|
||||||
return (
|
return (
|
||||||
<div className="min-h-screen bg-background flex items-center justify-center">
|
<div className="min-h-screen bg-background flex items-center justify-center">
|
||||||
<div className="text-center space-y-4">
|
<div className="text-center space-y-6">
|
||||||
<div className="animate-spin rounded-full h-12 w-12 border-b-2 border-primary mx-auto"></div>
|
<div className="flex justify-center">
|
||||||
<p className="text-muted-foreground">Starting server...</p>
|
<img
|
||||||
|
src={voiceboxLogo}
|
||||||
|
alt="Voicebox"
|
||||||
|
className="w-16 h-16 object-contain animate-fade-in-scale"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<p className="text-muted-foreground text-lg animate-fade-in-delayed">
|
||||||
|
Starting voicebox...
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ import { zodResolver } from '@hookform/resolvers/zod';
|
|||||||
import { Loader2, Mic } from 'lucide-react';
|
import { Loader2, Mic } from 'lucide-react';
|
||||||
import { useForm } from 'react-hook-form';
|
import { useForm } from 'react-hook-form';
|
||||||
import * as z from 'zod';
|
import * as z from 'zod';
|
||||||
import { Badge } from '@/components/ui/badge';
|
|
||||||
import { Button } from '@/components/ui/button';
|
import { Button } from '@/components/ui/button';
|
||||||
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';
|
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';
|
||||||
import {
|
import {
|
||||||
@@ -104,7 +103,7 @@ export function GenerationForm() {
|
|||||||
<div className="mt-2 p-3 border rounded-md bg-muted/50 flex items-center gap-2">
|
<div className="mt-2 p-3 border rounded-md bg-muted/50 flex items-center gap-2">
|
||||||
<Mic className="h-4 w-4 text-muted-foreground" />
|
<Mic className="h-4 w-4 text-muted-foreground" />
|
||||||
<span className="font-medium">{selectedProfile.name}</span>
|
<span className="font-medium">{selectedProfile.name}</span>
|
||||||
<Badge variant="outline">{selectedProfile.language}</Badge>
|
<span className="text-sm text-muted-foreground">{selectedProfile.language}</span>
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<div className="mt-2 p-3 border border-dashed rounded-md text-sm text-muted-foreground">
|
<div className="mt-2 p-3 border border-dashed rounded-md text-sm text-muted-foreground">
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import { Download, MoreHorizontal, Play, Trash2 } from 'lucide-react';
|
import { AudioWaveform, Download, MoreHorizontal, Play, Trash2 } from 'lucide-react';
|
||||||
import { useState } from 'react';
|
import { useState } from 'react';
|
||||||
import { Badge } from '@/components/ui/badge';
|
|
||||||
import { Button } from '@/components/ui/button';
|
import { Button } from '@/components/ui/button';
|
||||||
import {
|
import {
|
||||||
DropdownMenu,
|
DropdownMenu,
|
||||||
@@ -8,20 +7,17 @@ import {
|
|||||||
DropdownMenuItem,
|
DropdownMenuItem,
|
||||||
DropdownMenuTrigger,
|
DropdownMenuTrigger,
|
||||||
} from '@/components/ui/dropdown-menu';
|
} from '@/components/ui/dropdown-menu';
|
||||||
import {
|
import { Textarea } from '@/components/ui/textarea';
|
||||||
Table,
|
|
||||||
TableBody,
|
|
||||||
TableCell,
|
|
||||||
TableHead,
|
|
||||||
TableHeader,
|
|
||||||
TableRow,
|
|
||||||
} from '@/components/ui/table';
|
|
||||||
import { apiClient } from '@/lib/api/client';
|
import { apiClient } from '@/lib/api/client';
|
||||||
import { useDeleteGeneration, useHistory } from '@/lib/hooks/useHistory';
|
import { useDeleteGeneration, useHistory } from '@/lib/hooks/useHistory';
|
||||||
import { cn } from '@/lib/utils/cn';
|
import { cn } from '@/lib/utils/cn';
|
||||||
import { formatDate, formatDuration } from '@/lib/utils/format';
|
import { formatDate, formatDuration } from '@/lib/utils/format';
|
||||||
import { usePlayerStore } from '@/stores/playerStore';
|
import { usePlayerStore } from '@/stores/playerStore';
|
||||||
|
|
||||||
|
// OLD TABLE-BASED COMPONENT - REMOVED (can be found in git history)
|
||||||
|
// This is the new alternate history view with fixed height rows
|
||||||
|
|
||||||
|
// NEW ALTERNATE HISTORY VIEW - FIXED HEIGHT ROWS
|
||||||
export function HistoryTable() {
|
export function HistoryTable() {
|
||||||
const [page, setPage] = useState(0);
|
const [page, setPage] = useState(0);
|
||||||
const limit = 20;
|
const limit = 20;
|
||||||
@@ -77,80 +73,99 @@ export function HistoryTable() {
|
|||||||
<>
|
<>
|
||||||
<div
|
<div
|
||||||
className={cn(
|
className={cn(
|
||||||
'flex-1 min-h-0 overflow-y-auto border rounded-md overflow-x-hidden',
|
'flex-1 min-h-0 overflow-y-auto space-y-2',
|
||||||
isPlayerVisible && 'max-h-[calc(100vh-220px)]',
|
isPlayerVisible && 'max-h-[calc(100vh-220px)]',
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
<Table className="w-full table-fixed">
|
{history.map((gen) => {
|
||||||
<TableHeader className="sticky top-0 bg-background z-10">
|
const isCurrentlyPlaying = currentAudioId === gen.id && isPlaying;
|
||||||
<TableRow>
|
return (
|
||||||
<TableHead className="w-[38%]">Input</TableHead>
|
<div
|
||||||
<TableHead className="w-[13%]">Voice</TableHead>
|
key={gen.id}
|
||||||
<TableHead className="w-[9%]">Lang</TableHead>
|
className={cn(
|
||||||
<TableHead className="w-[9%]">Length</TableHead>
|
'flex items-stretch gap-4 h-24 border rounded-md p-3 bg-card hover:bg-muted/70 transition-colors cursor-pointer',
|
||||||
<TableHead className="w-[13%]">Date</TableHead>
|
isCurrentlyPlaying && 'bg-muted/70',
|
||||||
<TableHead className="w-[8%] text-right"></TableHead>
|
)}
|
||||||
</TableRow>
|
onClick={() => handlePlay(gen.id, gen.text)}
|
||||||
</TableHeader>
|
onKeyDown={(e) => {
|
||||||
<TableBody>
|
if (e.key === 'Enter' || e.key === ' ') {
|
||||||
{history.map((gen) => {
|
e.preventDefault();
|
||||||
const isCurrentlyPlaying = currentAudioId === gen.id && isPlaying;
|
handlePlay(gen.id, gen.text);
|
||||||
return (
|
}
|
||||||
<TableRow
|
}}
|
||||||
key={gen.id}
|
tabIndex={0}
|
||||||
className={cn(isCurrentlyPlaying && 'bg-muted/50', 'cursor-pointer')}
|
role="button"
|
||||||
onClick={() => handlePlay(gen.id, gen.text)}
|
aria-label="Play audio"
|
||||||
>
|
>
|
||||||
<TableCell className="truncate">{gen.text}</TableCell>
|
{/* Waveform icon */}
|
||||||
<TableCell className="truncate">{gen.profile_name}</TableCell>
|
<div className="flex items-center shrink-0">
|
||||||
<TableCell>
|
<AudioWaveform className="h-5 w-5 text-muted-foreground" />
|
||||||
<Badge variant="outline" className="text-xs text-muted-foreground">
|
</div>
|
||||||
{gen.language}
|
|
||||||
</Badge>
|
{/* Left side - Meta information */}
|
||||||
</TableCell>
|
<div className="flex flex-col gap-1.5 w-48 shrink-0 justify-center">
|
||||||
<TableCell className="text-sm">{formatDuration(gen.duration)}</TableCell>
|
<div className="font-medium text-sm truncate" title={gen.profile_name}>
|
||||||
<TableCell className="text-xs text-muted-foreground/60">
|
{gen.profile_name}
|
||||||
{formatDate(gen.created_at)}
|
</div>
|
||||||
</TableCell>
|
<div className="flex items-center gap-2">
|
||||||
<TableCell className="text-right">
|
<span className="text-xs text-muted-foreground">
|
||||||
<div className="flex justify-end" onClick={(e) => e.stopPropagation()}>
|
{gen.language}
|
||||||
<DropdownMenu>
|
</span>
|
||||||
<DropdownMenuTrigger asChild>
|
<span className="text-xs text-muted-foreground">
|
||||||
<Button
|
{formatDuration(gen.duration)}
|
||||||
variant="ghost"
|
</span>
|
||||||
size="icon"
|
</div>
|
||||||
className="h-7 w-7 rounded-full"
|
<div className="text-xs text-muted-foreground">
|
||||||
aria-label="Actions"
|
{formatDate(gen.created_at)}
|
||||||
>
|
</div>
|
||||||
<MoreHorizontal className="h-3.5 w-3.5" />
|
</div>
|
||||||
</Button>
|
|
||||||
</DropdownMenuTrigger>
|
{/* Right side - Transcript textarea */}
|
||||||
<DropdownMenuContent align="end">
|
<div className="flex-1 min-w-0 flex">
|
||||||
<DropdownMenuItem onClick={() => handlePlay(gen.id, gen.text)}>
|
<Textarea
|
||||||
<Play className="mr-2 h-4 w-4" />
|
readOnly
|
||||||
Play
|
value={gen.text}
|
||||||
</DropdownMenuItem>
|
className="flex-1 resize-none text-sm text-muted-foreground"
|
||||||
<DropdownMenuItem onClick={() => handleDownload(gen.id, gen.text)}>
|
onClick={(e) => e.stopPropagation()}
|
||||||
<Download className="mr-2 h-4 w-4" />
|
/>
|
||||||
Download
|
</div>
|
||||||
</DropdownMenuItem>
|
|
||||||
<DropdownMenuItem
|
{/* Far right - Ellipsis actions */}
|
||||||
onClick={() => deleteGeneration.mutate(gen.id)}
|
<div className="w-10 shrink-0 flex justify-end" onClick={(e) => e.stopPropagation()}>
|
||||||
disabled={deleteGeneration.isPending}
|
<DropdownMenu>
|
||||||
className="text-destructive focus:text-destructive"
|
<DropdownMenuTrigger asChild>
|
||||||
>
|
<Button
|
||||||
<Trash2 className="mr-2 h-4 w-4" />
|
variant="ghost"
|
||||||
Delete
|
size="icon"
|
||||||
</DropdownMenuItem>
|
className="h-8 w-8"
|
||||||
</DropdownMenuContent>
|
aria-label="Actions"
|
||||||
</DropdownMenu>
|
>
|
||||||
</div>
|
<MoreHorizontal className="h-4 w-4" />
|
||||||
</TableCell>
|
</Button>
|
||||||
</TableRow>
|
</DropdownMenuTrigger>
|
||||||
);
|
<DropdownMenuContent align="end">
|
||||||
})}
|
<DropdownMenuItem onClick={() => handlePlay(gen.id, gen.text)}>
|
||||||
</TableBody>
|
<Play className="mr-2 h-4 w-4" />
|
||||||
</Table>
|
Play
|
||||||
|
</DropdownMenuItem>
|
||||||
|
<DropdownMenuItem onClick={() => handleDownload(gen.id, gen.text)}>
|
||||||
|
<Download className="mr-2 h-4 w-4" />
|
||||||
|
Download
|
||||||
|
</DropdownMenuItem>
|
||||||
|
<DropdownMenuItem
|
||||||
|
onClick={() => deleteGeneration.mutate(gen.id)}
|
||||||
|
disabled={deleteGeneration.isPending}
|
||||||
|
className="text-destructive focus:text-destructive"
|
||||||
|
>
|
||||||
|
<Trash2 className="mr-2 h-4 w-4" />
|
||||||
|
Delete
|
||||||
|
</DropdownMenuItem>
|
||||||
|
</DropdownMenuContent>
|
||||||
|
</DropdownMenu>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
})}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="flex justify-between items-center mt-4 shrink-0">
|
<div className="flex justify-between items-center mt-4 shrink-0">
|
||||||
|
|||||||
@@ -37,8 +37,8 @@ export function Sidebar({ activeTab, onTabChange }: SidebarProps) {
|
|||||||
onClick={() => onTabChange(tab.id)}
|
onClick={() => onTabChange(tab.id)}
|
||||||
className={cn(
|
className={cn(
|
||||||
'w-12 h-12 rounded-full flex items-center justify-center transition-all duration-200',
|
'w-12 h-12 rounded-full flex items-center justify-center transition-all duration-200',
|
||||||
'hover:bg-accent hover:text-accent-foreground',
|
'hover:bg-muted/50',
|
||||||
isActive ? 'bg-accent text-accent-foreground shadow-lg' : 'text-muted-foreground',
|
isActive ? 'bg-muted/50 text-foreground shadow-lg' : 'text-muted-foreground',
|
||||||
)}
|
)}
|
||||||
title={tab.label}
|
title={tab.label}
|
||||||
aria-label={tab.label}
|
aria-label={tab.label}
|
||||||
|
|||||||
@@ -126,3 +126,32 @@
|
|||||||
letter-spacing: 0.1em;
|
letter-spacing: 0.1em;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@keyframes fadeInScale {
|
||||||
|
from {
|
||||||
|
opacity: 0;
|
||||||
|
transform: scale(0.8);
|
||||||
|
}
|
||||||
|
to {
|
||||||
|
opacity: 1;
|
||||||
|
transform: scale(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes fadeIn {
|
||||||
|
from {
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
to {
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.animate-fade-in-scale {
|
||||||
|
animation: fadeInScale 0.5s ease-out forwards;
|
||||||
|
}
|
||||||
|
|
||||||
|
.animate-fade-in-delayed {
|
||||||
|
animation: fadeIn 0.5s ease-out 0.15s forwards;
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
|||||||
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
||||||
import { ReactQueryDevtools } from '@tanstack/react-query-devtools';
|
// import { ReactQueryDevtools } from '@tanstack/react-query-devtools';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import ReactDOM from 'react-dom/client';
|
import ReactDOM from 'react-dom/client';
|
||||||
import App from './App';
|
import App from './App';
|
||||||
@@ -20,7 +20,7 @@ ReactDOM.createRoot(document.getElementById('root')!).render(
|
|||||||
<React.StrictMode>
|
<React.StrictMode>
|
||||||
<QueryClientProvider client={queryClient}>
|
<QueryClientProvider client={queryClient}>
|
||||||
<App />
|
<App />
|
||||||
<ReactQueryDevtools initialIsOpen={false} />
|
{/* <ReactQueryDevtools initialIsOpen={false} /> */}
|
||||||
</QueryClientProvider>
|
</QueryClientProvider>
|
||||||
</React.StrictMode>,
|
</React.StrictMode>,
|
||||||
);
|
);
|
||||||
|
|||||||
Binary file not shown.
@@ -57,9 +57,9 @@
|
|||||||
"open": true
|
"open": true
|
||||||
},
|
},
|
||||||
"updater": {
|
"updater": {
|
||||||
"pubkey": "REPLACE_WITH_YOUR_PUBLIC_KEY",
|
"pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IEJDQzc3OTEwRkQyNkNDNUQKUldSZHpDYjlFSG5IdlBpL2tGMXo4N1IzWlJLdUpTNFQyZ1FGZTEzQmVTZzY5elZTYVpMNnFwTUoK",
|
||||||
"endpoints": [
|
"endpoints": [
|
||||||
"https://github.com/YOUR_USERNAME/voicebox/releases/latest/download/latest.json"
|
"https://github.com/jamiepine/voicebox/releases/latest/download/latest.json"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user