Open source CapCut alternative.
TypeScript
feat(cut): drag a whole selection from the panels to the timeline [rebuild]
David Le9589b9b455b0
diff --git a/site/src/cut/components/LibraryView.tsx b/site/src/cut/components/LibraryView.tsxindex c09f5411..55e0df55 100644--- a/site/src/cut/components/LibraryView.tsx+++ b/site/src/cut/components/LibraryView.tsx@@ -1023,6 +1023,7 @@ export function LibraryCard({offline = false,area,mention = false,+ dragGroup,onClick,onDelete,onUse,@@ -1041,7 +1042,10 @@ export function LibraryCard({/** The card sits beside a prompt (the editor's Library panel), so its name* doubles as a mention token to copy. */mention?: boolean;- onClick?: () => void;+ /** Everything picked on this shelf right now. Dragging a card that is one of+ * them carries the whole set, so a drop lands the lot. */+ dragGroup?: LibraryAsset[];+ onClick?: (e: React.MouseEvent) => void;onDelete?: () => void;onUse?: () => void;onDragStartExtra?: (e: React.DragEvent) => void;@@ -1112,7 +1116,7 @@ export function LibraryCard({.open(lightboxItemFromLibrary(a, !onUse))}onDragStart={(e) => {- setLibraryDragData(e, a);+ setLibraryDragData(e, a, dragGroup);onDragStartExtra?.(e);}}onDragEnd={clearAssetDrag}diff --git a/site/src/cut/components/SidePanel.tsx b/site/src/cut/components/SidePanel.tsxindex 17aed7f7..bf67d701 100644--- a/site/src/cut/components/SidePanel.tsx+++ b/site/src/cut/components/SidePanel.tsx@@ -98,7 +98,7 @@ import { useRevealEffect, useRevealFlash } from "@/cut/lib/refReveal";import { usePanelRequestEffect } from "@/cut/lib/panelRequest";import { CopyNameLabel } from "./AssetRefs";import { AudioCardFace, AudioPanel } from "./AudioPanel";-import { FolderCrumb, FolderShelf } from "./desktopFolders";+import { FolderCrumb, FolderShelf, Marquee, useTilePicks } from "./desktopFolders";import { TemplateCard } from "./TemplateCard";import { GenerateVideoPanel } from "./GeneratePanel";import { ImageGenPanel } from "./ImageGenPanel";@@ -646,6 +646,9 @@ function ProjectFilesPanel({// Fonts are project assets (their bytes live in media/) but they belong to// the text inspector's font menu, never the Media grid.const assets = useEditor((s) => s.assets).filter((a) => a.origin == null && a.type !== "font");+ // Which tiles are picked, so a sweep or a ⇧-click can hand the timeline a+ // run of media in one drag. Anything that leaves the grid leaves the pick.+ const { picked, setPicked, pick } = useTilePicks(assets.map((a) => a.id));const templates = useEditor((s) => s.templates);const exportOpen = useEditor((s) => s.exportOpen);// A render that finishes in the background (dialog closed) drops a new file in@@ -793,9 +796,22 @@ function ProjectFilesPanel({this project.</div>) : (- <div className="grid grid-cols-2 content-start gap-2.5 px-3.5">+ <Marquee+ scope="self"+ rootClassName="relative px-3.5"+ className="grid grid-cols-2 content-start gap-2.5"+ selected={picked}+ setSelected={setPicked}+ >{assets.map((a) => (- <AssetCard key={a.id} asset={a} projectId={projectId} />+ <AssetCard+ key={a.id}+ asset={a}+ projectId={projectId}+ selected={picked.has(a.id)}+ onSelect={(e) => pick(e, a.id, assets.map((x) => x.id))}+ dragGroup={[...picked]}+ />))}{importing && (<div className="flex aspect-square flex-col items-center justify-center gap-2 rounded-lg border border-dashed border-input text-[11px] text-muted-foreground">@@ -805,7 +821,7 @@ function ProjectFilesPanel({</span></div>)}- </div>+ </Marquee>)}{exports.length + exporting.length + preparing.length > 0 && (@@ -969,7 +985,23 @@ function UploadState({ asset }: { asset: MediaAsset }) {);}-function AssetCard({ asset, projectId }: { asset: MediaAsset; projectId: string }) {+function AssetCard({+ asset,+ projectId,+ selected,+ onSelect,+ dragGroup,+}: {+ asset: MediaAsset;+ projectId: string;+ selected?: boolean;+ /** Clicking the card picks it — plain replaces the selection, ⇧/⌘ adds to+ * it. A pick never places anything; the timeline gets media by drag or by+ * the card's own + button. */+ onSelect?: (e: React.MouseEvent) => void;+ /** Everything picked right now, so dragging one card drags them all. */+ dragGroup?: string[];+}) {const caps = useCutCaps();const [saved, setSaved] = useState(false);// Number of timeline items that would be cascade-deleted; null = no prompt.@@ -1012,11 +1044,13 @@ function AssetCard({ asset, projectId }: { asset: MediaAsset; projectId: string<><divref={attachReveal}+ data-sel-id={asset.id}className="asset-card group flex flex-col gap-1.5 text-left"title="Drag onto the timeline, or click + to add"draggable+ onClick={onSelect}onDragStart={(e) => {- setAssetDragData(e, asset.id);+ setAssetDragData(e, asset.id, dragGroup);setObjectDragImage(e);}}onDragEnd={clearAssetDrag}@@ -1037,7 +1071,7 @@ function AssetCard({ asset, projectId }: { asset: MediaAsset; projectId: stringdata-drag-objectclassName={cn("relative aspect-square overflow-hidden rounded-lg border border-border bg-muted transition-colors group-hover:border-input",- flash && "ring-2 ring-[#0a84ff] ring-offset-1"+ (flash || selected) && "ring-2 ring-[#0a84ff] ring-offset-1")}>{asset.type === "video" ? (@@ -1321,18 +1355,25 @@ function LibraryPanel({ projectId }: { projectId: string }) {(files) => void upload(files));+ const all = assets ?? [];+ const shown = all.filter((a) => folderOf(a) === openFolder);++ // Which cards are picked, so a sweep or a ⇧-click hands the timeline (or a+ // folder tile) a run of clips in one drag. Only what the open folder shows+ // can be picked, so walking into another folder leaves its selection behind.+ const { picked, setPicked, pick } = useTilePicks(shown.map((a) => a.id));+// Let a clip be dragged onto a folder tile to file it (alongside the timeline// drag payload the card already sets). The ghost is the card's picture, and// it hands over to the timeline's segment preview.const onCardDragExtra = (e: React.DragEvent, a: LibraryAsset) => {- e.dataTransfer.setData(LIBRARY_MOVE_MIME, JSON.stringify([a.id]));+ const ids = picked.has(a.id) ? [a.id, ...[...picked].filter((id) => id !== a.id)] : [a.id];+ e.dataTransfer.setData(LIBRARY_MOVE_MIME, JSON.stringify(ids));e.dataTransfer.effectAllowed = "copyMove";setObjectDragImage(e);};- const all = assets ?? [];const bothShelves = availableResidencies().length > 1;- const shown = all.filter((a) => folderOf(a) === openFolder);const shownTemplates = templates.filter((t) => (t.folderId ?? null) === openFolder);// The Camera Roll tile leads the shelf while the phone has synced anything.const shelfFolders: (LibraryFolder & { locked?: boolean })[] =@@ -1478,31 +1519,39 @@ function LibraryPanel({ projectId }: { projectId: string }) {</div>) : null) : (- <ScrollArea- className="min-h-0 flex-1"- contentClassName="grid grid-cols-2 content-start gap-2.5 px-3.5 pb-3.5"- >- {shown.map((a) => (- <LibraryCard- key={a.id}- asset={a}- mention- // A font is used from the font menu; there is nothing to place.- onUse={- a.type === "font" ? undefined : () => void addLibraryAssetToProject(projectId, a)- }- onDelete={() => setDeleting(a)}- onDragStartExtra={(e) => onCardDragExtra(e, a)}- />- ))}- {uploading > 0 && (- <div className="flex aspect-square flex-col items-center justify-center gap-2 rounded-lg border border-dashed border-input text-[11px] text-muted-foreground">- <Loader2 className="size-4 animate-spin" />- <span>- Uploading… <LiveElapsed />- </span>- </div>- )}+ <ScrollArea className="min-h-0 flex-1" contentClassName="pb-3.5">+ <Marquee+ scope="self"+ rootClassName="relative min-h-full px-3.5"+ className="grid grid-cols-2 content-start gap-2.5"+ selected={picked}+ setSelected={setPicked}+ >+ {shown.map((a) => (+ <LibraryCard+ key={a.id}+ asset={a}+ mention+ selected={picked.has(a.id)}+ onClick={(e) => pick(e, a.id, shown.map((x) => x.id))}+ dragGroup={shown.filter((x) => picked.has(x.id))}+ // A font is used from the font menu; there is nothing to place.+ onUse={+ a.type === "font" ? undefined : () => void addLibraryAssetToProject(projectId, a)+ }+ onDelete={() => setDeleting(a)}+ onDragStartExtra={(e) => onCardDragExtra(e, a)}+ />+ ))}+ {uploading > 0 && (+ <div className="flex aspect-square flex-col items-center justify-center gap-2 rounded-lg border border-dashed border-input text-[11px] text-muted-foreground">+ <Loader2 className="size-4 animate-spin" />+ <span>+ Uploading… <LiveElapsed />+ </span>+ </div>+ )}+ </Marquee></ScrollArea>)}diff --git a/site/src/cut/components/Timeline.tsx b/site/src/cut/components/Timeline.tsxindex fe01ae75..46011ff5 100644--- a/site/src/cut/components/Timeline.tsx+++ b/site/src/cut/components/Timeline.tsx@@ -19,8 +19,10 @@ import {draggedAssetId,draggedLibraryId,draggingAssetId,+ draggingAssetIds,draggingElement,draggingLibrary,+ draggingLibraryMany,draggingTemplate,hasAssetDrag,hasElementDrag,@@ -38,6 +40,7 @@ import {libraryMediaUrl,libraryPosterUrl,saveAssetToLibrary,+ type LibraryAsset,} from "@/cut/lib/library";import { originalSettings, type ExportDoc } from "@/cut/lib/exportClient";import { useExports } from "@/cut/lib/exportStore";@@ -1557,6 +1560,76 @@ export function Timeline() {ghost: {url: libraryMediaUrl(lib.fileName, lib.residency),kind: lib.type,+ /** How much timeline one asset takes when it lands. */+ const laidLength = (asset: { type: string; duration: number }) =>+ asset.type === "image" ? STILL_SECONDS : asset.duration || STILL_SECONDS;++ /** Where the next asset of each kind lands. Video and audio run on their own+ * rows, so a group holding both lays two runs side by side; an element sits+ * at the pointer and takes no room from either. */+ const runCursor = (t: number, atElement: number) => {+ const at = { clip: t, audio: t };+ return (asset: MediaAsset, sticker: boolean) => {+ if (sticker) return atElement;+ const lane = isClipMedia(asset.type) ? "clip" : "audio";+ const start = at[lane];+ at[lane] = start + laidLength(asset);+ return start;+ };+ };++ /** Lay a whole dragged group down in order, each one after the last. A+ * single card is a group of one, so every drop takes this path. `only`+ * narrows the group to what the row under the pointer accepts. */+ const placeAssetsAt = (+ ids: string[],+ t: number,+ atElement: number,+ audioRow = 0,+ place: TrackTarget = TRACK_ZERO,+ elementLane?: number,+ only?: (asset: MediaAsset) => boolean+ ) => {+ const next = runCursor(t, atElement);+ for (const id of ids) {+ const asset = useEditor.getState().assets.find((a) => a.id === id);+ if (!asset || asset.type === "font") continue;+ if (only && !only(asset)) continue;+ const sticker = !!stickerOf(asset);+ placeAssetAt(id, asset.type, next(asset, sticker), audioRow, place, elementLane);+ }+ };++ /** Copy a dragged group of library assets into the project, in order, then+ * lay them down. Each import waits for the last so the run keeps the order+ * they were selected in. */+ const placeLibraryAt = async (+ projectId: string,+ items: LibraryAsset[],+ t: number,+ atElement: number,+ audioRow = 0,+ place: TrackTarget = TRACK_ZERO,+ only?: (asset: MediaAsset) => boolean+ ) => {+ const next = runCursor(t, atElement);+ for (const item of items) {+ try {+ const asset = await importLibraryAsset(projectId, item);+ if (asset.type === "font") continue;+ if (only && !only(asset)) continue;+ const sticker = !!stickerOf(asset);+ placeAssetAt(asset.id, asset.type, next(asset, sticker), audioRow, place);+ } catch {+ // A copy that fails leaves the rest of the run alone.+ }+ }+ };++ /** What a video row takes: the clips, and none of the sound or elements a+ * mixed selection may also be carrying. */+ const clipsOnly = (asset: MediaAsset) => isClipMedia(asset.type) && !stickerOf(asset);+aspect: lib.width && lib.height ? lib.width / lib.height : undefined,// The card's cover is already painted and cached, so the segment// has a frame of the video in it from the first move — true frames@@ -1647,15 +1720,16 @@ export function Timeline() {const projectId = useEditor.getState().projectId;clearAssetDrag();if (libId && lib && isClipMedia(lib.type) && projectId) {- void importLibraryAsset(projectId, lib)- .then((asset) => useEditor.getState().addVideoFromAsset(asset.id, place, t))- .catch(() => {});+ void placeLibraryAt(projectId, libGroup, t, t, 0, place, clipsOnly);return;}const id = draggedAssetId(e);+ // The whole dragged group, read before the drag is cleared.+ const libGroup = draggingLibraryMany();+ const assetGroup = draggingAssetIds();const asset = id ? useEditor.getState().assets.find((a) => a.id === id) : null;if (id && !stickerOf(asset) && isClipMedia(asset?.type)) {- useEditor.getState().addVideoFromAsset(id, place, t);+ placeAssetsAt(assetGroup, t, t, 0, place, undefined, clipsOnly);return;}if (stockVideo && projectId) {@@ -1955,6 +2029,10 @@ export function Timeline() {// Elements land at the pointer's own time, not `dropTimeAt`, which// pins everything to 0 on an empty timeline — a clip starts the film// there, but an element lands where it was dropped.+ // Everything the drag is carrying — one card, or the whole marquee+ // selection it was grabbed from — read before the drag is cleared.+ const libGroup = draggingLibraryMany();+ const assetGroup = draggingAssetIds();const atElement = Math.max(0, timeAt(e.clientX));if (element) {e.preventDefault();@@ -1975,34 +2053,14 @@ export function Timeline() {}if (libId && lib && projectId) {e.preventDefault();- void importLibraryAsset(projectId, lib)- .then((asset) => {- if (asset.type !== "font")- placeAssetAt(- asset.id,- asset.type,- stickerOf(asset) ? atElement : t,- audioRow,- videoPlace- );- })- .catch(() => {});+ void placeLibraryAt(projectId, libGroup, t, atElement, audioRow, videoPlace);return;}const id = draggedAssetId(e);if (id) {e.preventDefault();- const asset = useEditor.getState().assets.find((a) => a.id === id);- if (asset && asset.type !== "font")- placeAssetAt(- id,- asset.type,- stickerOf(asset) ? atElement : t,- audioRow,- videoPlace,- elementLane- );+ placeAssetsAt(assetGroup, t, atElement, audioRow, videoPlace, elementLane);return;}diff --git a/site/src/cut/components/desktopFolders.tsx b/site/src/cut/components/desktopFolders.tsxindex f201096b..2d62bd15 100644--- a/site/src/cut/components/desktopFolders.tsx+++ b/site/src/cut/components/desktopFolders.tsx@@ -1,6 +1,6 @@"use client";-import { Fragment, useEffect, useRef, useState } from "react";+import { Fragment, useCallback, useEffect, useMemo, useRef, useState } from "react";import { Folder, MoreHorizontal, Pencil, Trash2 } from "lucide-react";import { Button } from "@/components/ui/button";import {@@ -74,6 +74,48 @@ export function FolderGlyph({ className }: { className?: string }) {return <Folder className={cn("fill-[#8cc5ff] text-[#8cc5ff]", className)} aria-hidden="true" />;}+/**+ * Click selection over a grid of tiles, the desktop's rules: a plain click+ * picks one, ⌘/Ctrl toggles one in or out, ⇧ takes the run from the last pick+ * to this one. Pairs with `Marquee`, which sweeps the same set.+ */+export function useTilePicks(shown?: readonly string[]) {+ const [raw, setPicked] = useState<Set<string>>(new Set());+ const anchor = useRef<string | null>(null);+ // A pick reaches no further than the eye does. Navigating into a folder or+ // deleting a tile leaves ids in the set that are no longer on screen, and a+ // drag that carried those would file or lay down items nobody can see.+ const picked = useMemo(() => {+ if (!shown) return raw;+ const live = new Set(shown);+ return new Set([...raw].filter((id) => live.has(id)));+ }, [raw, shown]);+ const pick = useCallback((e: React.MouseEvent, id: string, order: string[]) => {+ if (e.metaKey || e.ctrlKey) {+ setPicked((prev) => {+ const next = new Set(prev);+ if (next.has(id)) next.delete(id);+ else next.add(id);+ return next;+ });+ anchor.current = id;+ return;+ }+ if (e.shiftKey && anchor.current) {+ const from = order.indexOf(anchor.current);+ const to = order.indexOf(id);+ if (from >= 0 && to >= 0) {+ const [lo, hi] = from < to ? [from, to] : [to, from];+ setPicked(new Set(order.slice(lo, hi + 1)));+ return;+ }+ }+ setPicked(new Set([id]));+ anchor.current = id;+ }, []);+ return { picked, setPicked, pick };+}+// Elements a press should not turn into a rubber-band: the cards themselves// (they drag), folder tiles / breadcrumbs, and any interactive control.const MARQUEE_SKIP =@@ -86,11 +128,21 @@ const MARQUEE_SKIP =* selection; a plain click on empty space clears it. */export function Marquee({className,+ rootClassName = "relative min-h-[68vh] flex-1",+ scope = "page",selected,setSelected,children,}: {className?: string;+ /** The band's own box. A page grid fills the arena; a panel grid takes the+ * column it is in. */+ rootClassName?: string;+ /** Where a press starts a sweep. "page" arms the whole content arena, so a+ * press anywhere beside the grid begins one; "self" keeps it inside this+ * box, which is what a side panel wants — a press in the preview or the+ * timeline is not a sweep of the panel's tiles. */+ scope?: "page" | "self";selected: Set<string>;setSelected: (s: Set<string>) => void;children: React.ReactNode;@@ -103,7 +155,10 @@ export function Marquee({);useEffect(() => {- const arena = ref.current?.closest("main") ?? ref.current?.parentElement;+ const arena =+ scope === "self"+ ? ref.current+ : (ref.current?.closest("main") ?? ref.current?.parentElement);if (!arena) return;const onPointerDown = (e: PointerEvent) => {if (e.button !== 0 || (e.target as HTMLElement).closest(MARQUEE_SKIP)) return;@@ -142,10 +197,10 @@ export function Marquee({};arena.addEventListener("pointerdown", onPointerDown);return () => arena.removeEventListener("pointerdown", onPointerDown);- }, [setSelected]);+ }, [setSelected, scope]);return (- <div ref={ref} className="relative min-h-[68vh] flex-1">+ <div ref={ref} className={rootClassName}><div className={className}>{children}</div>{rect && (<divdiff --git a/site/src/cut/lib/assetDrag.ts b/site/src/cut/lib/assetDrag.tsindex af40c85b..1bf67434 100644--- a/site/src/cut/lib/assetDrag.ts+++ b/site/src/cut/lib/assetDrag.ts@@ -16,11 +16,16 @@ export const ASSET_MIME = "application/x-cut-asset";* target that needs the id during `dragover` (e.g. to size an insertion* preview) reads it here instead. */let inFlightAssetId: string | null = null;+/** The whole group a drag is carrying, the grabbed one first. A single card+ * carries itself; a card inside a marquee selection carries the selection, so+ * one drop lays the lot down. */+let inFlightAssetIds: string[] = [];-export function setAssetDragData(e: React.DragEvent, assetId: string) {+export function setAssetDragData(e: React.DragEvent, assetId: string, group?: string[]) {e.dataTransfer.setData(ASSET_MIME, assetId);e.dataTransfer.effectAllowed = "copyMove";inFlightAssetId = assetId;+ inFlightAssetIds = groupWithLead(assetId, group);// Every media drag also carries the unified asset ref, so reference drop// zones (AI chat, the image/video creators) accept it without knowing the// source surface.@@ -33,17 +38,36 @@ export function draggingAssetId(): string | null {return inFlightAssetId;}+/** Every asset id the drag is carrying, the grabbed one first. */+export function draggingAssetIds(): string[] {+ return inFlightAssetIds;+}++/** The grabbed item, then the rest of its group — a drop lands them in that+ * order. A grab outside the selection carries only itself. */+function groupWithLead<T>(lead: T, group: T[] | undefined, same?: (a: T, b: T) => boolean): T[] {+ const eq = same ?? ((a: T, b: T) => a === b);+ if (!group || !group.some((g) => eq(g, lead))) return [lead];+ return [lead, ...group.filter((g) => !eq(g, lead))];+}+/** A library asset dragged from the library panel. Unlike a project asset it is* not in the project yet, so it carries its own MIME and a minimal shape the* timeline uses to size the drop preview before the copy-into-project happens. */export const LIBRARY_MIME = "application/x-cut-library";let inFlightLibrary: LibraryAsset | null = null;+let inFlightLibraryMany: LibraryAsset[] = [];-export function setLibraryDragData(e: React.DragEvent, asset: LibraryAsset) {+export function setLibraryDragData(+ e: React.DragEvent,+ asset: LibraryAsset,+ group?: LibraryAsset[]+) {e.dataTransfer.setData(LIBRARY_MIME, asset.id);e.dataTransfer.effectAllowed = "copy";inFlightLibrary = asset;+ inFlightLibraryMany = groupWithLead(asset, group, (a, b) => a.id === b.id);setRefDragData(e, refFromLibrary(asset));}@@ -51,6 +75,11 @@ export function draggingLibrary(): LibraryAsset | null {return inFlightLibrary;}+/** Every library asset the drag is carrying, the grabbed one first. */+export function draggingLibraryMany(): LibraryAsset[] {+ return inFlightLibraryMany;+}+export function hasLibraryDrag(e: React.DragEvent | DragEvent): boolean {const dt = "dataTransfer" in e ? e.dataTransfer : null;return !!dt && Array.from(dt.types).includes(LIBRARY_MIME);@@ -319,7 +348,9 @@ export function setChipDragImage(e: React.DragEvent) {/** Clear the in-flight ids; call on `dragend` and after a drop. */export function clearAssetDrag() {inFlightAssetId = null;+ inFlightAssetIds = [];inFlightLibrary = null;+ inFlightLibraryMany = [];inFlightTemplate = null;clearRefDrag();}diff --git a/site/src/cut/server/ai/catalog.ts b/site/src/cut/server/ai/catalog.tsindex cd6b17eb..5fc996f9 100644--- a/site/src/cut/server/ai/catalog.ts+++ b/site/src/cut/server/ai/catalog.ts@@ -88,6 +88,7 @@ Times are in seconds on the shared timeline. The playhead is currentTime; a skim- set_speed sets a clip's playback rate; it changes the clip's timeline length, and later titles/captions ripple to stay in sync.- set_transition joins a clip into the next one (0–2s, ${TRANSITION_STYLE_IDS.length} styles); set_animation animates one clip's own entrance/exit — read the transitions-and-fades skill before styling cuts. Splitting or deleting clears the affected transition. A transition is a bar on its own row at an absolute time, so an edit can leave one lining up with nothing: every timeline mutation reports those as \`parkedTransitions\`, and clearing them (remove_transition) is part of finishing the edit. Grading a clip's picture is the color tools (set_color_preset, set_color_grade, set_color_curves, set_color_wheels, set_color_hsl — read the color-grading skill); a stylized post treatment (grain, VHS, halation…) is add_effect, dropped over the stretch of timeline it covers — as is a treatment on the sound (echo, reverb, telephone…).- split_at cuts the track-0 clip under that time into two clips at the exact frame. With a soundtrack or overlay clip selected it splits that instead.+- The Media and Library panels take the same gestures: ⌘/⇧-click a tile, or sweep a rubber-band over the grid, and dragging any picked tile onto the timeline lays the whole set down one after another from the drop point.- The user can multi-select (⌘/⇧-click, or sweep a rubber-band over empty track space) across every kind at once — clips, audio, titles, cues. Deleting or copying acts on the whole selection, and dragging any member moves the set as one: every item shifts by the same time, relative spacing kept, while unselected items slide out of the way and flow back. A selection of one kind on the multi-row tracks (audio, titles) also retracks together on a vertical drag, one row past the end opening a new track. A hover chip on each video clip toggles its own audio.- Anything can be hidden instead of deleted: it stays on the timeline (grayed) but drops out of playback and export — a hidden video clip plays black and silent. Per item: set_clip_hidden, or the \`hidden\` field on update_overlay_video/update_overlay/update_audio. A transition bar hides the same way (set_transition_hidden): it keeps the cut it sits on so nothing else claims that boundary, and the cut renders hard. Whole rows: set_track_hidden (video/soundtrack/text/subtitles/transitions) and set_track_muted (video) — the eye/speaker toggles on the track headers.- detach_audio lifts a video clip's sound to the soundtrack track (and mutes the clip) so audio can be cut independently of video.