The open-source full-stack studio for Opus 5.5 motion video. Reverse engineering for any video. Code video with HTML: recreate, edit and render. BYOA + BYOK · Motion.md · Images, Video, Music & Voice.
TypeScript agent-skillsagentic-aiai-agentsai-videobyokclaude-codecodexdeepseek-harnessdsh-plugingenerative-ailocal-firstmcpmotionmotion-graphicsmultimodalopenmotionreverse-engineeringvideo-editingvideo-generationworkbuddy
fix(studio): clarify unavailable audio notices on the timeline
罗高8da0e3516ad3
diff --git a/docs/product/architecture.md b/docs/product/architecture.mdindex 13ed5786..1bc8d3c4 100644--- a/docs/product/architecture.md+++ b/docs/product/architecture.md@@ -28,6 +28,7 @@ Model Gateway remains a shared media-generation backend for MCP, using local Cod- The editor startup shell and project/editor loading boundaries share a centered, theme-aware OD symbol without adding a minimum loading delay. Below 700px of workspace content width, the editor header stays on one row: undo/redo and version history hide, the template library becomes icon-only, the project title truncates, and Export stays at the right edge.- MVP audio-bearing tracks expose a single speaker button before visibility in the track header: click toggles mute, while hover or keyboard focus opens a compact volume slider, writing every audio/video clip in that row through native saves and undo. Video visibility remains separate, and preview-monitor volume remains a playback preference. Clip-count badges are omitted to make room for these controls. The audio-meter toolbar toggle, meter display and audio FX entry points (track presets, group effects and inspector rack) are omitted in the MVP. The media inspector exposes speed, media start, loop and Fit; Fit uses the same shared menu surface as font controls. It omits the source-path row, Position, path-copy, cutout controls, gain/volume automation, speed automation/presets, audio fades, mute and audio-track toggles. Color fields retain their selected preview until an asynchronous save settles, and roll back on rejection. Existing authored media/audio values remain intact, with track mute and volume available in the timeline. Track audio controls use cached source audio-track detection independently of mute and gain; unknown video sources retain controls until confirmed silent. Track volume sliders cover 0–100% and show effective zero output while muted, retaining the saved volume for unmute.- The MVP timeline uses a 200px track-label column with a 32px gutter; ruler, clips, playhead clipping and drag-scroll bounds share that origin. Long track names truncate with their full value available on hover, while speaker and visibility controls retain their size. The full editor retains its 232px label column. MVP timeline clips omit visible name bands, giving their space to thumbnails or waveforms. Videos with embedded audio show video frames only; independent audio clips retain waveforms. MVP fade handles are hidden while authored effects and trimming remain intact. Ruler text counter-scales during zoom animation so glyphs keep their width. Track headers, hover titles, accessible clip names, the FX badge and track visibility controls remain available. Volume badges are omitted in the MVP; the track speaker retains the volume readout.+- Missing audio sources remain on the timeline and show a localized Media unavailable notice (素材已失效 in Chinese) when their waveform or source request returns 404/410. Other waveform failures retain the separate waveform-unavailable message; loading is not treated as failure. Both notices use a readable single-line badge with truncation and a hover tooltip. This presentation does not remove clips or change asset deletion, playback or export policy.- Export history shows the filename and relative export time, without render-duration metadata. Filenames use 12px medium text, dates use 11px text with 4px top spacing, and the text block reserves an additional 8px before download/delete actions; long filenames truncate with the full value available on hover. Export offers native MP4, MOV, WebM and GIF. MVP GIF exports always loop indefinitely and omit the loop-count setting; the full editor retains custom loop counts. GIF retains its 30 fps limit. MOV uses a short format name; ProRes appears in the MOV format help. WebP is omitted from the format menu because its encoding backend is not implemented.- The MVP omits the standalone timeline title strip to give its space to tracks, retaining the tool row and ruler.- The MVP shows Select and Split as adjacent timeline tools. Split at playhead remains available by keyboard shortcut, without a duplicate toolbar button. Tooltips add a short explanation for less familiar controls while simple actions retain a name-only hint. Overlay surfaces share subtle entrance motion; Base UI popovers and media-preview dialogs also retain their surfaces through a short exit. Tooltip hover delay is 200ms, with instant keyboard-focus hints. Reduced-motion preferences disable overlay transitions; dock expansion keeps its separate animation.diff --git a/studio/src/i18n/de.json b/studio/src/i18n/de.jsonindex d6640770..17022639 100644--- a/studio/src/i18n/de.json+++ b/studio/src/i18n/de.json@@ -729,6 +729,7 @@"transparent": "Transparent","unused": "Nicht verwendet","waveform unavailable": "Wellenform nicht verfügbar",+ "Media unavailable": "Medium nicht verfügbar","Compositions": "Kompositionen","Assets": "Medien","Code": "Code",diff --git a/studio/src/i18n/es.json b/studio/src/i18n/es.jsonindex 9ab393be..c1ce8087 100644--- a/studio/src/i18n/es.json+++ b/studio/src/i18n/es.json@@ -729,6 +729,7 @@"transparent": "Transparente","unused": "No utilizado","waveform unavailable": "Forma de onda no disponible",+ "Media unavailable": "Contenido multimedia no disponible","Compositions": "Composiciones","Assets": "Recursos","Code": "Código",diff --git a/studio/src/i18n/fr.json b/studio/src/i18n/fr.jsonindex 543a544d..1743904b 100644--- a/studio/src/i18n/fr.json+++ b/studio/src/i18n/fr.json@@ -729,6 +729,7 @@"transparent": "Transparente","unused": "Non utilisé","waveform unavailable": "Forme d'onde non disponible",+ "Media unavailable": "Média indisponible","Compositions": "Compositions","Assets": "Médias","Code": "Code",diff --git a/studio/src/i18n/it.json b/studio/src/i18n/it.jsonindex fb59293a..ea3b3e26 100644--- a/studio/src/i18n/it.json+++ b/studio/src/i18n/it.json@@ -729,6 +729,7 @@"transparent": "Trasparente","unused": "Non utilizzato","waveform unavailable": "Forma d'onda non disponibile",+ "Media unavailable": "Contenuto multimediale non disponibile","Compositions": "Composizioni","Assets": "Risorse","Code": "Codice",diff --git a/studio/src/i18n/ja.json b/studio/src/i18n/ja.jsonindex 3bebe82b..c30a1fc5 100644--- a/studio/src/i18n/ja.json+++ b/studio/src/i18n/ja.json@@ -729,6 +729,7 @@"transparent": "透明","unused": "未使用","waveform unavailable": "波形は利用できません",+ "Media unavailable": "素材を利用できません","Compositions": "コンポジション","Assets": "素材","Code": "コード",diff --git a/studio/src/i18n/ko.json b/studio/src/i18n/ko.jsonindex c04c1596..ec0bc521 100644--- a/studio/src/i18n/ko.json+++ b/studio/src/i18n/ko.json@@ -729,6 +729,7 @@"transparent": "투명","unused": "사용되지 않음","waveform unavailable": "파형을 사용할 수 없음",+ "Media unavailable": "미디어를 사용할 수 없음","Compositions": "컴포지션","Assets": "미디어","Code": "코드",diff --git a/studio/src/i18n/operationFeedback.test.ts b/studio/src/i18n/operationFeedback.test.tsindex 064c1505..c3ffef27 100644--- a/studio/src/i18n/operationFeedback.test.ts+++ b/studio/src/i18n/operationFeedback.test.ts@@ -5,6 +5,13 @@ import { splitFailureMessage } from './editorErrors';import { systemMessage } from './systemMessages';import { languages } from './messages';+it('localizes unavailable timeline media in every interface language', () => {+ expect(translate('zh-CN', 'Media unavailable')).toBe('素材已失效');+ for (const { locale } of languages) {+ if (locale !== 'en') expect(translate(locale, 'Media unavailable')).not.toBe('Media unavailable');+ }+});+it('localizes rejected history restores while preserving project-relative paths', () => {const files = 'assets/原始配乐.wav, assets/photo.png';const messages = [diff --git a/studio/src/i18n/pt-BR.json b/studio/src/i18n/pt-BR.jsonindex 9e1c8a5e..2f4a84c9 100644--- a/studio/src/i18n/pt-BR.json+++ b/studio/src/i18n/pt-BR.json@@ -729,6 +729,7 @@"transparent": "Transparente","unused": "Não usado","waveform unavailable": "Forma de onda não disponível",+ "Media unavailable": "Mídia indisponível","Compositions": "Composições","Assets": "Mídia","Code": "Código",diff --git a/studio/src/i18n/ru.json b/studio/src/i18n/ru.jsonindex 5ed6ad04..5bd19f5a 100644--- a/studio/src/i18n/ru.json+++ b/studio/src/i18n/ru.json@@ -729,6 +729,7 @@"transparent": "Прозрачный","unused": "Не используется","waveform unavailable": "Форма сигнала недоступна.",+ "Media unavailable": "Медиафайл недоступен","Compositions": "Композиции","Assets": "Медиа","Code": "Код",diff --git a/studio/src/i18n/tr.json b/studio/src/i18n/tr.jsonindex 2e8d33e4..13aaf5c1 100644--- a/studio/src/i18n/tr.json+++ b/studio/src/i18n/tr.json@@ -729,6 +729,7 @@"transparent": "Şeffaf","unused": "Kullanılmıyor","waveform unavailable": "Dalga formu mevcut değil",+ "Media unavailable": "Medya kullanılamıyor","Compositions": "Kompozisyonlar","Assets": "Medya","Code": "Kod",diff --git a/studio/src/i18n/zh-CN.json b/studio/src/i18n/zh-CN.jsonindex 6bca07b8..16194c36 100644--- a/studio/src/i18n/zh-CN.json+++ b/studio/src/i18n/zh-CN.json@@ -729,6 +729,7 @@"transparent": "透明","unused": "未使用","waveform unavailable": "波形不可用",+ "Media unavailable": "素材已失效","Compositions": "片段","Assets": "我的素材","Code": "代码",diff --git a/studio/src/player/components/AudioWaveform.test.tsx b/studio/src/player/components/AudioWaveform.test.tsxindex 20819a8c..6b860782 100644--- a/studio/src/player/components/AudioWaveform.test.tsx+++ b/studio/src/player/components/AudioWaveform.test.tsx@@ -63,6 +63,8 @@ const setStrip = (size: typeof EMPTY_STRIP) =>});import { AudioWaveform, drawWaveformCanvas } from "./AudioWaveform";+import { I18nProvider } from "../../i18n/I18n";+import type { ThumbnailRequest } from "../lib/thumbnailScheduler";(globalThis as unknown as { IS_REACT_ACT_ENVIRONMENT: boolean }).IS_REACT_ACT_ENVIRONMENT = true;@@ -123,6 +125,53 @@ function recordingCanvas() {}describe("AudioWaveform", () => {+ it.each([+ [404, true, "素材已失效"],+ [410, true, "素材已失效"],+ [404, false, "素材已失效"],+ [410, false, "素材已失效"],+ [500, true, "波形不可用"],+ [503, false, "波形不可用"],+ ])("distinguishes missing media from waveform failures (%s, peaks endpoint: %s)", async (status, waveform, message) => {+ vi.spyOn(globalThis, "fetch").mockResolvedValue(new Response(null, { status }));+ const host = document.createElement("div");+ host.className = "timeline-clip";+ document.body.append(host);+ const root = createRoot(host);+ mounted.push(root);+ let sessionEpoch = 0;+ const render = () => act(() => root.render(+ <I18nProvider initialLocale="zh-CN">+ <AudioWaveform+ audioUrl="/media/voice.wav"+ waveformUrl={waveform ? "/waveform/voice.wav" : undefined}+ label=""+ labelColor="#fff"+ projectId="project-a"+ sessionEpoch={++sessionEpoch}+ priority="visible"+ />+ </I18nProvider>,+ ));+ render();+ expect(host.querySelector('[role="img"]')).toBeNull();+ const request = leaseSpy.mock.calls.at(-1)?.[0] as ThumbnailRequest;+ const error = await request.load(new AbortController().signal).catch((error: Error) => error);+ expect(error).toBeInstanceOf(Error);+ expect((error as Error).message).toContain(String(status));+ leaseSpy.mockImplementation(() => ({ status: "error", error }) as never);+ render();+ const notice = host.querySelector('[role="img"]');+ expect(notice?.textContent).toBe(message);+ expect(notice?.getAttribute("aria-label")).toBe(message);+ expect(notice?.querySelector(".truncate")).not.toBeNull();+ expect(host.querySelector("canvas")).not.toBeNull();+ expect(host.isConnected).toBe(true);+ leaseSpy.mockImplementation(() => ({ status: "loading" as const }));+ render();+ expect(host.querySelector('[role="img"]')).toBeNull();+ });+it("paints a baseline and peak bar for every mapped waveform bin", () => {const { canvas, fills } = recordingCanvas();drawWaveformCanvas(canvas, [0.25, 1], false, 0, 1);diff --git a/studio/src/player/components/AudioWaveform.tsx b/studio/src/player/components/AudioWaveform.tsxindex 324349f7..03b92011 100644--- a/studio/src/player/components/AudioWaveform.tsx+++ b/studio/src/player/components/AudioWaveform.tsx@@ -7,6 +7,8 @@ import { createThumbnailKey, type ThumbnailPriority } from "../lib/thumbnailScheimport { decimatePeaks, loudnessToOpacity } from "./audioWaveformPeaks";import { ClipFadesContext, type ClipFadeShape } from "./TimelineClipFades";import { studioApiFetch } from "../../utils/studioApiFetch";+import { Tooltip } from "../../components/ui/Tooltip";+import { WarningIcon } from "../../icons/RemixIcons";export interface AudioWaveformProps {audioUrl: string;@@ -24,6 +26,7 @@ export interface AudioWaveformProps {}const BAR_STEP = 3;+class UnavailableAudioError extends Error {}export const rendersWaveform = (el: { tag: string }) => el.tag === "audio";const FADE_GHOST_OPACITY = 0.27;@@ -129,6 +132,7 @@ async function loadWaveform(async function fetchWaveformPeaks(url: string, signal: AbortSignal): Promise<number[]> {const response = await studioApiFetch(url, { signal });+ if (response.status === 404 || response.status === 410) throw new UnavailableAudioError(`Waveform request failed (${response.status})`);if (!response.ok) throw new Error(`Waveform request failed (${response.status})`);const data: unknown = await response.json();if (@@ -145,6 +149,7 @@ async function fetchWaveformPeaks(url: string, signal: AbortSignal): Promise<numasync function decodeWaveformPeaks(url: string, signal: AbortSignal): Promise<number[]> {const response = await studioApiFetch(url, { signal });+ if (response.status === 404 || response.status === 410) throw new UnavailableAudioError(`Audio request failed (${response.status})`);if (!response.ok) throw new Error(`Audio request failed (${response.status})`);const buffer = await response.arrayBuffer();if (signal.aborted) throw new DOMException("Aborted", "AbortError");@@ -221,6 +226,11 @@ export const AudioWaveform = memo(function AudioWaveform({[audioUrl, cacheKey, priority, projectId, sessionEpoch, waveformUrl],);const snapshot = useThumbnailLease(cacheKey ? request : null);+ const errorLabel = t(+ snapshot.status === "error" && snapshot.error instanceof UnavailableAudioError+ ? "Media unavailable"+ : "waveform unavailable",+ );const peaks =snapshot.status === "ready" && snapshot.value.kind === "waveform" ? snapshot.value.peaks : null;@@ -310,23 +320,21 @@ export const AudioWaveform = memo(function AudioWaveform({}}/>)}- {/* Degraded state — the decode failed; say so rather than paint a- waveform the author could edit against. */}{snapshot.status === "error" && (<div- className="absolute inset-x-0 flex items-center justify-center gap-1.5"- style={{ top: labelInset, bottom: 0 }}+ className="absolute inset-x-2 flex items-center justify-center overflow-hidden"+ style={{ top: label ? labelInset : 0, bottom: 0 }}>- <div- className="absolute inset-x-0"- style={{- bottom: "20%",- height: 2,- background: "var(--timeline-waveform-error)",- }}- />- <span className="relative rounded-sm bg-black/50 px-1 text-[8px] text-neutral-500">- {t("waveform unavailable")}</span>+ <Tooltip label={errorLabel}>+ <span+ role="img"+ aria-label={errorLabel}+ className="pointer-events-auto flex min-w-0 max-w-full items-center gap-1 rounded-sm bg-black/60 px-1 py-0.5 text-[11px] leading-tight text-white"+ >+ <WarningIcon size={12} className="shrink-0" />+ <span className="truncate">{errorLabel}</span>+ </span>+ </Tooltip></div>)}{label && (