From 20e9f265d8e08b751daa8cea4d8659e1258dbc5c Mon Sep 17 00:00:00 2001 From: "haixin.yang" Date: Mon, 20 Jul 2026 14:00:00 +0800 Subject: [PATCH] release Timeline Studio v0.4.1 --- docs/dev-bugsmash-submission.md | 151 ++++++++ e2e/piper-languages.spec.js | 27 +- package-lock.json | 11 +- package.json | 3 +- src/App.jsx | 72 +++- src/components/EditorSidebar.jsx | 11 + src/components/FirstVisualGuide.jsx | 81 ++++ src/components/PreviewStage.jsx | 28 +- src/components/Timeline.jsx | 88 +++-- src/components/panels.jsx | 247 +++++++++++- src/config/editor.js | 45 +++ src/hooks/useAudioTrackState.js | 5 +- src/hooks/useAutoCaptions.js | 54 ++- src/hooks/useAutoCaptions.test.js | 20 + src/hooks/useEditorCatalog.js | 167 +++++++- src/hooks/useEditorCatalog.test.js | 17 + src/hooks/useFileUpload.js | 1 + src/hooks/useMediaSync.js | 58 ++- src/hooks/useMediaSync.test.js | 70 ++++ src/hooks/useTimelineModel.js | 18 +- src/hooks/useVocalSeparation.js | 38 +- src/hooks/useVoiceGeneration.js | 16 +- src/i18n.js | 90 ++++- src/lib/assetDragControls.js | 1 + src/lib/assetDropActions.js | 70 +++- src/lib/assetDropActions.test.js | 29 ++ src/lib/assetLibraryActions.js | 16 +- src/lib/assetLibraryActions.test.js | 24 ++ src/lib/audioTrackActions.js | 26 +- src/lib/editorRuntime.js | 17 + src/lib/firstVisualGuide.js | 9 + src/lib/media.js | 21 + src/lib/mmsVoiceRuntime.js | 74 ++++ src/lib/playbackControls.js | 11 +- src/lib/playbackControls.test.js | 25 ++ src/lib/remoteAssetCache.js | 42 ++ src/lib/supertonicVoiceRuntime.js | 30 ++ src/lib/supertonicWebRuntime.js | 569 ++++++++++++++++++++++++++++ src/lib/timeline.js | 4 + src/lib/timelineCutActions.js | 24 ++ src/lib/timelineCutActions.test.js | 24 ++ src/lib/timelineMoveControls.js | 20 +- src/lib/visualEffects.js | 45 ++- src/lib/visualEffects.test.js | 20 + src/lib/visualTimelineActions.js | 10 +- src/styles.css | 439 +++++++++++++++++++-- 46 files changed, 2666 insertions(+), 202 deletions(-) create mode 100644 docs/dev-bugsmash-submission.md create mode 100644 src/components/FirstVisualGuide.jsx create mode 100644 src/hooks/useAutoCaptions.test.js create mode 100644 src/hooks/useEditorCatalog.test.js create mode 100644 src/hooks/useMediaSync.test.js create mode 100644 src/lib/assetDropActions.test.js create mode 100644 src/lib/firstVisualGuide.js create mode 100644 src/lib/mmsVoiceRuntime.js create mode 100644 src/lib/remoteAssetCache.js create mode 100644 src/lib/supertonicVoiceRuntime.js create mode 100644 src/lib/supertonicWebRuntime.js diff --git a/docs/dev-bugsmash-submission.md b/docs/dev-bugsmash-submission.md new file mode 100644 index 0000000..4eb41b2 --- /dev/null +++ b/docs/dev-bugsmash-submission.md @@ -0,0 +1,151 @@ +--- +title: "The Timeline Was Split, but the Audio Wasn't: Fixing Source Offsets in a Browser Video Editor" +published: false +tags: devchallenge, bugsmash, javascript, webaudio +--- + +*This is a submission for [DEV's Summer Bug Smash: Clear the Lineup](https://dev.to/bugsmash) powered by [Sentry](https://sentry.io/).* + +## Project Overview + +[Timeline Studio](https://github.com/MartinDelophy/ai-video-editor) is a local-first AI video editor that runs in the browser. It combines a multi-track timeline with captions, AI voiceovers, music, visual transforms, and deterministic offline export. + +Like most editors, it uses non-destructive editing: splitting a clip should not rewrite the underlying media. Each timeline segment instead stores where it appears in the project and which range of the original source it represents. + +That distinction exposed a subtle but very audible bug. + +## Bug Fix or Performance Improvement + +Voiceover clips could be split at the playhead, and the UI correctly produced two timeline segments. Their positions, durations, and waveform slices looked right. However, playback of the second segment started from the beginning of the original audio. + +For example, splitting a four-second source after 1.5 seconds should create these views of the same source: + +```text +first segment: timeline 2.0s -> 3.5s, source 1.0s -> 2.5s +second segment: timeline 3.5s -> 6.0s, source 2.5s -> 5.0s +``` + +The old playback path effectively calculated only this: + +```js +audio.currentTime = timelineTime - segment.start; +``` + +That is correct for an unsplit clip whose source starts at zero. It is wrong for the second half of a non-destructively split clip. The result was especially confusing because the timeline geometry and waveform suggested a clean edit while the user heard repeated audio. + +The same data-model mismatch also affected explicit seeking and offline export. Fixing only real-time playback would have left the exported file different from the editor preview. + +## Code + +The fix is available in commit [`8287b90`](https://github.com/MartinDelophy/ai-video-editor/commit/8287b90a66ff0156246b6c6696f16775b35688fa). + +The core split logic now preserves a source offset for the second segment: + +```js +const firstDuration = time - source.start; +const secondDuration = source.duration - firstDuration; + +const first = { + ...source, + duration: firstDuration, + peaks: source.peaks.slice(0, peakSplit), +}; + +const second = { + ...source, + start: time, + duration: secondDuration, + sourceStart: (source.sourceStart || 0) + firstDuration, + peaks: source.peaks.slice(peakSplit), +}; +``` + +Every consumer then resolves source time with the same rule: + +```js +const sourceTime = (segment.sourceStart || 0) + + getTimelineTrackLocalTime(timelineTime, segment.start, segment.duration); +``` + +Offline mixing receives the same offset and trimmed duration: + +```js +{ + sourceOffset: Math.max(0, item.sourceStart || 0), + sourceDuration: Math.max(0, item.duration || 0), + playbackRate: 1, +} +``` + +## My Improvements + +### 1. I made the timeline segment model explicit + +A timeline clip now carries two different coordinates: + +- `start`: where the segment begins in the edited project +- `sourceStart`: where its content begins in the original audio + +Keeping these concepts separate is the foundation of non-destructive editing. A split changes timeline ranges and source views, not the original `Blob`. + +### 2. I fixed every playback path, not only the visible symptom + +The source offset is now honored when: + +- playback crosses into a segment; +- the user seeks with the playhead; +- the media synchronization effect corrects drift; +- the deterministic offline audio mixer prepares the export; +- the compatibility export path schedules decoded audio buffers. + +This keeps preview and export behavior consistent. + +### 3. I preserved waveform continuity + +The waveform peak array is split at the proportional position of the edit. The first segment keeps the peaks before the cut and the second keeps the remaining peaks. This makes the visual representation agree with the source range users actually hear. + +### 4. I preserved linked-caption behavior + +When a voiceover is linked to a caption, the original caption stays linked to the first segment and its end is clamped to the split time. The new audio segment receives its own identity, preventing ambiguous links between one caption and two independently editable clips. + +### 5. I added a regression test for the complete invariant + +The test starts with a segment that already has a non-zero `sourceStart`, splits it at the playhead, and verifies: + +- both timeline ranges; +- the accumulated source offset of the second segment; +- both waveform slices; +- fade-boundary cleanup; +- caption relinking; +- selection of the newly created segment; +- safe replacement of object URLs. + +```js +expect(audioSegments[0]).toMatchObject({ + start: 2, + duration: 1.5, + sourceStart: 1, + peaks: [0.1, 0.2], +}); + +expect(audioSegments[1]).toMatchObject({ + start: 3.5, + duration: 2.5, + sourceStart: 2.5, + peaks: [0.3, 0.4], +}); +``` + +The important part is `sourceStart: 2.5`: the original offset of 1 second plus the 1.5 seconds retained by the first piece. + +## What I Learned + +Media editors often display one timeline while internally managing several clocks: project time, clip-local time, source-media time, and sometimes playback-rate-adjusted time. Bugs appear when a shortcut that is valid for an unsplit clip is reused after editing creates a non-zero source offset. + +The most useful invariant for this fix was: + +```text +source time = source offset + clip-local timeline time +``` + +Once that rule was encoded consistently across playback, seeking, synchronization, and export, the editor stopped merely *looking* correct and began producing the correct audio as well. diff --git a/e2e/piper-languages.spec.js b/e2e/piper-languages.spec.js index 4c599ff..d289811 100644 --- a/e2e/piper-languages.spec.js +++ b/e2e/piper-languages.spec.js @@ -11,17 +11,32 @@ const VOICE_CASES = [ { language: "Français", voice: "Siwis", text: "Bonjour. Ceci est un test complet de synthèse vocale." }, { language: "Italiano", voice: "Riccardo", text: "Ciao. Questo è un test completo di sintesi vocale." }, { language: "Português", voice: "Faber", text: "Olá. Este é um teste completo de síntese de voz." }, + { language: "日本語", voice: "Hikari", text: "こんにちは。これは日本語音声合成の完全なテストです。" }, + { language: "한국어", voice: "Minseo", text: "안녕하세요. 이것은 한국어 음성 합성 테스트입니다." }, + { language: "Tiếng Việt", voice: "Linh", text: "Xin chào. Đây là bài kiểm tra tổng hợp giọng nói tiếng Việt." }, + { language: "Русский", voice: "Irina", text: "Здравствуйте. Это полная проверка синтеза русской речи." }, + { language: "ไทย", voice: "Malee", text: "สวัสดี นี่คือการทดสอบการสังเคราะห์เสียงภาษาไทย" }, ]; +const requestedVoices = process.env.E2E_VOICES?.split(",").map((voice) => voice.trim()).filter(Boolean); +const ACTIVE_VOICE_CASES = requestedVoices?.length + ? VOICE_CASES.filter((voiceCase) => requestedVoices.includes(voiceCase.voice)) + : VOICE_CASES; + test.beforeEach(async ({ page }) => { await page.addInitScript(() => localStorage.setItem("ai-voiceover-ui-language", "zh")); }); test("every listed language and voice generates a valid WAV through the current editor workflow", async ({ page }) => { test.setTimeout(20 * 60 * 1000); + const browserErrors = []; + page.on("pageerror", (error) => browserErrors.push(error.message)); + page.on("console", (message) => { + if (message.type() === "error") browserErrors.push(message.text()); + }); await page.goto("/"); - for (const voiceCase of VOICE_CASES) { + for (const voiceCase of ACTIVE_VOICE_CASES) { // Generation selects the newly created voice clip and switches the right // panel to its clip inspector; explicitly return to the Audio workflow. await page.locator(".rail-tool").filter({ hasText: "音频" }).click(); @@ -35,7 +50,15 @@ test("every listed language and voice generates a valid WAV through the current await expect(page.locator(".voice-card.is-selected strong")).toHaveText(voiceCase.voice); const previousClipCount = await page.locator(".audio-clip:not(.is-source)").count(); await page.locator(".generate-button").click(); - await expect(page.locator(".audio-clip:not(.is-source)")).toHaveCount(previousClipCount + 1, { timeout: 4 * 60 * 1000 }); + try { + await Promise.race([ + expect(page.locator(".audio-clip:not(.is-source)")).toHaveCount(previousClipCount + 1, { timeout: 4 * 60 * 1000 }), + page.waitForFunction(() => document.body.innerText.includes("生成失败,请重试"), null, { timeout: 4 * 60 * 1000 }) + .then(() => { throw new Error("editor reported generation failure"); }), + ]); + } catch (error) { + throw new Error(`${voiceCase.voice} failed to generate: ${browserErrors.slice(-5).join(" | ") || "no browser error was reported"}`, { cause: error }); + } const clipDownload = page.getByRole("button", { name: "下载片段", exact: true }); await expect(clipDownload).toBeEnabled(); diff --git a/package-lock.json b/package-lock.json index 8e7cfb3..399a380 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "web-player", - "version": "0.4.0", + "version": "0.4.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "web-player", - "version": "0.4.0", + "version": "0.4.1", "license": "MIT", "dependencies": { "@diffusionstudio/vits-web": "^1.0.3", @@ -17,6 +17,7 @@ "@mediabunny/aac-encoder": "^1.50.8", "@phosphor-icons/react": "^2.1.10", "fflate": "^0.8.3", + "hangul-romanization": "^1.0.1", "kokoro-js": "^1.2.1", "mediabunny": "^1.50.8", "onnxruntime-web": "^1.27.0", @@ -3500,6 +3501,12 @@ "integrity": "sha512-Y8T4vYhEfwJOTbouREvG+3XDsjr8E3kIr7uf+JZ0BYloFsttiHU0WfvANVsR7TxNUJa/WpCnw/Ino/p+DeBhBQ==", "license": "ISC" }, + "node_modules/hangul-romanization": { + "version": "1.0.1", + "resolved": "https://registry.npmmirror.com/hangul-romanization/-/hangul-romanization-1.0.1.tgz", + "integrity": "sha512-Nh67VGRK0Zet2JRDWII4/RW004XSZyWVySSurM9PEAR1p+7/5Kr8OrrcSYQcQhyGCcBEKyQm98xd+rRnyO0uXg==", + "license": "MIT" + }, "node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmmirror.com/has-flag/-/has-flag-4.0.0.tgz", diff --git a/package.json b/package.json index 0a66ec5..c94ecdd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "web-player", - "version": "0.4.0", + "version": "0.4.1", "private": true, "description": "A local-first browser AI video editor for voiceovers, captions, talking avatars, and multi-track timeline export.", "license": "MIT", @@ -36,6 +36,7 @@ "@mediabunny/aac-encoder": "^1.50.8", "@phosphor-icons/react": "^2.1.10", "fflate": "^0.8.3", + "hangul-romanization": "^1.0.1", "kokoro-js": "^1.2.1", "mediabunny": "^1.50.8", "onnxruntime-web": "^1.27.0", diff --git a/src/App.jsx b/src/App.jsx index ecd156b..2d35e6a 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -7,6 +7,8 @@ import { Timeline } from "./components/Timeline.jsx"; import { Topbar } from "./components/Topbar.jsx"; import { AssetDragPreview, ExportProgressOverlay } from "./components/EditorOverlays.jsx"; import { EditorSidebar } from "./components/EditorSidebar.jsx"; +import { FirstVisualGuide } from "./components/FirstVisualGuide.jsx"; +import { hasSeenFirstVisualGuide, markFirstVisualGuideSeen } from "./lib/firstVisualGuide.js"; import { useExportElapsed } from "./hooks/useExportElapsed.js"; import { usePreviewFrameSize } from "./hooks/usePreviewFrameSize.js"; import { useEditorCatalog } from "./hooks/useEditorCatalog.js"; @@ -68,6 +70,8 @@ export function App() { const [captionVoiceFocusRequest, setCaptionVoiceFocusRequest] = useState(0); const [selectedSourceAudioSegmentId, setSelectedSourceAudioSegmentId] = useState(""); const [canvasVisualTarget, setCanvasVisualTarget] = useState(""); + const [showFirstVisualGuide, setShowFirstVisualGuide] = useState(false); + const firstVisualGuideShownRef = useRef(false); const timelineImportRestoreRef = useRef(false); const [introClosing, setIntroClosing] = useState(false); const { @@ -77,11 +81,11 @@ export function App() { setCaptionsEnabled, setScript, setSelectedSegmentId, } = useCaptionState(); const { - audioSegments, favoriteVoiceIds, historyItems, musicBlob, musicDuration, musicName, musicStart, + audioSegments, favoriteVoiceIds, historyItems, musicBlob, musicDuration, musicName, musicSegments, musicStart, musicPeaks, musicUrl, musicVolume, recordedVoices, recordingElapsed, recordingState, selectedAudioSegmentId, selectedVoiceId, setAudioSegments, setFavoriteVoiceIds, setHistoryItems, setMusicBlob, setMusicDuration, setMusicName, setMusicPeaks, setMusicStart, - setMusicUrl, setMusicVolume, setRecordedVoices, setRecordingElapsed, + setMusicSegments, setMusicUrl, setMusicVolume, setRecordedVoices, setRecordingElapsed, setRecordingState, setSelectedAudioSegmentId, setSelectedVoiceId, setSourceAudioBlob, setSourceAudioAssetId, setSourceAudioDuration, setSourceAudioLinked, setSourceAudioName, setSourceAudioPeaks, setSourceAudioStart, setSourceAudioUrl, setSourceAudioVolume, setSpeed, setTimelineHorizon, setVolume, @@ -178,6 +182,11 @@ export function App() { return activeLanguage !== "zh" && option?.nameEn ? option.nameEn : translateOptionName(activeLanguage, name); }; const shouldShowLanguageIntro = !uiLanguage; + const requestFirstVisualGuide = () => { + if (firstVisualGuideShownRef.current || hasSeenFirstVisualGuide()) return; + firstVisualGuideShownRef.current = true; + setShowFirstVisualGuide(true); + }; const linkedSourceAudioSegments = useMemo( () => sourceAudioLinked && sourceAudioBlob @@ -313,7 +322,8 @@ export function App() { previewVisualSourceTime, previewVisualSrc, previewVisualType, ratio, }); - const { builtInAssets, filteredVoices } = useEditorCatalog(voiceFilter); + const { builtInAssets, filteredVoices, libraryType, libraryQuery, setLibraryQuery, + selectLibraryType, libraryStatus, libraryError, libraryProvider, assetDownloadStates, prefetchLibraryAsset } = useEditorCatalog(voiceFilter); const { canDropAssetOnTrack, findAssetById, getActiveDraggedAsset, getDraggedAsset, @@ -322,7 +332,7 @@ export function App() { handleTrackAssetDragOver, triggerAssetDropPulse, } = createAssetDragControls({ addStickerAssetToTimeline: (...args) => addStickerAssetToTimeline(...args), applyAssetToTrack: (...args) => applyAssetToTrack(...args), assetDropPulseTimerRef, builtInAssets, currentTime, draggedAssetId, - draggedAssetIdRef, getStickerDragAsset, notify, pointerAssetDragRef, + draggedAssetIdRef, getStickerDragAsset, notify, pointerAssetDragRef, prefetchAsset: prefetchLibraryAsset, setAssetDragPreview, setAssetDropPosition, setAssetDropPulseTrack, setAssetDropTargetTrack, setDraggedAssetId, setSelectedLibraryAssetId, setSelectedStickerId, setSelectedStickerSegmentId, suppressAssetClickRef, @@ -368,16 +378,27 @@ export function App() { currentTimeRef, imageDuration, imageSrc, musicBlob, musicDuration, musicRef, musicUrlRef, notify, script, selectedVoice, selectedVoiceId, setActiveTool, setAudioSegments, setCaptionSegments, setCurrentTime, setHistoryItems, - setIsPlaying, setMusicBlob, setMusicDuration, setMusicName, setMusicPeaks, + setIsPlaying, setMusicBlob, setMusicDuration, setMusicName, setMusicPeaks, setMusicSegments, setMusicStart, setMusicUrl, setProgress, setSelectedAudioSegmentId, setSelectedSegmentId, setSelectedTrack, setSourceAudioAssetId, setSourceAudioBlob, setSourceAudioDuration, setSourceAudioLinked, setSourceAudioName, setSourceAudioPeaks, setSourceAudioStart, setSourceAudioUrl, setSourceAudioVolume, setStatus, setStatusText, setTimelineHorizon, sourceAudioBlob, sourceAudioDuration, sourceAudioAssetId, sourceAudioRef, sourceAudioStart, sourceAudioUrlRef, t, }); - const { separateSourceVocals, vocalSeparationJob } = useVocalSeparation({ - sourceAudioBlob, sourceAudioName, replaceSourceAudio, replaceMusic, notify, t, + const { separateAudioClipVocals, separateSourceVocals, vocalSeparationJob } = useVocalSeparation({ + sourceAudioBlob, sourceAudioName, replaceAudio, replaceSourceAudio, replaceMusic, notify, t, }); + const selectedSourceAudioPiece = linkedSourceAudioSegments.find((segment) => segment.id === selectedSourceAudioSegmentId) ?? null; + const selectedAudioToolTarget = selectedTrack === "audio" && selectedAudioSegmentId && selectedAudioSegment + ? { blob: selectedAudioSegment.blob, name: selectedAudioSegment.name, start: selectedAudioSegment.start, sourceStart: selectedAudioSegment.sourceStart || 0, duration: selectedAudioSegment.duration, segmentId: selectedAudioSegment.id, track: "audio" } + : selectedTrack === "music" && musicBlob + ? { blob: musicBlob, name: musicName || t("musicTrack"), start: musicStart, sourceStart: 0, duration: musicDuration, segmentId: musicSegments[0]?.id || "music-audio", track: "music" } + : selectedTrack === "source" && sourceAudioBlob + ? { blob: sourceAudioBlob, name: sourceAudioName, start: selectedSourceAudioPiece?.start ?? sourceAudioStart, sourceStart: selectedSourceAudioPiece?.sourceStart ?? 0, duration: selectedSourceAudioPiece?.duration ?? sourceAudioDuration, segmentId: selectedSourceAudioSegmentId || "source-audio", track: "source" } + : null; + const separateSelectedAudioVocals = () => selectedAudioToolTarget?.track === "source" + ? separateSourceVocals() + : selectedAudioToolTarget && separateAudioClipVocals(selectedAudioToolTarget); const { chooseInterfaceLanguage, clearAllVisionState, selectTool, toggleTrackLock, @@ -510,8 +531,9 @@ export function App() { audioSegments, captionSegments, commitCaptionSegments, commitStickerSegments, commitVisualSegments, currentStickerSegmentIndex, currentTime, focusedSegmentIndex, getCurrentVisualAssetSnapshot, imageDuration, imageSrc, notify, + musicBlob, musicDuration, musicPeaks, musicSegments, musicStart, selectedAudioSegmentId, selectedSegmentId, selectedSegmentIndex, selectedStickerSegmentId, - setAudioSegments, setCaptionSegments, setSelectedAudioSegmentId, + setAudioSegments, setCaptionSegments, setMusicSegments, setSelectedAudioSegmentId, selectedTrack, stickerSegments, trackLocks, visualSegments, }); @@ -544,7 +566,7 @@ export function App() { audioSegments, captionSegments, captionTargetDuration, estimatedDuration, notify, seekTo, setActiveTool, setAudioSegments, setCaptionSegments, setSelectedAudioSegmentId, setSelectedStickerId, setSelectedStickerSegmentId, setSelectedTrack, setStickerSegments, setTimelineHorizon, - setMusicStart, setSourceAudioLinked, setSourceAudioStart, musicDuration, musicStart, + setMusicStart, setSourceAudioLinked, setSourceAudioStart, musicDuration, musicSegments, musicStart, setMusicSegments, sourceAudioDuration, sourceAudioStart, stickerSegments, suppressTimelineClipClickRef, t, timelineDurationRef, trackLocks, trackScrollRef, pauseForTimelineEdit, visualSegments, setSnapGuide, }); @@ -567,12 +589,13 @@ export function App() { notify, script, seekTo, setActiveTool, setCaptionSegments, setCaptionsEnabled, setProgress, setScript, setSelectedSegmentId, setSelectedTrack, setStatus, setStatusText, setTrackVisibility, sourceAudioBlob, - sourceAudioStart, status, trackLocks, uiLanguage, + sourceAudioStart, status, t, trackLocks, uiLanguage, }); const handleFiles = useFileUpload({ appendVisualAssetToTimeline, imageUrlRefs, notify, setSelectedLibraryAssetId, setSelectedTrack, setUserAssets, updateVisualAssetInTimeline, visualSegments, + onFirstVisualAutoAdded: requestFirstVisualGuide, }); const { deleteUserAsset, selectAsset } = createAssetLibraryActions({ @@ -584,13 +607,13 @@ export function App() { }); const { applyAssetToTrack, handleTrackAssetDrop, handleVisualStyleDrop } = createAssetDropActions({ - addStickerAssetToTimeline, addVisualOverlay: (...args) => addVisualOverlay(...args), appendVisualAssetToTimeline, canDropAssetOnTrack, - draggedAssetIdRef, extractVideoSourceAudio, getDraggedAsset, getTimelineDropPercent, - notify, replaceAudio, selectAsset, setActiveTool, setAssetDropPosition, + addStickerAssetToTimeline, addVisualOverlay: (...args) => addVisualOverlay(...args), appendVisualAssetToTimeline, canDropAssetOnTrack, clearImageTrack, + draggedAssetIdRef, extractVideoSourceAudio, getDraggedAsset, getTimelineDropPercent, imageUrlRefs, + notify, onFirstVisualDropped: requestFirstVisualGuide, replaceAudio, selectAsset, setActiveTool, setAssetDropPosition, setAssetDropTargetTrack, setDraggedAssetId, setSelectedFilterId, setSelectedLibraryAssetId, setSelectedTrack, setSelectedTransitionId, - setSelectedVisualSegmentId, setVisualSegments, trackScrollRef, resolveVisualDropIntent, - triggerAssetDropPulse, + setSelectedVisualSegmentId, setVisualSegments, trackScrollRef, resolveVisualDropIntent, updateVisualAssetInTimeline, + t, triggerAssetDropPulse, visualSegments, }); const addVisualOverlay = (asset, options = {}) => { if (!asset?.src || (asset.type !== "image" && asset.type !== "video")) return; @@ -743,6 +766,8 @@ export function App() { estimatedDuration, fileInputRef, generateCaptionsFromSourceAudio, handleAssetClick, handleAssetPointerDown, handleCaptionPositionChange, handleFiles, handleStickerClick, imageSrc, isDragging, mediaTab, musicBlob, musicDuration, musicName, musicVolume, + libraryType, libraryQuery, setLibraryQuery, selectLibraryType, libraryStatus, libraryError, libraryProvider, + assetDownloadStates, prefetchLibraryAsset, notify, openAvatarPanel, previewVisionAnalysis, previewVisionKey, smartMode, setSmartMode, previewVisionOptions, previewVisualSrc, previewVisualType, progress, script, seekTo, segments, selectTool, selectedCaptionSegment, selectedFilterId, @@ -751,7 +776,7 @@ export function App() { setMediaTab, setMusicVolume, setSelectedAudioSegmentId, setSelectedFilterId, setSelectedSegmentId, setSelectedStickerId, setSelectedTrack, setSelectedTransitionId, setSourceAudioVolume, setVoiceTab, sourceAudioBlob, sourceAudioDuration, sourceAudioLinked, sourceAudioName, sourceAudioVolume, status, t, - separateSourceVocals, vocalSeparationJob, + selectedAudioToolTarget, separateSelectedAudioVocals, separateSourceVocals, vocalSeparationJob, toggleCaptionSegmentHidden, toggleVisionOption, trOption, updateCaptionSegmentText, updateScript, userAssets, visionJob, selectedVisualSegment, visualLocalTime, updateSelectedVisualEffects, @@ -1022,6 +1047,9 @@ export function App() { builtInImageCaptionAvailable={autoEdit.support.availability === "available"} generateImageCaption={autoEdit.generateImageCaption} extractVideoSourceAudio={extractVideoSourceAudio} + generateCaptionsFromAudioClip={generateCaptionsFromSourceAudio} + separateAudioClipVocals={separateAudioClipVocals} + audioProcessingBusy={vocalSeparationJob.running || status === "captioning"} setSelectedVisualSegmentId={setSelectedVisualSegmentId} seekTo={seekTo} suppressTimelineClipClickRef={suppressTimelineClipClickRef} @@ -1055,8 +1083,8 @@ export function App() { startAudioSegmentMove={startAudioSegmentMove} startSourceAudioMove={startSourceAudioMove} musicBlob={musicBlob} + musicSegments={musicSegments} musicPeaks={musicPeaks} - musicClipPercent={musicClipPercent} musicStartPercent={musicStartPercent} musicDuration={musicDuration} startMusicMove={startMusicMove} @@ -1064,6 +1092,16 @@ export function App() { + {showFirstVisualGuide && !shouldShowLanguageIntro ? ( + setShowFirstVisualGuide(false)} + onComplete={() => { + markFirstVisualGuideSeen(); + setShowFirstVisualGuide(false); + }} + /> + ) : null} {shouldShowLanguageIntro ? ( ) : null} diff --git a/src/components/EditorSidebar.jsx b/src/components/EditorSidebar.jsx index 7763a02..7e648a1 100644 --- a/src/components/EditorSidebar.jsx +++ b/src/components/EditorSidebar.jsx @@ -30,6 +30,15 @@ export function EditorSidebar({ model: d }) { handleFiles={d.handleFiles} imageSrc={d.imageSrc} builtInAssets={d.builtInAssets} + libraryType={d.libraryType} + libraryQuery={d.libraryQuery} + setLibraryQuery={d.setLibraryQuery} + selectLibraryType={d.selectLibraryType} + libraryStatus={d.libraryStatus} + libraryError={d.libraryError} + libraryProvider={d.libraryProvider} + assetDownloadStates={d.assetDownloadStates} + prefetchLibraryAsset={d.prefetchLibraryAsset} userAssets={d.userAssets} selectedLibraryAssetId={d.selectedLibraryAssetId} deleteUserAsset={d.deleteUserAsset} @@ -86,6 +95,8 @@ export function EditorSidebar({ model: d }) { isGeneratingCaptions={d.status === "captioning"} automaticCaptionProgress={d.status === "captioning" ? d.progress : 0} separateSourceVocals={d.separateSourceVocals} + selectedAudioToolTarget={d.selectedAudioToolTarget} + separateSelectedAudioVocals={d.separateSelectedAudioVocals} vocalSeparationJob={d.vocalSeparationJob} hasVisual={Boolean(d.previewVisualSrc)} visualType={d.previewVisualType} diff --git a/src/components/FirstVisualGuide.jsx b/src/components/FirstVisualGuide.jsx new file mode 100644 index 0000000..42a443f --- /dev/null +++ b/src/components/FirstVisualGuide.jsx @@ -0,0 +1,81 @@ +import { useEffect, useLayoutEffect, useState } from "react"; +import { ArrowsOutCardinal, Cursor, MouseRightClick, X } from "@phosphor-icons/react"; + +const COPY = { + zh: { title: "两个常用操作", timeline: "在轨道片段上右键,可以打开剪切、复制、静音等快捷操作。", canvas: "点击画面后,可直接拖动位置,并用控制点缩放或旋转。", done: "知道了" }, + en: { title: "Two useful shortcuts", timeline: "Right-click a timeline clip to open quick actions such as cut, duplicate, and mute.", canvas: "Click the visual, then drag to move it or use the handles to resize and rotate.", done: "Got it" }, + ja: { title: "便利な2つの操作", timeline: "タイムラインのクリップを右クリックすると、カット、複製、ミュートなどを操作できます。", canvas: "画面をクリックしてドラッグすると移動でき、ハンドルで拡大縮小や回転ができます。", done: "わかりました" }, + ko: { title: "유용한 두 가지 조작", timeline: "타임라인 클립을 마우스 오른쪽 버튼으로 클릭하면 자르기, 복제, 음소거 등의 메뉴가 열립니다.", canvas: "화면을 클릭한 뒤 드래그해 이동하고 핸들로 크기와 회전을 조절하세요.", done: "확인" }, + es: { title: "Dos controles útiles", timeline: "Haz clic derecho en un clip para abrir acciones como cortar, duplicar y silenciar.", canvas: "Haz clic en la imagen y arrástrala; usa los controles para cambiar su tamaño o girarla.", done: "Entendido" }, + fr: { title: "Deux gestes utiles", timeline: "Faites un clic droit sur un clip pour accéder aux actions de coupe, duplication et sourdine.", canvas: "Cliquez sur l’image, puis faites-la glisser ou utilisez les poignées pour la redimensionner et la faire pivoter.", done: "Compris" }, + de: { title: "Zwei nützliche Aktionen", timeline: "Klicke mit der rechten Maustaste auf einen Clip, um Aktionen wie Schneiden, Duplizieren und Stummschalten zu öffnen.", canvas: "Klicke auf das Bild und ziehe es; mit den Griffen kannst du Größe und Drehung ändern.", done: "Verstanden" }, + pt: { title: "Dois controles úteis", timeline: "Clique com o botão direito em um clipe para abrir ações como cortar, duplicar e silenciar.", canvas: "Clique na imagem e arraste para mover; use as alças para redimensionar e girar.", done: "Entendi" }, + th: { title: "สองวิธีใช้งานที่มีประโยชน์", timeline: "คลิกขวาที่คลิปบนไทม์ไลน์เพื่อเปิดเมนูตัด ทำสำเนา และปิดเสียง", canvas: "คลิกภาพแล้วลากเพื่อย้าย หรือใช้จุดควบคุมเพื่อปรับขนาดและหมุน", done: "เข้าใจแล้ว" }, + vi: { title: "Hai thao tác hữu ích", timeline: "Nhấp chuột phải vào clip để mở các thao tác như cắt, nhân bản và tắt tiếng.", canvas: "Nhấp vào hình rồi kéo để di chuyển; dùng các tay nắm để đổi kích thước và xoay.", done: "Đã hiểu" }, + ru: { title: "Два полезных действия", timeline: "Щёлкните клип правой кнопкой мыши, чтобы открыть команды обрезки, дублирования и отключения звука.", canvas: "Нажмите на изображение и перетащите его; маркеры позволяют менять размер и поворот.", done: "Понятно" }, +}; + +function getTargetRect(selector) { + const element = document.querySelector(selector); + if (!element) return null; + const rect = element.getBoundingClientRect(); + return { top: rect.top, left: rect.left, right: rect.right, bottom: rect.bottom, width: rect.width, height: rect.height }; +} + +export function FirstVisualGuide({ language = "zh", onClose, onComplete }) { + const [targets, setTargets] = useState({ canvas: null, timeline: null }); + const copy = COPY[language] ?? COPY.en; + + useLayoutEffect(() => { + const update = () => setTargets({ + canvas: getTargetRect(".preview-frame"), + timeline: getTargetRect('.image-clip[data-timeline-segment-track="image"]'), + }); + const frame = requestAnimationFrame(update); + window.addEventListener("resize", update); + window.addEventListener("scroll", update, true); + return () => { cancelAnimationFrame(frame); window.removeEventListener("resize", update); window.removeEventListener("scroll", update, true); }; + }, []); + + useEffect(() => { + const closeOnEscape = (event) => { if (event.key === "Escape") onClose(); }; + window.addEventListener("keydown", closeOnEscape); + return () => window.removeEventListener("keydown", closeOnEscape); + }, [onClose]); + + const timelineStyle = targets.timeline ? { + left: Math.max(16, Math.min(window.innerWidth - 336, targets.timeline.left)), + bottom: Math.max(16, window.innerHeight - targets.timeline.top + 14), + } : undefined; + const canvasStyle = targets.canvas ? { + left: Math.max(16, Math.min(window.innerWidth - 336, targets.canvas.right + 14)), + top: Math.max(70, Math.min(window.innerHeight - 160, targets.canvas.top + targets.canvas.height * 0.24)), + } : undefined; + + return ( +
+ +
+ {copy.title} + +
+ {targets.canvas ?
: null} + {targets.timeline ?
: null} + {targets.canvas ? ( + + ) : null} + {targets.timeline ? ( + + ) : null} +
{copy.canvas}
+
{copy.timeline}
+
+ ); +} diff --git a/src/components/PreviewStage.jsx b/src/components/PreviewStage.jsx index e7620a6..cf22b2e 100644 --- a/src/components/PreviewStage.jsx +++ b/src/components/PreviewStage.jsx @@ -22,6 +22,7 @@ import { CaptionOverlay } from "./CaptionOverlay.jsx"; import { IconButton } from "./ui.jsx"; import { getVisualOverlayPixelBox, snapVisualOverlayTransform } from "../lib/visualOverlayTimeline.js"; import { getAnchoredResize } from "../lib/anchoredResize.js"; +import { getVisualFitRect } from "../lib/visualGeometry.js"; export function PreviewStage({ t, @@ -127,6 +128,25 @@ export function PreviewStage({ transform: `translate(${visualTransform.x + visualAnimation.x}%, ${visualTransform.y + visualAnimation.y}%) scale(${visualTransform.scale * visualAnimation.scale}) rotate(${visualTransform.rotation}deg)`, opacity: visualTransform.opacity * visualAnimation.opacity, }; + const visualContentBox = activeObjectFit === "contain" + ? getVisualFitRect( + { width: visualEffects?.width, height: visualEffects?.height }, + { width: frameWidth, height: frameHeight }, + "contain", + ) + : { x: 0, y: 0, width: frameWidth, height: frameHeight }; + const hasVisualContentBox = visualContentBox.width > 0 && visualContentBox.height > 0; + const transformBox = hasVisualContentBox + ? visualContentBox + : { x: 0, y: 0, width: frameWidth, height: frameHeight }; + const visualTransformBoxStyle = { + left: `${transformBox.x + transformBox.width / 2 + (visualTransform.x + visualAnimation.x) / 100 * frameWidth}px`, + top: `${transformBox.y + transformBox.height / 2 + (visualTransform.y + visualAnimation.y) / 100 * frameHeight}px`, + width: `${transformBox.width}px`, + height: `${transformBox.height}px`, + transform: `translate(-50%, -50%) scale(${visualTransform.scale * visualAnimation.scale}) rotate(${visualTransform.rotation}deg)`, + opacity: visualTransform.opacity * visualAnimation.opacity, + }; const visualMaskStyle = { clipPath: ["rectangle", "rounded"].includes(visualMask.type) && !usesAlphaMask ? `inset(${maskInsets.top}% ${maskInsets.right}% ${maskInsets.bottom}% ${maskInsets.left}%${visualMask.type === "rounded" ? ` round ${roundedRadius}px` : ""})` @@ -227,10 +247,10 @@ export function PreviewStage({ }); if (mode.startsWith("scale-")) { const handle = mode.slice(6); - let candidate = getAnchoredResize({ handle, pointer: { x: moveEvent.clientX, y: moveEvent.clientY }, frame: rect, box: { width: rect.width, height: rect.height }, transform: initial }); + let candidate = getAnchoredResize({ handle, pointer: { x: moveEvent.clientX, y: moveEvent.clientY }, frame: rect, box: { width: transformBox.width, height: transformBox.height }, transform: initial }); candidate = { ...candidate, scale: Math.max(0.1, Math.min(4, candidate.scale)) }; - const snapped = snapVisualScaleToFrameEdges(candidate, { width: rect.width, height: rect.height }); - candidate = getAnchoredResize({ handle, pointer: { x: moveEvent.clientX, y: moveEvent.clientY }, frame: rect, box: { width: rect.width, height: rect.height }, transform: initial, scale: snapped.transform.scale }); + const snapped = snapVisualScaleToFrameEdges(candidate, { width: rect.width, height: rect.height }, 8, transformBox); + candidate = getAnchoredResize({ handle, pointer: { x: moveEvent.clientX, y: moveEvent.clientY }, frame: rect, box: { width: transformBox.width, height: transformBox.height }, transform: initial, scale: snapped.transform.scale }); setOverlaySnapGuides(snapped.guides); onUpdateVisualTransform({ ...candidate, x: round(candidate.x), y: round(candidate.y), scale: round(candidate.scale) }); } @@ -450,7 +470,7 @@ export function PreviewStage({
) : null} {renderedVisualSrc && trackVisibility.image && visualTransformEditable && (!visualMask.type || visualMask.type === "none") ? ( -
startVisualTransform(event, "move")}> +
startVisualTransform(event, "move")}> {t("visualBasic", "画面")} ) : null} -
- {formatClock(segment.duration)} - {!activeTimelineClipDrag ? ( +
: null} + {!segment.preparing ? {formatClock(segment.duration)} : null} + {!segment.preparing && !activeTimelineClipDrag ? ( : null}
@@ -1474,7 +1500,7 @@ export function Timeline({ ) : null} {contextMenu ? (
event.stopPropagation()}> -
{contextMenu.kind === "clip" ? t("clipActions") : t("trackActions")}{t({ image: "imageTrack", overlay: "overlayTrack", caption: "caption", sticker: "stickerTrack", source: "sourceTrack", voice: "voiceTrack", music: "musicTrack" }[contextMenu.track], contextMenu.track)}
+
{contextMenu.kind === "clip" ? t("clipActions") : t("trackActions")}{t({ image: "imageTrack", overlay: "overlayTrack", caption: "caption", sticker: "stickerTrack", source: "sourceTrack", audio: "voiceTrack", music: "musicTrack" }[contextMenu.track], contextMenu.track)}
{contextMenu.kind === "clip" ? ( <> @@ -1500,6 +1526,14 @@ export function Timeline({ {contextMenu.track === "overlay" && contextOverlaySegment?.type === "video" ? ( ) : null} + {contextMenu.track === "audio" && contextAudioSegment ? <> + + + : null} + {contextMenu.track === "music" && contextMusicSegment && musicBlob ? <> + + + : null}
diff --git a/src/components/panels.jsx b/src/components/panels.jsx index 16d0c6c..b1f3607 100644 --- a/src/components/panels.jsx +++ b/src/components/panels.jsx @@ -1,5 +1,5 @@ import { useEffect, useMemo, useRef, useState } from "react"; -import { flushSync } from "react-dom"; +import { createPortal, flushSync } from "react-dom"; import { BoundingBox, @@ -14,6 +14,7 @@ import { MicrophoneStage, MusicNote, Pause, + PlayCircle, PersonSimpleRun, Scan, Scissors, @@ -21,6 +22,7 @@ import { Target, Trash, Waveform, + X, } from "@phosphor-icons/react"; import { @@ -33,6 +35,7 @@ import { VOICES, } from "../config/editor.js"; import { APP_LANGUAGES } from "../i18n.js"; +import { getRemoteAssetBlob } from "../lib/remoteAssetCache.js"; import { formatClock, formatTime, getSegmentStartTime } from "../lib/timeline.js"; import { hasVisualPropertyKeyframe, normalizeVisualKeyframes, resolveVisualTransform } from "../lib/visualEffects.js"; import { DEFAULT_VISUAL_ANIMATION_DURATION, normalizeVisualClipAnimation, VISUAL_CLIP_ANIMATION_OPTIONS } from "../lib/visualClipAnimations.js"; @@ -80,6 +83,15 @@ export function MediaPanel({ handleFiles, selectedLibraryAssetId, builtInAssets, + libraryType, + libraryQuery, + setLibraryQuery, + selectLibraryType, + libraryStatus, + libraryError, + libraryProvider, + assetDownloadStates, + prefetchLibraryAsset, userAssets, deleteUserAsset, draggedAssetId, @@ -87,9 +99,27 @@ export function MediaPanel({ handleAssetClick, }) { const assets = mediaTab === "library" ? builtInAssets : userAssets; + const assetIntentTimerRef = useRef(null); + const [previewAsset, setPreviewAsset] = useState(null); + + useEffect(() => { + if (!previewAsset) return undefined; + const handleKeyDown = (event) => { + if (event.key === "Escape") setPreviewAsset(null); + }; + window.addEventListener("keydown", handleKeyDown); + return () => window.removeEventListener("keydown", handleKeyDown); + }, [previewAsset]); + + const openAssetPreview = (event, asset) => { + handleAssetClick(event, asset); + if (!event.defaultPrevented) setPreviewAsset(asset); + }; const renderAssetList = (items, { deletable = false } = {}) => (
- {items.length ? ( + {libraryStatus === "loading" && mediaTab === "library" ? ( + + ) : items.length ? ( items.map((asset) => (
handleAssetPointerDown(event, asset)} - onClick={(event) => handleAssetClick(event, asset)} + onPointerEnter={() => { + if (mediaTab !== "library") return; + clearTimeout(assetIntentTimerRef.current); + assetIntentTimerRef.current = setTimeout(() => void prefetchLibraryAsset?.(asset), 180); + }} + onPointerLeave={() => clearTimeout(assetIntentTimerRef.current)} + onClick={(event) => openAssetPreview(event, asset)} > - + {deletable ? (
); @@ -174,33 +210,206 @@ export function MediaPanel({ {renderAssetList(userAssets, { deletable: true })} + ) : mediaTab === "library" ? ( + <> +
+ {["image", "video", "audio"].map((type) => ( + + ))} +
+
event.preventDefault()}> + setLibraryQuery(event.target.value)} placeholder={t(libraryType === "audio" ? "librarySearchMusicPlaceholder" : "librarySearchPlaceholder")} aria-label={t(libraryType === "audio" ? "librarySearchMusicPlaceholder" : "librarySearchPlaceholder")} /> +
+
{t("libraryProvidedBy")} {libraryProvider}
+ {renderAssetList(assets)} + ) : ( renderAssetList(assets, { deletable: mediaTab === "mine" }) )} + + {previewAsset ? createPortal( + setPreviewAsset(null)} />, + document.body, + ) : null} ); } -function AssetRow({ asset, selected, t }) { +function AssetPreviewDialog({ asset, t, onClose }) { + const mediaSrc = asset.type === "image" ? (asset.originalSrc || asset.src) : (asset.previewSrc || asset.src); + const [audioPreviewStatus, setAudioPreviewStatus] = useState(asset.type === "audio" ? "loading" : "ready"); + const [audioPreviewProgress, setAudioPreviewProgress] = useState(0); + const [audioPreviewSrc, setAudioPreviewSrc] = useState(asset.type === "audio" && !/^https?:/i.test(mediaSrc) ? mediaSrc : ""); + const audioFallbacksRef = useRef([]); + const audioFallbackIndexRef = useRef(-1); + const tryNextAudioFallback = () => { + const nextIndex = audioFallbackIndexRef.current + 1; + const nextSrc = audioFallbacksRef.current[nextIndex]; + if (!nextSrc) { + setAudioPreviewStatus("error"); + return; + } + audioFallbackIndexRef.current = nextIndex; + setAudioPreviewStatus("loading"); + setAudioPreviewProgress(0.03); + setAudioPreviewSrc(nextSrc); + }; + useEffect(() => { + if (asset.type !== "audio" || !/^https?:/i.test(mediaSrc)) return undefined; + let canceled = false; + let objectUrl = ""; + setAudioPreviewStatus("loading"); + setAudioPreviewProgress(0); + setAudioPreviewSrc(""); + audioFallbacksRef.current = []; + audioFallbackIndexRef.current = -1; + try { + const sourceUrl = new URL(mediaSrc); + const trackId = sourceUrl.searchParams.get("trackid"); + if (trackId && sourceUrl.hostname.endsWith("storage.jamendo.com")) { + audioFallbacksRef.current = ["mp31", "ogg", "mp32"].map((format) => { + const fallbackUrl = new URL(sourceUrl); + fallbackUrl.searchParams.set("format", format); + return fallbackUrl.toString(); + }); + } else { + audioFallbacksRef.current = [mediaSrc]; + } + } catch { + audioFallbacksRef.current = [mediaSrc]; + } + getRemoteAssetBlob({ ...asset, src: mediaSrc }, (progress) => { + if (!canceled) setAudioPreviewProgress(Math.min(0.96, Math.max(0.01, progress || 0))); + }).then((blob) => { + if (canceled || !blob) return; + objectUrl = URL.createObjectURL(blob); + setAudioPreviewProgress(0.98); + setAudioPreviewSrc(objectUrl); + }).catch((error) => { + console.warn("Music preview download failed", error); + if (!canceled) tryNextAudioFallback(); + }); + return () => { + canceled = true; + if (objectUrl) URL.revokeObjectURL(objectUrl); + }; + }, [asset, mediaSrc]); + return ( +
{ + if (event.target === event.currentTarget) onClose(); + }}> +
+
+
+ {t("assetPreview", "素材预览")} + {asset.name} +
+ +
+
+ {asset.type === "video" ? ( +
+ {asset.meta ?
{asset.meta}
: null} +
+
+ ); +} + +function LibraryLoadingGrid({ label }) { + return ( +
+ {Array.from({ length: 6 }, (_, index) => ( +
+
+ +
+ ))} +
+ ); +} + +function AssetRow({ asset, selected, t, downloadState }) { + const [mediaLoaded, setMediaLoaded] = useState(asset.type === "audio"); + const [previewSrc, setPreviewSrc] = useState(asset.thumbnail || asset.src); + useEffect(() => { + setPreviewSrc(asset.thumbnail || asset.src); + setMediaLoaded(asset.type === "audio"); + }, [asset.id, asset.src, asset.thumbnail, asset.type]); + const handlePreviewError = () => { + if (previewSrc !== asset.src) { + setPreviewSrc(asset.src); + return; + } + if (asset.originalSrc && previewSrc !== asset.originalSrc) { + setPreviewSrc(asset.originalSrc); + return; + } + setMediaLoaded(true); + }; return (
+ {!mediaLoaded ? : null} {asset.type === "video" ? ( -
{asset.name} @@ -259,6 +468,8 @@ export function ToolPanel(props) { isGeneratingCaptions, automaticCaptionProgress, separateSourceVocals, + selectedAudioToolTarget, + separateSelectedAudioVocals, vocalSeparationJob, hasVisual, visualType, @@ -392,26 +603,32 @@ export function ToolPanel(props) {