diff --git a/dashboard/src/App.jsx b/dashboard/src/App.jsx index 33ffdd7..d0e82bd 100644 --- a/dashboard/src/App.jsx +++ b/dashboard/src/App.jsx @@ -9,6 +9,7 @@ import ThumbnailStudio from './components/ThumbnailStudio'; import SaaShortsTab from './components/SaaShortsTab'; import UGCGallery from './components/UGCGallery'; import ScheduleWeekModal from './components/ScheduleWeekModal'; +import ClipEditor from './components/ClipEditor'; import UsageMeter from './components/UsageMeter'; import TopUpModal from './components/TopUpModal'; import StarBanner from './components/StarBanner'; @@ -228,6 +229,8 @@ function App() { const [sessionRecovered, setSessionRecovered] = useState(false); const [showScheduleWeek, setShowScheduleWeek] = useState(false); + // Clip editor overlay: index of the clip being edited, or null. + const [editingClip, setEditingClip] = useState(null); // Silent-success "saved" states for the settings key inputs (design.md: no alert popups) const [elevenLabsSaved, setElevenLabsSaved] = useState(false); @@ -280,6 +283,35 @@ function App() { s.timer = setTimeout(flushClipState, 2000); }; + // A recut replaced the clip's server file with a fresh render (burned layers + // reset), so update the results, the reopened-project state and the synced + // per-clip edit state, and let the ResultCard remount from the new file. + const handleClipRerendered = (index, data) => { + const newFile = (data.new_video_url || '').split('/').pop(); + setResults((prev) => { + if (!prev?.clips?.[index]) return prev; + const clips = prev.clips.slice(); + clips[index] = { + ...clips[index], + video_url: data.new_video_url, + start: data.start, + end: data.end, + recipe: data.recipe, + }; + return { ...prev, clips }; + }); + setProjectState((prev) => { + if (!prev?.clips) return prev; + return { + ...prev, + clips: prev.clips.map((c) => (c.index === index + ? { ...c, server_file: newFile, active_layers: null } + : c)), + }; + }); + handleClipStateChange(index, { activeLayers: null, serverVideoFile: newFile }); + }; + // Reopen an archived project from the History tab: the backend re-downloads // its files from R2 into the server's working dir and returns the full state. const restoreProject = async (projectJobId) => { @@ -1402,10 +1434,11 @@ function App() {
EDITOR · CLIP {clipIndex + 1}
+EDITOR · CLIP {clipIndex + 1}
+{clipTitle}
} +DURATION · {fmt(total)}
++ {needsSourcePath ? 'PATH · FULL RE-FRAME' : 'PATH · FAST RECUT'} + {edl.rerender_minutes > 0 && ` · ≈${Math.max(1, Math.ceil(total / 60))} MIN`} +
+Segments · {segments.length}/{limits.max_segments}
+outside the original range — the source video is gone
+ )} +Transcript · segment #{selected + 1}
+ {panelWords.length === 0 ? ( +no words near this segment
+ ) : ( ++ {total > limits.max_total_seconds ? `clip is over ${Math.round(limits.max_total_seconds)}s` : `more than ${limits.max_segments} segments`} +
+ )} +CLIP · {fmt(total)}
+SPACE PLAY · S SPLIT · ⌫ DELETE · ⌘Z UNDO
++ SOURCE · {fmt(sourceDuration)}{edl.source.duration_estimated ? ' (EST.)' : ''} + {!sourceAvailable && ' · EXPIRED — TRIMS LIMITED TO THE ORIGINAL RANGE'} +
+ {sourceAvailable && segments.length < limits.max_segments && ( +DRAG ON EMPTY SPACE TO ADD A SEGMENT
+ )} +