diff --git a/app/package.json b/app/package.json index 78b15c71..c07776a0 100644 --- a/app/package.json +++ b/app/package.json @@ -31,6 +31,8 @@ "@tanstack/react-query": "^5.0.0", "@tanstack/react-query-devtools": "^5.0.0", "@tauri-apps/api": "^2.0.0", + "@tauri-apps/plugin-process": "^2.3.1", + "@tauri-apps/plugin-updater": "^2.9.0", "class-variance-authority": "^0.7.0", "clsx": "^2.1.1", "date-fns": "^3.6.0", diff --git a/app/src/App.tsx b/app/src/App.tsx index 5f70cf08..7fc4411e 100644 --- a/app/src/App.tsx +++ b/app/src/App.tsx @@ -3,11 +3,13 @@ import { GenerationForm } from '@/components/Generation/GenerationForm'; import { HistoryTable } from '@/components/History/HistoryTable'; import { ConnectionForm } from '@/components/ServerSettings/ConnectionForm'; import { ServerStatus } from '@/components/ServerSettings/ServerStatus'; +import { UpdateStatus } from '@/components/ServerSettings/UpdateStatus'; import { ModelManagement } from '@/components/ServerSettings/ModelManagement'; import { Toaster } from '@/components/ui/toaster'; import { ProfileList } from '@/components/VoiceProfiles/ProfileList'; import { Sidebar } from '@/components/Sidebar'; import { AudioPlayer } from '@/components/AudioPlayer/AudioPlayer'; +import { UpdateNotification } from '@/components/UpdateNotification'; import { isTauri, startServer, setupWindowCloseHandler } from '@/lib/tauri'; // Track if server is starting to prevent duplicate starts @@ -90,12 +92,15 @@ function App() {
+ + {activeTab === 'settings' ? (
+ {isTauri() && }
) : ( @@ -107,7 +112,7 @@ function App() {
- + {/* Generator - Bottom Left */}
diff --git a/app/src/components/AudioPlayer/AudioPlayer.tsx b/app/src/components/AudioPlayer/AudioPlayer.tsx index 1f51c87c..bf6c09fb 100644 --- a/app/src/components/AudioPlayer/AudioPlayer.tsx +++ b/app/src/components/AudioPlayer/AudioPlayer.tsx @@ -34,12 +34,12 @@ export function AudioPlayer() { if (!audioUrl) { return; } - + if (wavesurferRef.current) { console.log('WaveSurfer already initialized, skipping'); return; } - + console.log('Creating NEW WaveSurfer instance'); // Wait for container to be properly rendered @@ -241,7 +241,7 @@ export function AudioPlayer() { // Load audio when URL changes (only if WaveSurfer is already initialized) useEffect(() => { const wavesurfer = wavesurferRef.current; - + if (!audioUrl || !wavesurfer) { // Reset state when no audio or WaveSurfer not ready if (!audioUrl && wavesurfer) { @@ -259,7 +259,7 @@ export function AudioPlayer() { // CRITICAL: Force stop any current playback and cancel any pending loads // This must happen BEFORE any early returns console.log('Audio URL changed to:', audioUrl); - + // COMPLETELY stop and destroy the current audio try { // First pause if playing @@ -267,7 +267,7 @@ export function AudioPlayer() { console.log('Pausing current playback'); wavesurfer.pause(); } - + // Stop the media element explicitly const mediaElement = wavesurfer.getMediaElement(); if (mediaElement) { @@ -276,7 +276,7 @@ export function AudioPlayer() { mediaElement.currentTime = 0; mediaElement.src = ''; } - + // Use empty() to completely destroy the waveform and media element console.log('Calling wavesurfer.empty() to destroy audio'); wavesurfer.empty(); @@ -284,7 +284,7 @@ export function AudioPlayer() { console.error('Error stopping previous audio:', error); // Continue anyway to load new audio } - + // Reset loading state to allow new load (cancel any pending loads) loadingRef.current = false; diff --git a/app/src/components/Generation/GenerationForm.tsx b/app/src/components/Generation/GenerationForm.tsx index 06502c89..ffff041b 100644 --- a/app/src/components/Generation/GenerationForm.tsx +++ b/app/src/components/Generation/GenerationForm.tsx @@ -33,6 +33,7 @@ const generationSchema = z.object({ language: z.enum(['en', 'zh']), seed: z.number().int().optional(), modelSize: z.enum(['1.7B', '0.6B']).optional(), + instruct: z.string().max(500).optional(), }); type GenerationFormValues = z.infer; @@ -50,6 +51,7 @@ export function GenerationForm() { language: 'en', seed: undefined, modelSize: '1.7B', + instruct: '', }, }); @@ -70,6 +72,7 @@ export function GenerationForm() { language: data.language, seed: data.seed, model_size: data.modelSize, + instruct: data.instruct || undefined, }); toast({ @@ -119,7 +122,7 @@ export function GenerationForm() {