From 3d922ec8465081d58d4707890925622715b2f626 Mon Sep 17 00:00:00 2001 From: Jamie Pine Date: Sat, 14 Mar 2026 07:47:06 -0700 Subject: [PATCH] Fix review findings: toggle logic, preset saving, version lookup, async audio ops - Fix inverted effects toggle in FloatingGenerateBox - Add Save button + API method for editing custom effect presets - Return early on effects save failure in ProfileForm - Fix no-op ternary in effectsStore - Handle duplicate preset names with proper 400 response - Use effects_chain is None instead of label for clean version lookup - Move blocking audio ops to asyncio.to_thread in async endpoints - Log warnings instead of silently swallowing parse errors --- .../components/EffectsTab/EffectsDetail.tsx | 54 +++++++++++++++---- .../Generation/FloatingGenerateBox.tsx | 5 +- .../components/VoiceProfiles/ProfileForm.tsx | 1 + app/src/lib/api/client.ts | 10 ++++ app/src/lib/api/types.ts | 6 +++ app/src/stores/effectsStore.ts | 2 +- backend/effects.py | 12 ++++- backend/main.py | 31 +++++------ backend/profiles.py | 5 +- 9 files changed, 95 insertions(+), 31 deletions(-) diff --git a/app/src/components/EffectsTab/EffectsDetail.tsx b/app/src/components/EffectsTab/EffectsDetail.tsx index 73be3113..f877c914 100644 --- a/app/src/components/EffectsTab/EffectsDetail.tsx +++ b/app/src/components/EffectsTab/EffectsDetail.tsx @@ -142,6 +142,29 @@ export function EffectsDetail() { } } + async function handleSaveExisting() { + if (!selectedPresetId || !name.trim()) return; + setSaving(true); + try { + await apiClient.updateEffectPreset(selectedPresetId, { + name: name.trim(), + description: description.trim() || undefined, + effects_chain: workingChain, + }); + queryClient.invalidateQueries({ queryKey: ['effect-presets'] }); + queryClient.invalidateQueries({ queryKey: ['effect-preset', selectedPresetId] }); + toast({ title: 'Preset updated' }); + } catch (error) { + toast({ + title: 'Failed to save', + description: error instanceof Error ? error.message : 'Unknown error', + variant: 'destructive', + }); + } finally { + setSaving(false); + } + } + async function handleSaveAsNew() { await handleSaveNew(); } @@ -186,16 +209,27 @@ export function EffectsDetail() {
{!isBuiltIn && !isCreatingNew && ( - + <> + + + )} {isCreatingNew && (