The VS Code of video editing, built for agents.
TypeScript
Remove "Add audio" functionality from the action bar and related components
konstantin-paulus75f0bfc8fca3
diff --git a/apps/web/src/components/genai/action-bar.tsx b/apps/web/src/components/genai/action-bar.tsxindex 8f360457..08546aad 100644--- a/apps/web/src/components/genai/action-bar.tsx+++ b/apps/web/src/components/genai/action-bar.tsx@@ -144,14 +144,6 @@ export function ActionBar(props: ActionBarProps) {</Show><Show when={isVideo()}><div class="flex gap-1 items-center">- <Button- variant="ghost"- class="gap-0 pl-0.5 text-muted-foreground"- onClick={() => runTransform("addAudio")}- >- <Icon name="generate-audio" />- Add audio- </Button><Buttonvariant="ghost"class="gap-0 pl-0.5 text-muted-foreground"diff --git a/apps/web/src/components/genai/config.ts b/apps/web/src/components/genai/config.tsindex 50b9bb15..f866d05e 100644--- a/apps/web/src/components/genai/config.ts+++ b/apps/web/src/components/genai/config.ts@@ -31,7 +31,6 @@ export const MODEL_MODES: Record<ModelId, PromptMode | "TEXT"> = {"veo-3.1": "VIDEO","veo-3.1-fast": "VIDEO","upscale-video": "VIDEO",- "add-audio": "VIDEO","elevenlabs-music": "AUDIO","elevenlabs-sfx": "AUDIO","elevenlabs-v3": "VOICE",diff --git a/apps/web/src/components/genai/prompt-input-actions.tsx b/apps/web/src/components/genai/prompt-input-actions.tsxindex b4fc4416..c91ed16b 100644--- a/apps/web/src/components/genai/prompt-input-actions.tsx+++ b/apps/web/src/components/genai/prompt-input-actions.tsx@@ -102,9 +102,6 @@ export function PromptInputActions() {<Show when={hasImageSelection()}><TransformItem name="removeBackground" icon="ai-generate" label="Remove background" run={run} /></Show>- <Show when={hasVideoSelection()}>- <TransformItem name="addAudio" icon="audio-on" label="Add audio" run={run} />- </Show></DropdownMenuGroup></DropdownMenuContent></DropdownMenuPortal>diff --git a/apps/web/src/components/genai/types.ts b/apps/web/src/components/genai/types.tsindex d1608321..d582d01b 100644--- a/apps/web/src/components/genai/types.ts+++ b/apps/web/src/components/genai/types.ts@@ -26,4 +26,4 @@ export interface GenerationConfig {}/** What can be done to an asset the selection shows. */-export type TransformType = "upscale" | "removeBackground" | "addAudio";+export type TransformType = "upscale" | "removeBackground";diff --git a/apps/web/src/components/genai/use-transforms.ts b/apps/web/src/components/genai/use-transforms.tsindex 5544d2a7..d8fb7f25 100644--- a/apps/web/src/components/genai/use-transforms.ts+++ b/apps/web/src/components/genai/use-transforms.ts@@ -2,7 +2,7 @@* License, v. 2.0. If a copy of the MPL was not distributed with this* file, You can obtain one at http://mozilla.org/MPL/2.0/. */-// Upscaling, taking a background out, scoring footage: tools run over the+// Upscaling, taking a background out: tools run over the// media the selected nodes show on top. The result is laid over that paint,// which is hidden rather than removed (see `transform`).@@ -36,11 +36,6 @@ const TOOLS: Record<TransformType, Tool> = {takes: (type) => type === PaintType.IMAGE,request: (_type, image) => ({ model: "remove-background", image }),},- addAudio: {- title: "Adding audio failed",- takes: (type) => type === PaintType.VIDEO,- request: (_type, video) => ({ model: "add-audio", video }),- },};export function useTransforms() {diff --git a/packages/runtime/src/systems/render.ts b/packages/runtime/src/systems/render.tsindex fd2e8f99..5df769ba 100644--- a/packages/runtime/src/systems/render.ts+++ b/packages/runtime/src/systems/render.ts@@ -206,9 +206,10 @@ function buildEffects(world: World, entity: Entity): string | null {* before the Paint sub-entities so it always sits at the bottom of the fill* stack. A shader paint first in the stack takes an intrinsic image/video as* its input instead (see `renderShaderFill`), in which case the media is not- * drawn here. Media paints and the surface paint (a `<surface>`, whose host- * lives on the geometry) are intrinsic; a waveform (an audio clip's) has no- * picture on the canvas.+ * drawn here. Media paints, the surface paint (a `<surface>`, whose host+ * lives on the geometry) and the waveform (an `<audio>`'s, drawn from its own+ * asset) are intrinsic. An `<audio>` is a sound, so its waveform is drawn in+ * the editor only, never into an export.*/export function renderIntrinsicFill(world: World, entity: Entity): void {if (entity.has(Color)) {@@ -237,6 +238,12 @@ export function renderIntrinsicFill(world: World, entity: Entity): void {renderHtmlFill(world, entity, entity);return;}+ if (intrinsic === PaintType.WAVEFORM) {+ if (world.get(Mode)?.value === 'realtime') {+ renderWaveform(world, entity, entity);+ }+ return;+ }const kind = mediaKind(intrinsic);if (kind === null) return;