From 93875564908173129ea73d8103225d6803f0114a Mon Sep 17 00:00:00 2001 From: Codex Date: Thu, 23 Apr 2026 15:09:24 -0500 Subject: [PATCH] Refine clip editor flow --- frontend/src/pages/LibraryPage.tsx | 46 ++++++++++++++++++------------ frontend/src/styles.css | 35 ++++++++++++----------- 2 files changed, 46 insertions(+), 35 deletions(-) diff --git a/frontend/src/pages/LibraryPage.tsx b/frontend/src/pages/LibraryPage.tsx index 1bc5ed0..c7ea12b 100644 --- a/frontend/src/pages/LibraryPage.tsx +++ b/frontend/src/pages/LibraryPage.tsx @@ -16,6 +16,7 @@ const MEDIA_ACCEPT = ".mp3,.m4a,.aac,.wav,.ogg,.oga,.flac,.mp4,.m4v,.mov,audio/*,video/*,application/octet-stream"; const DEFAULT_CLIP_LENGTH_MS = 30_000; const END_SHORTCUT_LENGTH_MS = 90_000; +const SAVE_FADE_OUT_MS = 1000; const TRIM_NUDGE_MS = 100; const TRIM_STEP_MS = 100; const TRIM_ZOOM_WINDOW_MS = 3_000; @@ -64,6 +65,7 @@ export function LibraryPage() { const { activeKey: previewKey, currentTimeMs: previewTimeMs, + fadeOutClip, playClip: playClipPreview, stopClip: stopPreview, } = useClipPlayback(); @@ -315,6 +317,7 @@ export function LibraryPage() { teamId={teamId} playerId={playerId} previewTimeMs={previewTimeMs} + fadeOutPreview={fadeOutClip} playPreview={playPreview} onClose={closeCreateWalkupClip} stopPreview={stopPreview} @@ -374,6 +377,7 @@ function WalkupClipModal({ teamId, playerId, previewTimeMs, + fadeOutPreview, playPreview, onClose, stopPreview, @@ -385,6 +389,7 @@ function WalkupClipModal({ teamId: string; playerId: string; previewTimeMs: number | null; + fadeOutPreview: (durationMs?: number) => void; playPreview: (clip: AudioClip, startMs?: number, endMs?: number) => Promise; onClose: () => void; stopPreview: () => void; @@ -594,23 +599,19 @@ function WalkupClipModal({
-
-
1. Source
-
2. Trim and metadata
-
+ {step === "source" ? (
-
  • @@ -637,7 +638,7 @@ function WalkupClipModal({ disabled={createSourceMutation.isPending} onClick={() => setSourceMode("url")} > - Import URL + URL
  • @@ -651,7 +652,7 @@ function WalkupClipModal({ disabled={createSourceMutation.isPending} onClick={() => setSourceMode("existing")} > - Existing media + Existing
@@ -663,6 +664,7 @@ function WalkupClipModal({ className={`tab-pane fade${sourceMode === "upload" ? " show active" : ""}`} >
+
Upload a local audio file to create a new walkup clip.