Skip to content

Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.

Studio: show audio clip details, playback and runs in the Library (#12814)

Etherl9a43c1b07338
diff --git a/studio/backend/core/inference/audio_gallery.py b/studio/backend/core/inference/audio_gallery.py
index 3186f311bdb..8c58ad1384b 100644
--- a/studio/backend/core/inference/audio_gallery.py
+++ b/studio/backend/core/inference/audio_gallery.py
@@ -517,7 +517,8 @@ def delete(audio_id: str) -> bool:
if path is None:
return False
# only delete a pair we own; a foreign or orphan wav must not be destroyed by a guessed id
- if _read_meta(_sidecar_path(audio_id)) is None:
+ meta = _read_meta(_sidecar_path(audio_id))
+ if meta is None:
return False
try:
path.unlink()
@@ -530,9 +531,50 @@ def delete(audio_id: str) -> bool:
pass
_remove_source(audio_id)
gallery_flags.forget(gallery_dir(), [audio_id])
+ # An Edit's hidden Original goes with the last clip that plays it.
+ original = str(meta.get("source_clip_id") or "")
+ if (
+ _ID_RE.match(original)
+ and (_read_meta(_sidecar_path(original)) or {}).get("role") == "source"
+ and original not in _sources_in_use(gallery_dir(), set())
+ ):
+ delete(original)
return True
+def delete_group(group_id: str) -> int:
+ """Delete one run's active clips; archived ones are spared, as in clear()."""
+ if not group_id:
+ return 0
+ directory = gallery_dir()
+ # Locked and trusted like clear(): a racing archive or unreadable store never loses a clip.
+ with gallery_flags.exclusive(directory, require_file_lock = True):
+ flags = gallery_flags.read_trusted(directory)
+ try:
+ paths = _clip_wavs(directory)
+ except OSError:
+ return 0
+ removed: list[str] = []
+ for path in paths:
+ if (_read_meta(_sidecar_path(path.stem)) or {}).get(
+ "group_id"
+ ) != group_id or gallery_flags.is_archived(flags, path.stem):
+ continue
+ try:
+ path.unlink()
+ except OSError as exc:
+ logger.warning("audio_gallery.delete_failed: %s", exc)
+ continue
+ removed.append(path.stem)
+ try:
+ _sidecar_path(path.stem).unlink()
+ except OSError:
+ pass
+ _remove_source(path.stem)
+ gallery_flags.forget_locked(directory, removed)
+ return len(removed)
+
+
def clear(include_archived: bool = False, workflow: Optional[str] = None) -> int:
"""Delete every Unsloth-owned pair (readable sidecar); return the count removed. Foreign and
orphan WAVs are preserved, since list_audio already hides them.
diff --git a/studio/backend/core/library.py b/studio/backend/core/library.py
index 36b92654ebe..04d53029ad8 100644
--- a/studio/backend/core/library.py
+++ b/studio/backend/core/library.py
@@ -10,7 +10,7 @@ Sources, each with its own id prefix so an item id says where its bytes are:
- ``image:<id>`` an image from the Images page gallery
- ``sandbox:<session_id>:<relative path>`` a file a chat tool wrote into its sandbox
- ``video:<id>`` a clip from the Video page gallery
-- ``audio:<id>`` a clip from the Audio page's TTS gallery
+- ``audio:<id>`` a clip from the Audio page's history
- ``model:<training|exported>:<path>`` a fine-tuned model under outputs/ or exports/ (no bytes:
a model is a directory, opened in chat instead)
@@ -102,6 +102,7 @@ def _item(
pair_id: Optional[str] = None,
project_id: Optional[str] = None,
run_id: Optional[str] = None,
+ audio: Optional[dict] = None,
) -> dict:
return {
"id": item_id,
@@ -121,6 +122,7 @@ def _item(
"runId": run_id,
"textOnly": text_only,
"model": model,
+ "audio": audio,
"archived": archived,
"_fingerprint": fingerprint,
}
@@ -461,11 +463,53 @@ def _attachment_items() -> list[dict]:
_NAME_BREAK_RE = re.compile(f"[{UNSAFE_NAME_CHARS}\\s]+")
-def _prompt_name(prompt: str, fallback: str, extension: str) -> str:
+def _prompt_name(
+ prompt: str,
+ fallback: str,
+ extension: str,
+ suffix: str = "",
+) -> str:
cleaned = _NAME_BREAK_RE.sub(" ", prompt).strip()
if len(cleaned) > 60:
cleaned = cleaned[:60].rsplit(" ", 1)[0] or cleaned[:60]
- return f"{cleaned or fallback}.{extension}"
+ return f"{cleaned or fallback}{suffix}.{extension}"
+
+
+_AUDIO_EXTENSION_RE = re.compile(r"\.(?:wav|mp3|flac|ogg|opus|m4a|aac|webm)$", re.IGNORECASE)
+
+
+def _audio_name(record: dict) -> str:
+ """``song - Vocals.wav``, ``prompt (2).wav``: a run's clips share one prompt."""
+ prompt = str(record.get("prompt") or "").rstrip(" .")
+ role = record.get("role")
+ settings = record.get("settings") if isinstance(record.get("settings"), dict) else {}
+ variation = settings.get("variation")
+ if record.get("workflow") == "separate" and isinstance(role, str) and role:
+ prompt = _AUDIO_EXTENSION_RE.sub("", prompt.strip())
+ stem = _NAME_BREAK_RE.sub(" ", role.replace("_", " ").replace("-", " ")).strip()
+ suffix = f" - {stem[:1].upper()}{stem[1:]}" if stem else ""
+ else:
+ tags = [
+ *(["edit"] if role == "edit" else []),
+ *([str(variation)] if type(variation) is int else []),
+ ]
+ suffix = f" ({' '.join(tags)})" if tags else ""
+ return _prompt_name(prompt, "Audio", "wav", suffix)
+
+
+def _audio_details(record: dict) -> dict:
+ settings = record.get("settings") if isinstance(record.get("settings"), dict) else {}
+ music = record.get("workflow") == "music"
+ variation = settings.get("variation")
+ return {
+ "workflow": record.get("workflow"),
+ "role": record.get("role"),
+ "groupId": record.get("group_id"),
+ "durationS": record.get("duration_s"),
+ "model": record.get("model"),
+ "mode": settings.get("mode") if music else None,
+ "variation": variation if music and type(variation) is int else None,
+ }
class _Gallery(NamedTuple):
@@ -515,6 +559,9 @@ def _gallery_items(kind: str) -> list[dict]:
# sized; and only when there are some, so an unreadable folder still lists nothing.
root = gallery.module.gallery_dir() if records else None
for record in records:
+ # An Edit's hidden Original: deleting it here would break that Edit.
+ if kind == "audio" and record.get("role") == "source":
+ continue
path = _listed_file(gallery, root, record["id"])
try:
size = path.stat().st_size if path is not None else None
@@ -535,7 +582,9 @@ def _gallery_items(kind: str) -> list[dict]:
items.append(
_item(
f"{kind}:{record['id']}",
- name = _prompt_name(
+ name = _audio_name(record)
+ if kind == "audio"
+ else _prompt_name(
str(record.get("prompt") or ""), gallery.label, gallery.extension
),
source = "generated",
@@ -544,6 +593,7 @@ def _gallery_items(kind: str) -> list[dict]:
created_at = _to_ms(record.get("created_at")),
file_url = record["url"],
archived = archived,
+ audio = _audio_details(record) if kind == "audio" else None,
)
)
if sidecar is not None:
@@ -563,6 +613,31 @@ def _audio_items() -> list[dict]:
return _gallery_items("audio")
+def unlisted_bytes(items: list[dict]) -> dict[str, int]:
+ """Bytes no item lists (voices, recordings, transcripts, hidden Edit originals), per source."""
+ from core.inference import transcript_gallery
+
+ try:
+ roots = (_gallery("audio").module.gallery_dir(), transcript_gallery.gallery_dir())
+ except relocations.LocationUnavailable as exc:
+ _log_unavailable(exc)
+ return {}
+ except OSError:
+ return {}
+ total = 0
+ for root in roots:
+ try:
+ total += _tree_stats(root)[0]
+ except OSError:
+ pass
+ listed = sum(
+ item.get("storageBytes") or item.get("sizeBytes") or 0
+ for item in items
+ if item["id"].startswith("audio:")
+ )
+ return {"audio": max(0, total - listed)}
+
+
MODEL_CONTENT_TYPE = "application/x-unsloth-model"
diff --git a/studio/backend/routes/inference.py b/studio/backend/routes/inference.py
index e03689ac8a3..231ab0f9818 100644
--- a/studio/backend/routes/inference.py
+++ b/studio/backend/routes/inference.py
@@ -46436,6 +46436,28 @@ async def delete_gallery_audio(audio_id: str, current_subject: str = Depends(get
return {"deleted": True}
+@studio_router.delete("/audio/gallery/group/{group_id}")
+async def delete_gallery_audio_group(
+ group_id: str, current_subject: str = Depends(get_current_subject)
+):
+ """A run's clips in one call, so the page drops them together instead of stem by stem."""
+ from core.inference import audio_gallery
+ from core.inference.gallery_flags import FlagsUnavailable
+
+ try:
+ removed = await asyncio.to_thread(audio_gallery.delete_group, group_id)
+ except FlagsUnavailable as exc:
+ logger.warning("audio_gallery.delete_group_blocked: %s", exc)
+ raise HTTPException(
+ status_code = 503,
+ detail = "Could not read the gallery's archive data, so deleting was stopped to "
+ "avoid deleting archived clips.",
+ )
+ if not removed:
+ raise HTTPException(status_code = 404, detail = "Audio not found.")
+ return {"removed": removed}
+
+
@studio_router.delete("/audio/gallery")
async def clear_gallery_audio(
workflow: Optional[Literal["speak", "clone", "edit", "convert", "music", "separate"]] = None,
diff --git a/studio/backend/routes/library.py b/studio/backend/routes/library.py
index 98509174f05..cfc9180be8c 100644
--- a/studio/backend/routes/library.py
+++ b/studio/backend/routes/library.py
@@ -102,6 +102,9 @@ def _items_for_caller(items: list[dict], via_api_key: bool) -> list[dict]:
# A fine-tune of a local model names that folder; a Hub repo id is kept.
if isinstance(base, str) and os.path.isabs(base):
item["model"] = {**item["model"], "baseModel": cache_reference(base)}
+ made_with = (item.get("audio") or {}).get("model")
+ if isinstance(made_with, str) and os.path.isabs(made_with):
+ item["audio"] = {**item["audio"], "model": cache_reference(made_with)}
shown.append(item)
return redact_inventory_host_paths(shown, via_api_key = via_api_key)
@@ -162,10 +165,12 @@ async def get_library(
items = await run_in_threadpool(library.list_items)
disk = await run_in_threadpool(library.disk_usage)
+ unlisted = await run_in_threadpool(library.unlisted_bytes, items)
return {
"items": _items_for_caller(items, via_api_key),
"folders": library_db.list_folders(),
"disk": redact_inventory_host_paths(disk, via_api_key = via_api_key),
+ "unlistedBytes": unlisted,
}
diff --git a/studio/backend/tests/multi_account/factories_media.py b/studio/backend/tests/multi_account/factories_media.py
index 17630246f89..bfa9a2306a3 100644
--- a/studio/backend/tests/multi_account/factories_media.py
+++ b/studio/backend/tests/multi_account/factories_media.py
@@ -110,6 +110,26 @@ def seed_audio(account) -> dict[str, str]:
return {"audio_id": record["id"]}
+@seeder("media-audio-group")
+def seed_audio_group(account) -> dict[str, str]:
+ from core.inference import audio_gallery
+ from utils.account_context import run_as
+
+ meta = {
+ "prompt": SENTINEL,
+ "model": "media/none",
+ "audio_type": "audiocpp_sep",
+ "workflow": "separate",
+ "role": "vocals",
+ "group_id": "matrixgroup",
+ "sample_rate": 8000,
+ "duration_s": 0.008,
+ "created_at": "2026-01-01T00:00:00+00:00",
+ }
+ run_as(account, audio_gallery.save, _wav_bytes(), meta)
+ return {"group_id": "matrixgroup"}
+
+
@seeder("media-audio-converted")
def seed_converted_audio(account) -> dict[str, str]:
import tempfile
@@ -360,6 +380,7 @@ FACTORIES = {
"media-audio", {"archived": True}, fragment = SENTINEL
),
"routes.inference:DELETE:/audio/gallery/{audio_id}": Factory("media-audio"),
+ "routes.inference:DELETE:/audio/gallery/group/{group_id}": Factory("media-audio-group"),
"routes.inference:POST:/audio/gallery/{audio_id}/move": Factory(
"media-audio", {"after_id": None}, fragment = SENTINEL
),
diff --git a/studio/backend/tests/test_audio_gallery.py b/studio/backend/tests/test_audio_gallery.py
index 3c2bbf7a280..bc0d76fb2d8 100644
--- a/studio/backend/tests/test_audio_gallery.py
+++ b/studio/backend/tests/test_audio_gallery.py
@@ -980,3 +980,101 @@ def test_a_kept_source_goes_with_its_clip(tmp_path):
again = gallery.save(_wav(), _meta(), source)
assert gallery.delete(again["id"])
assert not (gallery.gallery_dir() / f"{again['id']}.source.wav").exists()
+
+
+def test_deleting_the_last_edit_takes_its_hidden_original():
+ source = gallery.save(_wav(), _meta(workflow = "edit", role = "source"))
+ first, second = (
+ gallery.save(_wav(), _meta(workflow = "edit", role = "output", source_clip_id = source["id"]))
+ for _ in range(2)
+ )
+ assert gallery.delete(first["id"]) is True
+ assert gallery.audio_path(source["id"]) is not None # the second edit still plays it
+ assert gallery.delete(second["id"]) is True
+ assert gallery.audio_path(source["id"]) is None
+
+
+def test_deleting_a_clip_made_from_a_listed_clip_keeps_that_clip():
+ take = gallery.save(_wav(), _meta())
+ converted = gallery.save(_wav(), _meta(workflow = "convert", source_clip_id = take["id"]))
+ assert gallery.delete(converted["id"]) is True
+ assert gallery.audio_path(take["id"]) is not None
+
+
+def test_a_group_delete_takes_only_that_runs_clips():
+ from fastapi import HTTPException
+ from routes.inference import delete_gallery_audio_group
+
+ stems = [
+ gallery.save(_wav(), _meta(workflow = "separate", group_id = "g1", role = r))
+ for r in ("vocals", "drums")
+ ]
+ other = gallery.save(_wav(), _meta(workflow = "separate", group_id = "g2", role = "vocals"))
+ loose = gallery.save(_wav(), _meta())
+ assert asyncio.run(delete_gallery_audio_group("g1", current_subject = "tester")) == {"removed": 2}
+ assert all(gallery.audio_path(stem["id"]) is None for stem in stems)
+ assert {r["id"] for r in gallery.list_audio()} == {other["id"], loose["id"]}
+ assert gallery.delete_group("") == 0
+ with pytest.raises(HTTPException) as missing:
+ asyncio.run(delete_gallery_audio_group("g1", current_subject = "tester"))
+ assert missing.value.status_code == 404
+
+
+def test_a_group_delete_spares_the_runs_archived_clips():
+ # A stem restored from the archive leaves its siblings archived; deleting the run on the
+ # Separate page, which lists only active clips, must not take them.
+ stems = [
+ gallery.save(_wav(), _meta(workflow = "separate", group_id = "g1", role = r))
+ for r in ("vocals", "drums", "bass")
+ ]
+ for stem in stems[1:]:
+ gallery.set_flags(stem["id"], archived = True)
+ assert gallery.delete_group("g1") == 1
+ assert gallery.audio_path(stems[0]["id"]) is None
+ assert {r["id"] for r in gallery.list_audio(archived = True)} == {s["id"] for s in stems[1:]}
+
+
+def test_the_group_route_refuses_with_an_unreadable_store():
+ from fastapi import HTTPException
+ from routes.inference import delete_gallery_audio_group
+
+ stem = gallery.save(_wav(), _meta(workflow = "separate", group_id = "g1", role = "vocals"))
+ gallery.set_flags(stem["id"], archived = True)
+ (gallery.gallery_dir() / ".flags.json").write_text("corrupt", encoding = "utf-8")
+ with pytest.raises(HTTPException) as excinfo:
+ asyncio.run(delete_gallery_audio_group("g1", current_subject = "tester"))
+ assert excinfo.value.status_code == 503
+ assert gallery.audio_path(stem["id"]) is not None
+
+
+def test_an_archive_racing_a_group_delete_is_never_lost(monkeypatch):
+ import threading
+
+ from core.inference import gallery_flags
+
+ stems = [
+ gallery.save(_wav(), _meta(workflow = "separate", group_id = "g1", role = r))
+ for r in ("vocals", "drums")
+ ]
+ target = stems[1]["id"]
+ archived: list = []
+ real_read_trusted = gallery_flags.read_trusted
+
+ def read_then_archive(directory):
+ flags = real_read_trusted(directory)
+ worker = threading.Thread(
+ target = lambda: archived.append(gallery.set_flags(target, archived = True))
+ )
+ worker.start()
+ worker.join(timeout = 0.5)
+ return flags
+
+ monkeypatch.setattr(gallery_flags, "read_trusted", read_then_archive)
+ gallery.delete_group("g1")
+ monkeypatch.setattr(gallery_flags, "read_trusted", real_read_trusted)
+ for _ in range(50):
+ if archived:
+ break
+ threading.Event().wait(0.1)
+ # The archive either lands first and spares the stem, or waits and finds it gone.
+ assert archived and (archived[0] is None) == (gallery.audio_path(target) is None)
diff --git a/studio/backend/tests/test_library_routes.py b/studio/backend/tests/test_library_routes.py
index c20b7268236..c3c1ec5a186 100644
--- a/studio/backend/tests/test_library_routes.py
+++ b/studio/backend/tests/test_library_routes.py
@@ -706,6 +706,113 @@ def test_generated_audio_and_video_are_listed_and_deleted(client, monkeypatch):
assert forgotten == [video, video]
+def _audio_clip(prompt: str, **extra) -> str:
+ from core.inference import audio_gallery
+
+ meta = {"model": "htdemucs", "audio_type": "audiocpp_sep", "sample_rate": 44100}
+ meta |= {"duration_s": 2.5, "prompt": prompt, "created_at": 1_700_000_000}
+ return audio_gallery.save(b"RIFF0000WAVE", {**meta, **extra})["id"]
+
+
+def test_an_edit_source_recording_is_not_listed(client, monkeypatch):
+ monkeypatch.setattr(library, "_SOURCES", (library._audio_items,))
+ source = _audio_clip("The old words", workflow = "edit", role = "source")
+ edited = _audio_clip("The new words.", workflow = "edit", role = "output", source_clip_id = source)
+ items = _items(client)[0]
+ assert f"audio:{source}" not in items
+ assert items[f"audio:{edited}"]["name"] == "The new words.wav"
+ assert items[f"audio:{edited}"]["audio"]["workflow"] == "edit"
+
+
+def test_separated_stems_are_named_by_stem_and_carry_their_run(client, monkeypatch):
+ monkeypatch.setattr(library, "_SOURCES", (library._audio_items, library._upload_items))
+ vocals = _audio_clip("song.mp3", workflow = "separate", role = "vocals", group_id = "g1")
+ drums = _audio_clip("song.mp3", workflow = "separate", role = "drums", group_id = "g1")
+ (upload,) = _upload(client, ("notes.txt", b"hi", "text/plain"))
+ items = _items(client)[0]
+ assert (items[f"audio:{vocals}"]["name"], items[f"audio:{drums}"]["name"]) == (
+ "song - Vocals.wav",
+ "song - Drums.wav",
+ )
+ assert items[f"audio:{vocals}"]["audio"] == {
+ "workflow": "separate",
+ "role": "vocals",
+ "groupId": "g1",
+ "durationS": 2.5,
+ "model": "htdemucs",
+ "mode": None,
+ "variation": None,
+ }
+ assert items[upload]["audio"] is None
+
+
+def test_music_variations_and_edits_get_distinct_names(client, monkeypatch):
+ monkeypatch.setattr(library, "_SOURCES", (library._audio_items,))
+
+ def song(
+ role,
+ variation,
+ mode = "song",
+ ):
+ settings = {"mode": mode, "variation": variation}
+ return _audio_clip("Rainy jazz", workflow = "music", role = role, settings = settings)
+
+ first, second = song("variation", 1), song("variation", 2)
+ edit, sfx = song("edit", None, "edit"), song("output", None, "sfx")
+ items = _items(client)[0]
+ names = [items[f"audio:{clip}"]["name"] for clip in (first, second, edit, sfx)]
+ assert names == [
+ "Rainy jazz (1).wav",
+ "Rainy jazz (2).wav",
+ "Rainy jazz (edit).wav",
+ "Rainy jazz.wav",
+ ]
+ assert [items[f"audio:{clip}"]["audio"]["mode"] for clip in (first, sfx)] == ["song", "sfx"]
+ assert [items[f"audio:{clip}"]["audio"]["variation"] for clip in (second, edit)] == [2, None]
+
+
+def test_a_long_prompt_keeps_its_stem_suffix(client, monkeypatch):
+ monkeypatch.setattr(library, "_SOURCES", (library._audio_items,))
+ clip = _audio_clip("word " * 40 + ".wav", workflow = "separate", role = "vocals")
+ name = _items(client)[0][f"audio:{clip}"]["name"]
+ assert name.endswith(" - Vocals.wav") and len(name) <= 60 + len(" - Vocals.wav")
+
+
+def test_a_clip_made_with_a_local_model_hides_its_path_from_an_api_key(
+ client, monkeypatch, tmp_path
+):
+ monkeypatch.setattr(library, "_SOURCES", (library._audio_items,))
+ local = str(tmp_path / "models" / "my-tts.gguf")
+ clip = _audio_clip("Hi", workflow = "speak", model = local)
+ assert _items(client)[0][f"audio:{clip}"]["audio"]["model"] == local
+ client.app.dependency_overrides[authenticated_via_api_key] = lambda: True
+ keyed = client.get("/api/library").json()["items"]
+ assert local not in json.dumps(keyed)
+ assert keyed[0]["audio"]["workflow"] == "speak"
+
+
+def test_storage_counts_what_the_audio_page_keeps_outside_its_clips(client, monkeypatch):
+ from core.inference import audio_gallery, transcript_gallery
+
+ monkeypatch.setattr(library, "_SOURCES", (library._audio_items,))
+ listed = _audio_clip("Kept")
+ # An Edit's hidden original, a saved voice and a transcript: on disk, in no item.
+ _audio_clip("Original", workflow = "edit", role = "source")
+ voices = audio_gallery.gallery_dir() / "voices"
+ voices.mkdir()
+ (voices / "voice.wav").write_bytes(b"v" * 1000)
+ (transcript_gallery.gallery_dir() / "t.json").write_bytes(b"t" * 500)
+ body = client.get("/api/library").json()
+ (item,) = body["items"]
+ assert item["id"] == f"audio:{listed}"
+ hidden = sum(
+ path.stat().st_size
+ for path in audio_gallery.gallery_dir().iterdir()
+ if path.is_file() and listed not in path.name
+ )
+ assert body["unlistedBytes"] == {"audio": hidden + 1000 + 500}
+
+
def test_the_listing_reports_the_library_disk_and_the_sources_on_it(client, monkeypatch):
from utils.paths.storage_roots import exports_root
diff --git a/studio/frontend/src/features/audio/api.ts b/studio/frontend/src/features/audio/api.ts
index 08ea23954ff..3a3c23f50ae 100644
--- a/studio/frontend/src/features/audio/api.ts
+++ b/studio/frontend/src/features/audio/api.ts
@@ -227,6 +227,14 @@ export async function deleteAudioClip(id: string): Promise<void> {
if (!response.ok) throw new Error(await readFastApiError(response));
}
+export async function deleteAudioGroup(groupId: string): Promise<void> {
+ const response = await authFetch(
+ `/api/inference/audio/gallery/group/${encodeURIComponent(groupId)}`,
+ { method: "DELETE" },
+ );
+ if (!response.ok) throw new Error(await readFastApiError(response));
+}
+
export async function clearAudioGallery(
workflow?: "speak" | "clone" | "edit" | "convert" | "music" | "separate",
): Promise<number> {
diff --git a/studio/frontend/src/features/audio/audio-page.tsx b/studio/frontend/src/features/audio/audio-page.tsx
index d39cff4678f..f18e6144cf0 100644
--- a/studio/frontend/src/features/audio/audio-page.tsx
+++ b/studio/frontend/src/features/audio/audio-page.tsx
@@ -388,6 +388,7 @@ export function AudioPage({
loadMore,
selectClip,
handleDeleteClip,
+ handleDeleteGroup,
handleArchiveClip,
handleTogglePin,
historyReorder,
@@ -2035,6 +2036,7 @@ export function AudioPage({
onPickModel={pickRecommendedModel}
separate={separate}
onSendStem={handleSendStem}
+ handleDeleteGroup={handleDeleteGroup}
/>
) : ttsWorkflow === "clone" ? (
<CloneOutput
diff --git a/studio/frontend/src/features/audio/components/waveform.tsx b/studio/frontend/src/features/audio/components/waveform.tsx
index fdf9fdbc228..823e2734c5f 100644
--- a/studio/frontend/src/features/audio/components/waveform.tsx
+++ b/studio/frontend/src/features/audio/components/waveform.tsx
@@ -36,6 +36,7 @@ export function Waveform({
overlay,
controlRef,
onPositionChange,
+ onError,
}: {
/** 0..1; null draws a flat placeholder while decoding. */
peaks: readonly number[] | null;
@@ -47,6 +48,7 @@ export function Waveform({
overlay?: ReactNode;
controlRef?: Ref<WaveformControl>;
onPositionChange?: (seconds: number, playing: boolean) => void;
+ onError?: () => void;
}) {
const audioRef = useRef<HTMLAudioElement | null>(null);
const [playing, setPlaying] = useState(false);
@@ -177,6 +179,7 @@ export function Waveform({
className="hidden"
onPlay={() => setPlaying(true)}
onPause={() => setPlaying(false)}
+ onError={onError}
onEnded={() => {
setPlaying(false);
setPosition(0);
diff --git a/studio/frontend/src/features/audio/hooks/use-audio-gallery.tsx b/studio/frontend/src/features/audio/hooks/use-audio-gallery.tsx
index 19bee2d7a86..7f44ecbb04f 100644
--- a/studio/frontend/src/features/audio/hooks/use-audio-gallery.tsx
+++ b/studio/frontend/src/features/audio/hooks/use-audio-gallery.tsx
@@ -24,6 +24,7 @@ import {
type AudioGalleryCursor,
clearAudioGallery,
deleteAudioClip,
+ deleteAudioGroup,
fetchClipBlob,
fetchClipObjectUrl,
listAudioGallery,
@@ -293,6 +294,22 @@ export function useAudioGallery({
[dropClip, refreshGallery],
);
+ const handleDeleteGroup = useCallback(
+ async (groupId: string, ids: readonly string[]) => {
+ try {
+ await deleteAudioGroup(groupId);
+ for (const id of ids) dropClip(id);
+ } catch (error) {
+ toast.error(
+ error instanceof Error ? error.message : "Could not delete the stems.",
+ );
+ }
+ // Either way, so a run the server only partly removed shows what is left.
+ await refreshGallery();
+ },
+ [dropClip, refreshGallery],
+ );
+
const handleArchiveClip = useCallback(
async (id: string) => {
try {
@@ -519,6 +536,7 @@ export function useAudioGallery({
loadMore,
selectClip,
handleDeleteClip,
+ handleDeleteGroup,
handleArchiveClip,
handleTogglePin,
historyReorder,
diff --git a/studio/frontend/src/features/audio/pages/separate-page.tsx b/studio/frontend/src/features/audio/pages/separate-page.tsx
index 5f9a3458796..925e2e3a7d0 100644
--- a/studio/frontend/src/features/audio/pages/separate-page.tsx
+++ b/studio/frontend/src/features/audio/pages/separate-page.tsx
@@ -374,6 +374,7 @@ export function SeparateOutput({
fallbackClip,
handleDownloadFallbackClip,
handleDeleteClip,
+ handleDeleteGroup,
handleArchiveClip,
handleTogglePin,
handleClearGallery,
@@ -392,6 +393,7 @@ export function SeparateOutput({
| "fallbackClip"
| "handleDownloadFallbackClip"
| "handleDeleteClip"
+ | "handleDeleteGroup"
| "handleArchiveClip"
| "handleTogglePin"
| "hasMore"
@@ -460,7 +462,16 @@ export function SeparateOutput({
if (last) await handleArchiveClip(last.id);
};
const deleteGroup = async (group: SeparationGroup) => {
- for (const clip of group.stems) await handleDeleteClip(clip.id);
+ // A clip saved without a run is a group of one.
+ const groupId = group.stems[0]?.group_id;
+ if (!groupId) {
+ for (const clip of group.stems) await handleDeleteClip(clip.id);
+ return;
+ }
+ await handleDeleteGroup(
+ groupId,
+ group.stems.map((clip) => clip.id),
+ );
};
return (
diff --git a/studio/frontend/src/features/library/actions.ts b/studio/frontend/src/features/library/actions.ts
index dfb56eea571..b8b5d5d6c93 100644
--- a/studio/frontend/src/features/library/actions.ts
+++ b/studio/frontend/src/features/library/actions.ts
@@ -3,6 +3,13 @@
import type { useNavigate } from "@tanstack/react-router";
import { zipSync } from "fflate";
+import { usePlatformStore } from "@/config/env";
+import {
+ isTtsAudioType,
+ trainedTtsCheckpointIsLoadable,
+ trainedTtsCheckpointIsRunnableOnMac,
+} from "@/features/audio/audio-page-policy";
+import { audioWorkflowForAudioType } from "@/features/audio/workflows";
import { getAuthSessionEpoch } from "@/features/auth";
import { listLoras } from "@/features/chat";
import {
@@ -199,6 +206,26 @@ export async function chatWithModel(
.catch(() => undefined);
if (getAuthSessionEpoch() !== epoch) return;
if (scanned?.audio_type) {
+ const { audio_type: audioType, export_type: exportType } = scanned;
+ if (
+ isTtsAudioType(audioType, exportType === "gguf") &&
+ trainedTtsCheckpointIsLoadable(audioType, exportType) &&
+ // The Audio page's picker hides what the Mac runtime cannot run; never load it from here.
+ (usePlatformStore.getState().deviceType !== "mac" ||
+ trainedTtsCheckpointIsRunnableOnMac(audioType, exportType))
+ ) {
+ void navigate({
+ to: "/audio",
+ search: {
+ model: model.path,
+ loadId: model.path,
+ // Native checkpoints need it for their custom-code approval and runtime checks.
+ audioType,
+ workflow: audioWorkflowForAudioType(audioType),
+ },
+ });
+ return;
+ }
toast(translate("library.toast.speechModel", { name: item.name }), {
description: translate("library.toast.speechModelDescription"),
});
diff --git a/studio/frontend/src/features/library/api.ts b/studio/frontend/src/features/library/api.ts
index 7886430f460..b5b950687e9 100644
--- a/studio/frontend/src/features/library/api.ts
+++ b/studio/frontend/src/features/library/api.ts
@@ -33,9 +33,21 @@ export interface LibraryItem {
openedAt: number | null;
/** Set for fine-tuned models, which are directories: opened in chat, never downloaded. */
model: LibraryModel | null;
+ audio?: LibraryAudio | null;
archived?: boolean;
}
+export interface LibraryAudio {
+ workflow: string;
+ /** A stem id for Separate; "output", "variation" or "edit" otherwise. */
+ role: string | null;
+ groupId: string | null;
+ durationS: number | null;
+ model: string;
+ mode: string | null;
+ variation: number | null;
+}
+
export interface LibraryModel {
path: string;
origin: "training" | "exported";
@@ -61,6 +73,8 @@ export interface LibrarySnapshot {
items: LibraryItem[];
folders: LibraryFolder[];
disk?: LibraryDisk | null;
+ /** Bytes no item lists, by source (audio: voices, recordings, transcripts). */
+ unlistedBytes?: Record<string, number>;
}
export function errorMessage(error: unknown): string {
diff --git a/studio/frontend/src/features/library/audio-items.ts b/studio/frontend/src/features/library/audio-items.ts
new file mode 100644
index 00000000000..a5ec5968d9d
--- /dev/null
+++ b/studio/frontend/src/features/library/audio-items.ts
@@ -0,0 +1,54 @@
+// SPDX-License-Identifier: AGPL-3.0-only
+// Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0
+
+// Free of app imports so the node test runner can load it directly.
+
+import { formatSeconds } from "../audio/components/waveform-peaks";
+import { orderStems, stemLabel } from "../audio/separation-stems";
+import { AUDIO_WORKFLOWS } from "../audio/workflows";
+import type { LibraryItem } from "./api";
+
+export type LibraryAudioWorkflow = (typeof AUDIO_WORKFLOWS)[number];
+
+export function audioWorkflow(item: LibraryItem): LibraryAudioWorkflow | null {
+ const id = item.audio?.workflow;
+ return AUDIO_WORKFLOWS.find((workflow) => workflow.id === id) ?? null;
+}
+
+const MUSIC_MODES: Record<string, string> = { sfx: "Sound effect", edit: "Edit" };
+
+export function audioDetail(item: LibraryItem): string | null {
+ const audio = item.audio;
+ if (!audio) return null;
+ if (audio.workflow === "separate") return audio.role ? stemLabel(audio.role) : null;
+ if (audio.workflow !== "music") return null;
+ const kind = MUSIC_MODES[audio.role === "edit" ? "edit" : (audio.mode ?? "")] ?? "Song";
+ return audio.variation ? `${kind} ${audio.variation}` : kind;
+}
+
+export function audioSummary(item: LibraryItem): string[] {
+ const audio = item.audio;
+ if (!audio) return [];
+ const what = audioDetail(item) ?? audioWorkflow(item)?.label;
+ return [audio.durationS ? formatSeconds(audio.durationS) : null, what ?? null].filter(
+ (part): part is string => part !== null,
+ );
+}
+
+/** A run's clips in Audio page order; empty outside a run. */
+export function runSiblings(items: readonly LibraryItem[], item: LibraryItem): LibraryItem[] {
+ const groupId = item.audio?.groupId;
+ if (!groupId) return [];
+ const run = items.filter((other) => other.audio?.groupId === groupId);
+ const stems = orderStems(run.map((other) => other.audio?.role ?? ""));
+ const rank = (other: LibraryItem) =>
+ other.audio?.workflow === "separate"
+ ? stems.indexOf(other.audio.role ?? "")
+ : (other.audio?.variation ?? 0);
+ return run.sort((a, b) => rank(a) - rank(b));
+}
+
+export function audioWorkflowOptions(items: readonly LibraryItem[]): LibraryAudioWorkflow[] {
+ const present = new Set(items.map((item) => item.audio?.workflow));
+ return AUDIO_WORKFLOWS.filter((workflow) => present.has(workflow.id));
+}
diff --git a/studio/frontend/src/features/library/audio-playback.ts b/studio/frontend/src/features/library/audio-playback.ts
new file mode 100644
index 00000000000..5a079cd111c
--- /dev/null
+++ b/studio/frontend/src/features/library/audio-playback.ts
@@ -0,0 +1,72 @@
+// SPDX-License-Identifier: AGPL-3.0-only
+// Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0
+
+import { translate } from "@/i18n";
+import { toast } from "@/lib/toast";
+import { useSyncExternalStore } from "react";
+import { type LibraryItem, errorMessage, fetchLibraryStreamUrl } from "./api";
+
+// One player for every card, so starting a clip stops the one before it.
+let player: HTMLAudioElement | null = null;
+let playingId: string | null = null;
+// Bumped by every play and stop, so a link that arrives late never starts a clip left behind.
+let generation = 0;
+const listeners = new Set<() => void>();
+
+function setPlaying(id: string | null): void {
+ playingId = id;
+ for (const listener of listeners) listener();
+}
+
+export function stopLibraryAudio(): void {
+ generation += 1;
+ player?.pause();
+ if (playingId !== null) setPlaying(null);
+}
+
+/** A hidden card is the clip's only control, so its clip stops. */
+export function stopLibraryAudioUnlessShown(shown: ReadonlySet<string>): void {
+ if (playingId !== null && !shown.has(playingId)) stopLibraryAudio();
+}
+
+function failed(item: LibraryItem, error: unknown, mine: number): void {
+ if (mine !== generation) return;
+ // A failed stream can both reject play() and fire error: report it once.
+ generation += 1;
+ setPlaying(null);
+ toast.error(translate("library.audio.playFailed", { name: item.name }), {
+ description: errorMessage(error),
+ });
+}
+
+export async function toggleLibraryAudio(item: LibraryItem): Promise<void> {
+ const wasPlaying = playingId === item.id;
+ stopLibraryAudio();
+ if (wasPlaying) return;
+ const mine = generation;
+ // Shown as playing while the link is fetched, so a second click stops it rather than restarts.
+ setPlaying(item.id);
+ let url: string;
+ try {
+ url = await fetchLibraryStreamUrl(item);
+ } catch (error) {
+ failed(item, error, mine);
+ return;
+ }
+ if (mine !== generation) return;
+ player ??= new Audio();
+ player.onended = () => mine === generation && setPlaying(null);
+ // A stream that fails after play() resolved never rejects it.
+ player.onerror = () => failed(item, player?.error?.message ?? "", mine);
+ player.src = url;
+ player.play().catch((error: unknown) => failed(item, error, mine));
+}
+
+function subscribe(listener: () => void): () => void {
+ listeners.add(listener);
+ return () => listeners.delete(listener);
+}
+
+export function useLibraryAudioPlaying(id: string): boolean {
+ return useSyncExternalStore(subscribe, () => playingId === id);
+}
diff --git a/studio/frontend/src/features/library/components/library-cards.tsx b/studio/frontend/src/features/library/components/library-cards.tsx
index 29013ab18c3..1c63ee00968 100644
--- a/studio/frontend/src/features/library/components/library-cards.tsx
+++ b/studio/frontend/src/features/library/components/library-cards.tsx
@@ -4,16 +4,19 @@
import { Checkbox } from "@/components/ui/checkbox";
import { useLocale, useT } from "@/i18n";
import { cn } from "@/lib/utils";
-import { Folder01Icon, PlayIcon } from "@hugeicons/core-free-icons";
+import { Folder01Icon, PauseIcon, PlayIcon } from "@hugeicons/core-free-icons";
import { HugeiconsIcon } from "@hugeicons/react";
import { type ReactNode, type RefObject, useContext, useRef, useState } from "react";
import type { LibraryFolder, LibraryItem } from "../api";
+import { audioSummary, audioWorkflow } from "../audio-items";
+import { toggleLibraryAudio, useLibraryAudioPlaying } from "../audio-playback";
import {
KIND_ICONS,
KIND_ICON_CLASS,
fileKind,
hasThumbnail,
} from "../file-kind";
+import { streamsPreview } from "../file-name";
import { formatCardTime, formatItemCount } from "../format";
import { useColumnCount, useLibraryThumbnail, useSeen } from "../hooks";
import { useLibraryActions } from "../actions-context";
@@ -38,7 +41,7 @@ export function KindIcon({ item, className }: { item: LibraryItem; className?: s
const kind = fileKind(item);
return (
<HugeiconsIcon
- icon={KIND_ICONS[kind]}
+ icon={audioWorkflow(item)?.icon ?? KIND_ICONS[kind]}
strokeWidth={1.5}
className={cn(KIND_ICON_CLASS[kind], className, kind === "model" && "scale-95")}
/>
@@ -123,6 +126,7 @@ function CardFrame({
className,
label,
glass = false,
+ control,
}: {
selectKey: string;
onOpen: () => void;
@@ -131,6 +135,7 @@ function CardFrame({
className?: string;
label: string;
glass?: boolean;
+ control?: ReactNode;
}) {
const t = useT();
const select = useContext(CardSelectionContext);
@@ -164,22 +169,50 @@ function CardFrame({
)}
/>
)}
+ {control}
<div className="absolute right-2 top-2">{menu}</div>
</div>
);
}
+function PlayButton({ item }: { item: LibraryItem }) {
+ const t = useT();
+ const playing = useLibraryAudioPlaying(item.id);
+ return (
+ <button
+ type="button"
+ aria-label={t(playing ? "library.audio.pause" : "library.audio.play", { name: item.name })}
+ aria-pressed={playing}
+ onClick={() => void toggleLibraryAudio(item)}
+ className={cn(
+ OVERLAY_CONTROL,
+ "absolute bottom-3 left-4 flex size-7 items-center justify-center rounded-full text-foreground outline-none transition-colors hover:bg-muted focus-visible:ring-2 focus-visible:ring-ring dark:hover:bg-neutral-600",
+ )}
+ >
+ <HugeiconsIcon
+ icon={playing ? PauseIcon : PlayIcon}
+ strokeWidth={2}
+ className="size-3.5 [&_path]:fill-current"
+ />
+ </button>
+ );
+}
+
export function ItemCard({ item }: { item: LibraryItem }) {
const locale = useLocale();
const actions = useLibraryActions();
const showTime = useLibrarySettingsStore((s) => s.showCardDates);
const square = useLibrarySettingsStore((s) => s.imageLayout === "square");
const thumb = hasThumbnail(item);
+ const playable = fileKind(item) === "audio" && streamsPreview(item.id, "audio");
+ const summary = audioSummary(item).join(" · ");
+ const caption = [summary, showTime ? formatCardTime(item.updatedAt, locale) : ""].filter(Boolean);
return (
<CardFrame
selectKey={`item:${item.id}`}
label={item.name}
onOpen={() => actions.openItem(item)}
+ control={playable ? <PlayButton item={item} /> : undefined}
menu={
<LibraryActionsMenu
target={{ kind: "item", item }}
@@ -213,8 +246,19 @@ export function ItemCard({ item }: { item: LibraryItem }) {
<div className="flex flex-col items-center before:flex-5 after:flex-7">
<KindIcon item={item} className={cardIconClass(item)} />
</div>
- <p className="truncate pr-6 text-ui-12 text-muted-foreground">
- {showTime && formatCardTime(item.updatedAt, locale)}
+ {/* One line: a date that does not fit wraps onto a hidden second line. */}
+ <p
+ className={cn(
+ "flex h-[1lh] flex-wrap overflow-hidden pr-6 text-ui-12 tabular-nums text-muted-foreground",
+ playable && "pl-8",
+ )}
+ >
+ {caption.map((part, index) => (
+ <span key={part} className="truncate">
+ {index > 0 && "\u00a0·\u00a0"}
+ {part}
+ </span>
+ ))}
</p>
</div>
)}
diff --git a/studio/frontend/src/features/library/components/library-list.tsx b/studio/frontend/src/features/library/components/library-list.tsx
index 9239ddf6df7..b510a01d7a5 100644
--- a/studio/frontend/src/features/library/components/library-list.tsx
+++ b/studio/frontend/src/features/library/components/library-list.tsx
@@ -9,6 +9,7 @@ import { StarPointedIcon } from "@/lib/hugeicons-derived";
import { HugeiconsIcon } from "@hugeicons/react";
import type { ReactNode } from "react";
import type { LibraryFolder, LibraryItem } from "../api";
+import { audioSummary } from "../audio-items";
import { modelLabelKey } from "../file-kind";
import { formatActivityTime, formatCardTime, formatItemCount, formatSize } from "../format";
import type { LibrarySortKey, LibrarySortState } from "../settings-store";
@@ -290,6 +291,11 @@ export function LibraryList({
{t(modelLabelKey(item)!)}
</span>
)}
+ {item.audio && (
+ <span className="shrink-0 text-muted-foreground text-sm tabular-nums">
+ {audioSummary(item).join(" · ")}
+ </span>
+ )}
{favoriteMarks && item.favorite && (
<HugeiconsIcon
icon={StarPointedIcon}
diff --git a/studio/frontend/src/features/library/components/library-preview.tsx b/studio/frontend/src/features/library/components/library-preview.tsx
index 2f1066df9ef..77e1998ad50 100644
--- a/studio/frontend/src/features/library/components/library-preview.tsx
+++ b/studio/frontend/src/features/library/components/library-preview.tsx
@@ -9,13 +9,16 @@ import { Button } from "@/components/ui/button";
import { MediaViewer, ScaleMenu } from "@/components/media-viewer";
import { Spinner } from "@/components/ui/spinner";
import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip";
+import { audioModelLabel } from "@/features/audio/audio-workspace-utils";
+import { Waveform } from "@/features/audio/components/waveform";
+import { formatSeconds } from "@/features/audio/components/waveform-peaks";
import { ArtifactHtmlFrame } from "@/features/chat";
import { type TranslationKey, useLocale, useT } from "@/i18n";
import { MessageCircleIcon } from "@/lib/hugeicons-derived";
import { toast } from "@/lib/toast";
import { useBlocker } from "@tanstack/react-router";
import { cn } from "@/lib/utils";
-import { PlayIcon } from "@hugeicons/core-free-icons";
+import { Download04Icon, PlayIcon } from "@hugeicons/core-free-icons";
import { HugeiconsIcon } from "@hugeicons/react";
import { type ReactNode, useEffect, useMemo, useRef, useState } from "react";
import {
@@ -25,6 +28,8 @@ import {
fetchLibraryText,
writeLibraryText,
} from "../api";
+import { audioDetail, audioWorkflow } from "../audio-items";
+import { stopLibraryAudio } from "../audio-playback";
import {
fileKind,
hasImagePreview,
@@ -35,7 +40,7 @@ import {
} from "../file-kind";
import { formatCardTime, formatSize } from "../format";
import { type EmbeddedBody, fileExtension, hasOwnFile, itemVersion } from "../file-name";
-import { useLibraryDocument, useLibraryPreviewUrl } from "../hooks";
+import { useLibraryAudioPeaks, useLibraryDocument, useLibraryPreviewUrl } from "../hooks";
import { useLibraryOrigin } from "../origin";
import { type NoteFormat, type NoteReadOnlyReason, encodeNote } from "../note-text";
import { canReveal, revealInFolder, useRevealLabel } from "../reveal";
@@ -239,6 +244,43 @@ function NoPreview({
);
}
+function RunStrip({
+ item,
+ run,
+ onOpenItem,
+ onDownloadRun,
+}: {
+ item: LibraryItem;
+ run: LibraryItem[];
+ onOpenItem: (id: string) => void;
+ onDownloadRun: () => void;
+}) {
+ const t = useT();
+ return (
+ <div className="flex flex-col gap-2">
+ <p className="text-ui-12 text-muted-foreground">{t("library.audio.fromRun")}</p>
+ <div className="flex flex-wrap items-center gap-1.5">
+ {run.map((clip) => (
+ <Button
+ key={clip.id}
+ variant={clip.id === item.id ? "secondary" : "ghost"}
+ size="sm"
+ aria-pressed={clip.id === item.id}
+ className="rounded-full px-3"
+ onClick={() => clip.id !== item.id && onOpenItem(clip.id)}
+ >
+ {audioDetail(clip) ?? clip.name}
+ </Button>
+ ))}
+ <Button variant="outline" size="sm" className="ml-auto rounded-full px-3" onClick={onDownloadRun}>
+ <HugeiconsIcon icon={Download04Icon} strokeWidth={1.75} className="size-4" />
+ {t("library.audio.downloadRun")}
+ </Button>
+ </div>
+ </div>
+ );
+}
+
function ViewButton({
label,
active,
@@ -281,6 +323,9 @@ function PreviewBody({
mediaFailed,
onMediaError,
onDownload,
+ run,
+ onOpenItem,
+ onDownloadRun,
}: {
item: LibraryItem;
itemText: ItemText;
@@ -291,6 +336,9 @@ function PreviewBody({
mediaFailed: boolean;
onMediaError: () => void;
onDownload?: () => void;
+ run: LibraryItem[];
+ onOpenItem: (id: string) => void;
+ onDownloadRun: () => void;
}) {
const t = useT();
const body = viewFor(item, showCode);
@@ -298,6 +346,7 @@ function PreviewBody({
!mediaFailed && (body === "image" || body === "audio" || body === "video") ? body : null;
const { url, error: urlError, retry } = useLibraryPreviewUrl(item, embedded);
const doc = useLibraryDocument(item, body === "document");
+ const peaks = useLibraryAudioPeaks(item, body === "audio" && !mediaFailed);
const draftFile = useMemo(() => (draft === null ? null : new Blob([draft])), [draft]);
const handleMediaError = () => {
if (!retry()) onMediaError();
@@ -351,8 +400,17 @@ function PreviewBody({
);
case "audio":
return (
- <div className="m-auto w-full max-w-lg px-6">
- <audio src={url!} controls onError={handleMediaError} className="w-full" />
+ <div className="m-auto flex w-full max-w-2xl flex-col gap-6 px-6">
+ <Waveform
+ peaks={peaks}
+ durationS={item.audio?.durationS ?? null}
+ src={url}
+ label={item.name}
+ onError={handleMediaError}
+ />
+ {run.length > 1 && (
+ <RunStrip item={item} run={run} onOpenItem={onOpenItem} onDownloadRun={onDownloadRun} />
+ )}
</div>
);
case "video":
@@ -438,6 +496,9 @@ export function LibraryPreview({
onToggleFavorite,
onDelete,
onSaved,
+ run = [],
+ onOpenItem,
+ onDownloadRun,
}: {
item: LibraryItem | null;
onOpenChange: (open: boolean) => void;
@@ -446,6 +507,9 @@ export function LibraryPreview({
onToggleFavorite: (item: LibraryItem) => void;
onDelete: (item: LibraryItem) => void;
onSaved: () => void;
+ run?: LibraryItem[];
+ onOpenItem: (id: string) => void;
+ onDownloadRun: (items: LibraryItem[]) => void;
}) {
const t = useT();
const locale = useLocale();
@@ -492,6 +556,11 @@ export function LibraryPreview({
const revealLabel = useRevealLabel();
const originOf = useLibraryOrigin();
const origin = item ? originOf(item) : null;
+ // The preview has its own player: a card left playing would talk over it.
+ const open = item !== null;
+ useEffect(() => {
+ if (open) stopLibraryAudio();
+ }, [open]);
async function trySave(): Promise<string | null> {
if (!item || draft === null || !unsaved) return null;
@@ -560,15 +629,25 @@ export function LibraryPreview({
onOpenChange(false);
}
+ const workflow = item && audioWorkflow(item);
const meta = item
? [
item.threadId
? t("library.preview.fromChat")
- : t(
- modelLabelKey(item) ??
- (item.source === "generated" ? "library.toolbar.generated" : "library.toolbar.uploaded"),
- ),
+ : workflow
+ ? workflow.label
+ : t(
+ modelLabelKey(item) ??
+ (item.source === "generated" ? "library.toolbar.generated" : "library.toolbar.uploaded"),
+ ),
item.threadId ? item.threadTitle : null,
+ ...(item.audio
+ ? [
+ audioDetail(item),
+ item.audio.durationS ? formatSeconds(item.audio.durationS) : null,
+ item.audio.model ? audioModelLabel(item.audio.model) : null,
+ ]
+ : []),
formatSize(item.sizeBytes, locale, t),
formatCardTime(item.updatedAt, locale),
].filter(Boolean)
@@ -670,6 +749,9 @@ export function LibraryPreview({
mediaFailed={mediaFailed}
onMediaError={() => setBrokenMedia(version)}
onDownload={download}
+ run={run}
+ onOpenItem={onOpenItem}
+ onDownloadRun={() => onDownloadRun(run)}
/>
)}
{/* Portalled, so it sits over the preview whatever the body is. */}
diff --git a/studio/frontend/src/features/library/components/library-toolbar.tsx b/studio/frontend/src/features/library/components/library-toolbar.tsx
index 403dd378dbe..e379e4ab825 100644
--- a/studio/frontend/src/features/library/components/library-toolbar.tsx
+++ b/studio/frontend/src/features/library/components/library-toolbar.tsx
@@ -34,6 +34,7 @@ import { cn } from "@/lib/utils";
import { HugeiconsIcon, type IconSvgElement } from "@hugeicons/react";
import { ArrowDownUpIcon } from "lucide-react";
import type { LibrarySource } from "../api";
+import type { LibraryAudioWorkflow } from "../audio-items";
import type { LibraryTypeFilter } from "../file-kind";
import { EMPTY_FILTERS, type LibraryFilters, filtersActive } from "../filters";
import type { LibrarySortKey, LibraryView } from "../settings-store";
@@ -99,14 +100,17 @@ function FilterMenu({
filters,
onChange,
showTypes,
+ workflows,
}: {
filters: LibraryFilters;
onChange: (next: LibraryFilters) => void;
showTypes: boolean;
+ workflows: readonly LibraryAudioWorkflow[];
}) {
const t = useT();
const option = (
- { value, label, icon }: MenuOption<string>,
+ { value, icon }: { value: string; icon: IconSvgElement },
+ label: string,
checked: boolean,
toggle: () => void,
) => (
@@ -118,7 +122,7 @@ function FilterMenu({
}}
>
<HugeiconsIcon icon={icon} strokeWidth={1.75} className={ICON} />
- <span className="flex-1">{t(label)}</span>
+ <span className="flex-1">{label}</span>
{/* Always rendered so the menu width does not change when ticked. */}
<HugeiconsIcon
icon={Tick02Icon}
@@ -147,18 +151,34 @@ function FilterMenu({
{t("library.toolbar.fileType")}
</DropdownMenuLabel>
{TYPE_OPTIONS.map((entry) =>
- option(entry, filters.types.has(entry.value), () =>
+ option(entry, t(entry.label), filters.types.has(entry.value), () =>
onChange({ ...filters, types: toggled(filters.types, entry.value) }),
),
)}
<DropdownMenuSeparator className="mx-3" />
</>
)}
+ {workflows.length > 0 && (
+ <>
+ <DropdownMenuLabel className="px-3 pb-1 pt-2 text-muted-foreground font-normal">
+ {t("library.toolbar.workflow")}
+ </DropdownMenuLabel>
+ {workflows.map((workflow) =>
+ option(
+ { value: workflow.id, icon: workflow.icon },
+ workflow.label,
+ filters.workflows.has(workflow.id),
+ () => onChange({ ...filters, workflows: toggled(filters.workflows, workflow.id) }),
+ ),
+ )}
+ <DropdownMenuSeparator className="mx-3" />
+ </>
+ )}
<DropdownMenuLabel className="px-3 pb-1 pt-2 text-muted-foreground font-normal">
{t("library.toolbar.source")}
</DropdownMenuLabel>
{SOURCE_OPTIONS.map((entry) =>
- option(entry, filters.sources.has(entry.value), () =>
+ option(entry, t(entry.label), filters.sources.has(entry.value), () =>
onChange({ ...filters, sources: toggled(filters.sources, entry.value) }),
),
)}
@@ -311,6 +331,7 @@ export function LibraryToolbar({
filters,
onFiltersChange,
filterMode,
+ workflows = [],
view,
onViewChange,
sort,
@@ -323,6 +344,7 @@ export function LibraryToolbar({
filters: LibraryFilters;
onFiltersChange: (next: LibraryFilters) => void;
filterMode: "none" | "source" | "all";
+ workflows?: readonly LibraryAudioWorkflow[];
view: LibraryView;
onViewChange: (view: LibraryView) => void;
/** Grid view only: list view sorts by column headers. */
@@ -341,6 +363,7 @@ export function LibraryToolbar({
filters={filters}
onChange={onFiltersChange}
showTypes={filterMode === "all"}
+ workflows={workflows}
/>
)}
{sort && <SortMenu {...sort} />}
diff --git a/studio/frontend/src/features/library/filters.ts b/studio/frontend/src/features/library/filters.ts
index 46d5ec079dd..b5ac52b493b 100644
--- a/studio/frontend/src/features/library/filters.ts
+++ b/studio/frontend/src/features/library/filters.ts
@@ -7,12 +7,17 @@ import { type LibraryTypeFilter, TYPE_FILTER_KINDS, fileKind } from "./file-kind
export interface LibraryFilters {
sources: Set<LibrarySource>;
types: Set<LibraryTypeFilter>;
+ workflows: Set<string>;
}
-export const EMPTY_FILTERS: LibraryFilters = { sources: new Set(), types: new Set() };
+export const EMPTY_FILTERS: LibraryFilters = {
+ sources: new Set(),
+ types: new Set(),
+ workflows: new Set(),
+};
export function filtersActive(filters: LibraryFilters): boolean {
- return filters.sources.size > 0 || filters.types.size > 0;
+ return filters.sources.size > 0 || filters.types.size > 0 || filters.workflows.size > 0;
}
export function matchesFilters(
@@ -21,6 +26,9 @@ export function matchesFilters(
typesApply: boolean,
): boolean {
if (filters.sources.size > 0 && !filters.sources.has(item.source)) return false;
+ if (filters.workflows.size > 0 && !filters.workflows.has(item.audio?.workflow ?? "")) {
+ return false;
+ }
if (!typesApply || filters.types.size === 0) return true;
const kind = fileKind(item);
return [...filters.types].some((type) => TYPE_FILTER_KINDS[type].includes(kind));
diff --git a/studio/frontend/src/features/library/hooks.ts b/studio/frontend/src/features/library/hooks.ts
index ef3e56fa9f8..ccc20b01b02 100644
--- a/studio/frontend/src/features/library/hooks.ts
+++ b/studio/frontend/src/features/library/hooks.ts
@@ -2,6 +2,7 @@
// Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0
import { MAX_DOCUMENT_PREVIEW_BYTES } from "@/components/file-viewer";
+import { decodePeaks } from "@/features/audio/components/waveform-decode";
import { translate } from "@/i18n";
import { type RefObject, useEffect, useState } from "react";
import {
@@ -106,6 +107,31 @@ export function useLibraryDocument(
return { file: current?.file ?? null, error: current?.error ?? null };
}
+/** decodePeaks' own cap: past it the decode is skipped, so the bytes are not worth fetching. */
+const MAX_PEAKS_BYTES = 60 * 1024 * 1024;
+
+/** Waveform peaks; null while decoding or when the clip cannot decode (flat bars). */
+export function useLibraryAudioPeaks(item: LibraryItem, enabled: boolean): number[] | null {
+ const key = itemVersion(item);
+ const [state, setState] = useState<{ key: string; peaks: number[] | null } | null>(null);
+ useEffect(() => {
+ if (!enabled) return;
+ let cancelled = false;
+ fetchLibraryBlob(item, item.contentType, MAX_PEAKS_BYTES)
+ .then(decodePeaks)
+ .then(
+ ({ peaks }) => !cancelled && setState({ key, peaks }),
+ () => !cancelled && setState({ key, peaks: null }),
+ );
+ return () => {
+ cancelled = true;
+ };
+ // `key` carries the item's identity and version; the object itself changes on every refresh.
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ }, [key, enabled]);
+ return enabled && state?.key === key ? state.peaks : null;
+}
+
/** A card's picture once `enabled`: a bounded thumbnail of the image, or a video's first frame,
* never the original, whose decoded size has no limit. Cached, and held while the card shows it;
* `failed` once it cannot load, so the card can fall back to the type icon. */
diff --git a/studio/frontend/src/features/library/library-page.tsx b/studio/frontend/src/features/library/library-page.tsx
index 586cf497ddb..68db37be546 100644
--- a/studio/frontend/src/features/library/library-page.tsx
+++ b/studio/frontend/src/features/library/library-page.tsx
@@ -73,6 +73,8 @@ import {
LibraryToolbar,
type NewAction,
} from "./components/library-toolbar";
+import { audioWorkflowOptions, runSiblings } from "./audio-items";
+import { stopLibraryAudio, stopLibraryAudioUnlessShown } from "./audio-playback";
import { EMPTY_FILTERS, type LibraryFilters, filtersActive, matchesFilters } from "./filters";
import { LIBRARY_TABS, type LibrarySearch, type LibraryTab } from "./search";
import { useLibraryStore } from "./store";
@@ -219,10 +221,11 @@ function LibraryView({ search }: { search: LibrarySearch }) {
const view = useLibraryViewStore((s) => s.view);
const setView = useLibraryViewStore((s) => s.setView);
const openSettings = useSettingsDialogStore((s) => s.openDialog);
+ useEffect(() => stopLibraryAudio, []);
const [query, setQuery] = useState("");
const [chosenFilters, setFilters] = useState<LibraryFilters>(() =>
- search.filter === "files" ? { sources: new Set(), types: new Set(FILE_TYPES) } : EMPTY_FILTERS,
+ search.filter === "files" ? { ...EMPTY_FILTERS, types: new Set(FILE_TYPES) } : EMPTY_FILTERS,
);
const [selection, setSelection] = useState<Set<string>>(new Set());
const [nameDialog, setNameDialog] = useState<NameDialogState | null>(null);
@@ -320,6 +323,10 @@ function LibraryView({ search }: { search: LibrarySearch }) {
// Folders have no filter menu, so tab filters do not apply inside them.
const filterMode = folderId || tab === "folders" ? "none" : kindFilter ? "source" : "all";
const filters = filterMode === "none" ? EMPTY_FILTERS : chosenFilters;
+ const workflowOptions = useMemo(
+ () => (tab === "audio" && !folderId ? audioWorkflowOptions(items) : []),
+ [tab, folderId, items],
+ );
const shownTabs = LIBRARY_TABS.filter((entry) => entry === tab || tabVisible(entry));
@@ -344,6 +351,12 @@ function LibraryView({ search }: { search: LibrarySearch }) {
return [...pool].sort(compareBySort(sort));
}, [items, folderId, tab, needle, filters, kindFilter, settings.suggestedLimit, sort]);
+ // Only grid cards can pause a clip: stop it once its card is gone or the list view replaces them.
+ useEffect(() => {
+ if (view !== "grid") stopLibraryAudio();
+ else stopLibraryAudioUnlessShown(new Set(visibleItems.map((item) => item.id)));
+ }, [view, visibleItems]);
+
const visibleFolders = useMemo(() => {
const showsFolders = folderId || tab === "folders" || tab === "all";
if (!showsFolders || (filtersActive(filters) && tab !== "folders")) return [];
@@ -384,6 +397,15 @@ function LibraryView({ search }: { search: LibrarySearch }) {
pushedPreview.current = id;
go({ ...search, item: id });
};
+ // Another clip of the same run, in place of this one: Back still closes the preview.
+ const switchPreview = (id: string) => {
+ if (pushedPreview.current === search.item) pushedPreview.current = id;
+ go({ ...search, item: id }, true);
+ };
+ const previewRun = useMemo(
+ () => (previewItem ? runSiblings(items, previewItem) : []),
+ [items, previewItem],
+ );
const closePreview = () => {
if (!search.item) return;
setClosingPreview(search.item);
@@ -958,6 +980,7 @@ function LibraryView({ search }: { search: LibrarySearch }) {
filters={filters}
onFiltersChange={setFilters}
filterMode={filterMode}
+ workflows={workflowOptions}
view={view}
onViewChange={setView}
sort={view === "grid" && (folderId || tab !== "favorites") ? gridSort : undefined}
@@ -1088,6 +1111,9 @@ function LibraryView({ search }: { search: LibrarySearch }) {
onToggleFavorite={actions.toggleFavorite}
onDelete={(item) => actions.remove({ kind: "item", item })}
onSaved={() => void refresh()}
+ run={previewRun}
+ onOpenItem={switchPreview}
+ onDownloadRun={(run) => void downloadLibraryItems(run)}
/>
</LibraryActionsProvider>
);
diff --git a/studio/frontend/src/features/library/origin.ts b/studio/frontend/src/features/library/origin.ts
index 05a0e5cd377..89b98424042 100644
--- a/studio/frontend/src/features/library/origin.ts
+++ b/studio/frontend/src/features/library/origin.ts
@@ -1,6 +1,7 @@
// SPDX-License-Identifier: AGPL-3.0-only
// Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0
+import { isAudioWorkflowId } from "@/features/audio/workflows";
import { useTrainingRuntimeStore } from "@/features/training";
import type { TranslationKey } from "@/i18n";
import { useNavigate } from "@tanstack/react-router";
@@ -58,9 +59,14 @@ export function useLibraryOrigin(): (item: LibraryItem) => LibraryOrigin | null
};
}
if (kind === "audio") {
+ const workflow = item.audio?.workflow;
return {
label: "library.preview.viewInAudio",
- open: () => void navigate({ to: "/audio", search: { ...search, task: "text-to-speech" } }),
+ open: () =>
+ void navigate({
+ to: "/audio",
+ search: isAudioWorkflowId(workflow) ? { ...search, workflow } : search,
+ }),
};
}
return null;
diff --git a/studio/frontend/src/features/library/storage.ts b/studio/frontend/src/features/library/storage.ts
index 785c17515d2..d75810a36ab 100644
--- a/studio/frontend/src/features/library/storage.ts
+++ b/studio/frontend/src/features/library/storage.ts
@@ -68,7 +68,8 @@ export function useLibraryStorage(): LibraryStorage {
status: LibraryStorage["status"];
items: LibraryItem[];
disk: LibraryDisk | null;
- }>({ status: "loading", items: [], disk: null });
+ unlisted: Record<string, number>;
+ }>({ status: "loading", items: [], disk: null, unlisted: {} });
const [version, setVersion] = useState(0);
useEffect(() => {
const stale = () => setVersion((current) => current + 1);
@@ -78,7 +79,9 @@ export function useLibraryStorage(): LibraryStorage {
useEffect(() => {
let cancelled = false;
getLibrary().then(
- ({ items, disk }) => !cancelled && setSnapshot({ status: "ready", items, disk: disk ?? null }),
+ ({ items, disk, unlistedBytes }) =>
+ !cancelled &&
+ setSnapshot({ status: "ready", items, disk: disk ?? null, unlisted: unlistedBytes ?? {} }),
() => !cancelled && setSnapshot((current) => ({ ...current, status: "error" })),
);
return () => {
@@ -105,6 +108,17 @@ export function useLibraryStorage(): LibraryStorage {
total.count += 1;
totals.set(category, total);
}
+ for (const [source, bytes] of Object.entries(snapshot.unlisted)) {
+ if (!onDisk || onDisk.has(source)) diskBytes += bytes;
+ if (!includedBySettings(`${source}:`, settings)) {
+ hiddenBytes += bytes;
+ continue;
+ }
+ const category = KIND_CATEGORIES[source] ?? "files";
+ const total = totals.get(category) ?? { bytes: 0, count: 0 };
+ total.bytes += bytes;
+ totals.set(category, total);
+ }
const categories = CATEGORY_LINKS.flatMap(([category, link]) => {
const total = totals.get(category);
return total ? [{ category, link, ...total }] : [];
diff --git a/studio/frontend/src/i18n/locales/ar.ts b/studio/frontend/src/i18n/locales/ar.ts
index 7b6d3b79cfd..98e32b20b75 100644
--- a/studio/frontend/src/i18n/locales/ar.ts
+++ b/studio/frontend/src/i18n/locales/ar.ts
@@ -3778,7 +3778,7 @@ export const ar = {
videosTitle: "لا توجد فيديوهات بعد",
videosDescription: "تظهر هنا الفيديوهات التي ترفعها أو تنشئها.",
audioTitle: "لا يوجد صوت بعد",
- audioDescription: "يظهر هنا الكلام الذي تنشئه في صفحة الصوت.",
+ audioDescription: "يظهر هنا الكلام والموسيقى والمسارات المفصولة التي تنشئها في صفحة الصوت.",
modelsTitle: "لا توجد نماذج مضبوطة بعد",
modelsDescription: "تظهر هنا النماذج التي تدربها أو تصدّرها في Unsloth.",
createFolder: "إنشاء مجلد",
@@ -3831,6 +3831,7 @@ export const ar = {
source: "المصدر",
fileType: "نوع الملف",
clearFilters: "مسح عوامل التصفية",
+ workflow: "أُنشئ باستخدام",
uploaded: "مرفوعة",
sortAscending: "تصاعدي",
sortDescending: "تنازلي",
@@ -3848,6 +3849,13 @@ export const ar = {
sortModified: "تاريخ التعديل",
sortSize: "الحجم",
},
+ audio: {
+ play: "تشغيل {name}",
+ pause: "إيقاف {name} مؤقتًا",
+ playFailed: "تعذّر تشغيل {name}",
+ fromRun: "من التشغيل نفسه",
+ downloadRun: "تنزيل الكل",
+ },
create: {
note: "ملاحظة",
image: "صورة",
diff --git a/studio/frontend/src/i18n/locales/de.ts b/studio/frontend/src/i18n/locales/de.ts
index f44f1c90b68..b46a42d1a1b 100644
--- a/studio/frontend/src/i18n/locales/de.ts
+++ b/studio/frontend/src/i18n/locales/de.ts
@@ -3849,7 +3849,7 @@ export const de = {
videosTitle: "Noch keine Videos",
videosDescription: "Videos, die Sie hochladen oder generieren, erscheinen hier.",
audioTitle: "Noch kein Audio",
- audioDescription: "Sprache, die Sie auf der Audio-Seite generieren, erscheint hier.",
+ audioDescription: "Sprache, Musik und Spuren, die Sie auf der Audio-Seite erstellen, erscheinen hier.",
modelsTitle: "Noch keine feinabgestimmten Modelle",
modelsDescription: "Modelle, die Sie in Unsloth trainieren oder exportieren, erscheinen hier.",
createFolder: "Ordner erstellen",
@@ -3902,6 +3902,7 @@ export const de = {
source: "Quelle",
fileType: "Dateityp",
clearFilters: "Filter zurücksetzen",
+ workflow: "Erstellt mit",
uploaded: "Hochgeladen",
sortAscending: "Aufsteigend",
sortDescending: "Absteigend",
@@ -3919,6 +3920,13 @@ export const de = {
sortModified: "Geändert",
sortSize: "Größe",
},
+ audio: {
+ play: "{name} abspielen",
+ pause: "{name} pausieren",
+ playFailed: "{name} konnte nicht abgespielt werden",
+ fromRun: "Aus demselben Durchlauf",
+ downloadRun: "Alle herunterladen",
+ },
create: {
note: "Notiz",
image: "Bild",
diff --git a/studio/frontend/src/i18n/locales/en.ts b/studio/frontend/src/i18n/locales/en.ts
index 705aa11087d..037e55559f1 100644
--- a/studio/frontend/src/i18n/locales/en.ts
+++ b/studio/frontend/src/i18n/locales/en.ts
@@ -3806,7 +3806,7 @@ export const en = {
videosTitle: "No videos yet",
videosDescription: "Videos you upload or generate show up here.",
audioTitle: "No audio yet",
- audioDescription: "Speech you generate on the Audio page shows up here.",
+ audioDescription: "Speech, music and stems you make on the Audio page show up here.",
modelsTitle: "No fine-tuned models yet",
modelsDescription: "Models you train or export in Unsloth show up here.",
createFolder: "Create folder",
@@ -3862,6 +3862,7 @@ export const en = {
source: "Source",
fileType: "File type",
clearFilters: "Clear filters",
+ workflow: "Made with",
uploaded: "Uploaded",
generated: "Generated",
documents: "Documents",
@@ -3879,6 +3880,14 @@ export const en = {
sortAscending: "Ascending",
sortDescending: "Descending",
},
+ // A clip from the Audio page: its card's player and its preview's run.
+ audio: {
+ play: "Play {name}",
+ pause: "Pause {name}",
+ playFailed: "Could not play {name}",
+ fromRun: "From the same run",
+ downloadRun: "Download all",
+ },
// Entries of the New menu.
create: {
note: "Note",
diff --git a/studio/frontend/src/i18n/locales/es.ts b/studio/frontend/src/i18n/locales/es.ts
index f097c4a7ae3..d80657d0d06 100644
--- a/studio/frontend/src/i18n/locales/es.ts
+++ b/studio/frontend/src/i18n/locales/es.ts
@@ -3848,7 +3848,7 @@ export const es = {
videosTitle: "Aún no hay vídeos",
videosDescription: "Los vídeos que subas o generes aparecen aquí.",
audioTitle: "Aún no hay audio",
- audioDescription: "La voz que generes en la página Audio aparece aquí.",
+ audioDescription: "La voz, la música y las pistas que crees en la página Audio aparecen aquí.",
modelsTitle: "Aún no hay modelos ajustados",
modelsDescription: "Los modelos que entrenes o exportes en Unsloth aparecen aquí.",
createFolder: "Crear carpeta",
@@ -3901,6 +3901,7 @@ export const es = {
source: "Origen",
fileType: "Tipo de archivo",
clearFilters: "Borrar filtros",
+ workflow: "Creado con",
uploaded: "Subidos",
sortAscending: "Ascendente",
sortDescending: "Descendente",
@@ -3918,6 +3919,13 @@ export const es = {
sortModified: "Modificado",
sortSize: "Tamaño",
},
+ audio: {
+ play: "Reproducir {name}",
+ pause: "Pausar {name}",
+ playFailed: "No se pudo reproducir {name}",
+ fromRun: "De la misma ejecución",
+ downloadRun: "Descargar todo",
+ },
create: {
note: "Nota",
image: "Imagen",
diff --git a/studio/frontend/src/i18n/locales/fr.ts b/studio/frontend/src/i18n/locales/fr.ts
index 28d74a198f4..c5d11f87115 100644
--- a/studio/frontend/src/i18n/locales/fr.ts
+++ b/studio/frontend/src/i18n/locales/fr.ts
@@ -3860,7 +3860,7 @@ export const fr = {
videosTitle: "Aucune vidéo pour l'instant",
videosDescription: "Les vidéos que vous importez ou générez apparaissent ici.",
audioTitle: "Aucun audio pour l'instant",
- audioDescription: "La voix que vous générez sur la page Audio apparaît ici.",
+ audioDescription: "La voix, la musique et les pistes que vous créez sur la page Audio apparaissent ici.",
modelsTitle: "Aucun modèle affiné pour l'instant",
modelsDescription: "Les modèles que vous entraînez ou exportez dans Unsloth apparaissent ici.",
createFolder: "Créer un dossier",
@@ -3913,6 +3913,7 @@ export const fr = {
source: "Source",
fileType: "Type de fichier",
clearFilters: "Effacer les filtres",
+ workflow: "Créé avec",
uploaded: "Importés",
sortAscending: "Croissant",
sortDescending: "Décroissant",
@@ -3930,6 +3931,13 @@ export const fr = {
sortModified: "Modifié",
sortSize: "Taille",
},
+ audio: {
+ play: "Lire {name}",
+ pause: "Mettre {name} en pause",
+ playFailed: "Impossible de lire {name}",
+ fromRun: "De la même génération",
+ downloadRun: "Tout télécharger",
+ },
create: {
note: "Note",
image: "Image",
diff --git a/studio/frontend/src/i18n/locales/hi.ts b/studio/frontend/src/i18n/locales/hi.ts
index e9b55ce4ca3..8c6919901a7 100644
--- a/studio/frontend/src/i18n/locales/hi.ts
+++ b/studio/frontend/src/i18n/locales/hi.ts
@@ -3786,7 +3786,7 @@ export const hi = {
videosTitle: "अभी कोई वीडियो नहीं",
videosDescription: "आप जो वीडियो अपलोड या जनरेट करते हैं, वे यहाँ दिखते हैं।",
audioTitle: "अभी कोई ऑडियो नहीं",
- audioDescription: "ऑडियो पेज पर जनरेट की गई स्पीच यहाँ दिखती है।",
+ audioDescription: "ऑडियो पेज पर बनाई गई स्पीच, म्यूज़िक और स्टेम यहाँ दिखते हैं।",
modelsTitle: "अभी कोई फ़ाइन-ट्यून किया गया मॉडल नहीं",
modelsDescription: "Unsloth में आप जो मॉडल ट्रेन या एक्सपोर्ट करते हैं, वे यहाँ दिखते हैं।",
createFolder: "फ़ोल्डर बनाएँ",
@@ -3839,6 +3839,7 @@ export const hi = {
source: "स्रोत",
fileType: "फ़ाइल का प्रकार",
clearFilters: "फ़िल्टर हटाएँ",
+ workflow: "इससे बनाया गया",
uploaded: "अपलोड की गई",
sortAscending: "आरोही",
sortDescending: "अवरोही",
@@ -3856,6 +3857,13 @@ export const hi = {
sortModified: "बदला गया",
sortSize: "आकार",
},
+ audio: {
+ play: "{name} चलाएँ",
+ pause: "{name} रोकें",
+ playFailed: "{name} नहीं चल सका",
+ fromRun: "उसी रन से",
+ downloadRun: "सभी डाउनलोड करें",
+ },
create: {
note: "नोट",
image: "इमेज",
diff --git a/studio/frontend/src/i18n/locales/it.ts b/studio/frontend/src/i18n/locales/it.ts
index 12b3a7a04c2..d04604f4469 100644
--- a/studio/frontend/src/i18n/locales/it.ts
+++ b/studio/frontend/src/i18n/locales/it.ts
@@ -3849,7 +3849,7 @@ export const it = {
videosTitle: "Ancora nessun video",
videosDescription: "I video che carichi o generi compaiono qui.",
audioTitle: "Ancora nessun audio",
- audioDescription: "Il parlato che generi nella pagina Audio compare qui.",
+ audioDescription: "Il parlato, la musica e le tracce che crei nella pagina Audio compaiono qui.",
modelsTitle: "Ancora nessun modello con fine-tuning",
modelsDescription: "I modelli che addestri o esporti in Unsloth compaiono qui.",
createFolder: "Crea cartella",
@@ -3902,6 +3902,7 @@ export const it = {
source: "Origine",
fileType: "Tipo di file",
clearFilters: "Rimuovi filtri",
+ workflow: "Creato con",
uploaded: "Caricati",
sortAscending: "Crescente",
sortDescending: "Decrescente",
@@ -3919,6 +3920,13 @@ export const it = {
sortModified: "Modificato",
sortSize: "Dimensione",
},
+ audio: {
+ play: "Riproduci {name}",
+ pause: "Metti in pausa {name}",
+ playFailed: "Impossibile riprodurre {name}",
+ fromRun: "Dalla stessa esecuzione",
+ downloadRun: "Scarica tutto",
+ },
create: {
note: "Nota",
image: "Immagine",
diff --git a/studio/frontend/src/i18n/locales/ja.ts b/studio/frontend/src/i18n/locales/ja.ts
index 70d05d5e655..9c8015883dd 100644
--- a/studio/frontend/src/i18n/locales/ja.ts
+++ b/studio/frontend/src/i18n/locales/ja.ts
@@ -3728,7 +3728,7 @@ export const ja = {
videosTitle: "動画はまだありません",
videosDescription: "アップロードまたは生成した動画がここに表示されます。",
audioTitle: "音声はまだありません",
- audioDescription: "音声ページで生成した音声がここに表示されます。",
+ audioDescription: "音声ページで作成した音声、音楽、ステムがここに表示されます。",
modelsTitle: "ファインチューニング済みモデルはまだありません",
modelsDescription: "Unsloth でトレーニングまたはエクスポートしたモデルがここに表示されます。",
createFolder: "フォルダを作成",
@@ -3781,6 +3781,7 @@ export const ja = {
source: "ソース",
fileType: "ファイルの種類",
clearFilters: "フィルタをクリア",
+ workflow: "作成元",
uploaded: "アップロード済み",
sortAscending: "昇順",
sortDescending: "降順",
@@ -3798,6 +3799,13 @@ export const ja = {
sortModified: "更新日時",
sortSize: "サイズ",
},
+ audio: {
+ play: "{name} を再生",
+ pause: "{name} を一時停止",
+ playFailed: "{name} を再生できませんでした",
+ fromRun: "同じ実行から",
+ downloadRun: "すべてダウンロード",
+ },
create: {
note: "メモ",
image: "画像",
diff --git a/studio/frontend/src/i18n/locales/ko.ts b/studio/frontend/src/i18n/locales/ko.ts
index 9f97351c6b3..e0ff7e85ef3 100644
--- a/studio/frontend/src/i18n/locales/ko.ts
+++ b/studio/frontend/src/i18n/locales/ko.ts
@@ -3770,7 +3770,7 @@ export const ko = {
videosTitle: "아직 동영상이 없습니다",
videosDescription: "업로드하거나 생성한 동영상이 여기에 표시됩니다.",
audioTitle: "아직 오디오가 없습니다",
- audioDescription: "오디오 페이지에서 생성한 음성이 여기에 표시됩니다.",
+ audioDescription: "오디오 페이지에서 만든 음성, 음악, 스템이 여기에 표시됩니다.",
modelsTitle: "아직 파인튜닝된 모델이 없습니다",
modelsDescription: "Unsloth에서 학습하거나 내보낸 모델이 여기에 표시됩니다.",
createFolder: "폴더 만들기",
@@ -3823,6 +3823,7 @@ export const ko = {
source: "출처",
fileType: "파일 형식",
clearFilters: "필터 지우기",
+ workflow: "만든 곳",
uploaded: "업로드됨",
sortAscending: "오름차순",
sortDescending: "내림차순",
@@ -3840,6 +3841,13 @@ export const ko = {
sortModified: "수정한 날짜",
sortSize: "크기",
},
+ audio: {
+ play: "{name} 재생",
+ pause: "{name} 일시정지",
+ playFailed: "{name}을(를) 재생할 수 없습니다",
+ fromRun: "같은 실행에서",
+ downloadRun: "모두 다운로드",
+ },
create: {
note: "메모",
image: "이미지",
diff --git a/studio/frontend/src/i18n/locales/pt-br.ts b/studio/frontend/src/i18n/locales/pt-br.ts
index 0bda120999f..4eb1aaa1b99 100644
--- a/studio/frontend/src/i18n/locales/pt-br.ts
+++ b/studio/frontend/src/i18n/locales/pt-br.ts
@@ -3808,7 +3808,7 @@ export const ptBR = {
videosTitle: "Nenhum vídeo ainda",
videosDescription: "Os vídeos que você envia ou gera aparecem aqui.",
audioTitle: "Nenhum áudio ainda",
- audioDescription: "A fala que você gera na página Áudio aparece aqui.",
+ audioDescription: "A fala, a música e as faixas que você cria na página Áudio aparecem aqui.",
modelsTitle: "Nenhum modelo ajustado ainda",
modelsDescription: "Os modelos que você treina ou exporta no Unsloth aparecem aqui.",
createFolder: "Criar pasta",
@@ -3861,6 +3861,7 @@ export const ptBR = {
source: "Origem",
fileType: "Tipo de arquivo",
clearFilters: "Limpar filtros",
+ workflow: "Criado com",
uploaded: "Enviados",
sortAscending: "Crescente",
sortDescending: "Decrescente",
@@ -3878,6 +3879,13 @@ export const ptBR = {
sortModified: "Modificado",
sortSize: "Tamanho",
},
+ audio: {
+ play: "Reproduzir {name}",
+ pause: "Pausar {name}",
+ playFailed: "Não foi possível reproduzir {name}",
+ fromRun: "Da mesma execução",
+ downloadRun: "Baixar tudo",
+ },
create: {
note: "Nota",
image: "Imagem",
diff --git a/studio/frontend/src/i18n/locales/ru.ts b/studio/frontend/src/i18n/locales/ru.ts
index c8dcd94727b..4aae6ba435a 100644
--- a/studio/frontend/src/i18n/locales/ru.ts
+++ b/studio/frontend/src/i18n/locales/ru.ts
@@ -3805,7 +3805,7 @@ export const ru = {
videosTitle: "Видео пока нет",
videosDescription: "Здесь появляются видео, которые вы загружаете или генерируете.",
audioTitle: "Аудио пока нет",
- audioDescription: "Здесь появляется речь, которую вы генерируете на странице «Аудио».",
+ audioDescription: "Здесь появляются речь, музыка и дорожки, которые вы создаёте на странице «Аудио».",
modelsTitle: "Дообученных моделей пока нет",
modelsDescription: "Здесь появляются модели, которые вы обучаете или экспортируете в Unsloth.",
createFolder: "Создать папку",
@@ -3858,6 +3858,7 @@ export const ru = {
source: "Источник",
fileType: "Тип файла",
clearFilters: "Сбросить фильтры",
+ workflow: "Создано в",
uploaded: "Загруженные",
sortAscending: "По возрастанию",
sortDescending: "По убыванию",
@@ -3875,6 +3876,13 @@ export const ru = {
sortModified: "Изменено",
sortSize: "Размер",
},
+ audio: {
+ play: "Воспроизвести {name}",
+ pause: "Приостановить {name}",
+ playFailed: "Не удалось воспроизвести {name}",
+ fromRun: "Из того же запуска",
+ downloadRun: "Скачать все",
+ },
create: {
note: "Заметка",
image: "Изображение",
diff --git a/studio/frontend/src/i18n/locales/zh-CN.ts b/studio/frontend/src/i18n/locales/zh-CN.ts
index a10639eaa3a..4ecb993745c 100644
--- a/studio/frontend/src/i18n/locales/zh-CN.ts
+++ b/studio/frontend/src/i18n/locales/zh-CN.ts
@@ -3684,7 +3684,7 @@ export const zhCN = {
videosTitle: "还没有视频",
videosDescription: "你上传或生成的视频会显示在这里。",
audioTitle: "还没有音频",
- audioDescription: "你在音频页面生成的语音会显示在这里。",
+ audioDescription: "你在音频页面创建的语音、音乐和分轨会显示在这里。",
modelsTitle: "还没有微调模型",
modelsDescription: "你在 Unsloth 中训练或导出的模型会显示在这里。",
createFolder: "创建文件夹",
@@ -3737,6 +3737,7 @@ export const zhCN = {
source: "来源",
fileType: "文件类型",
clearFilters: "清除筛选",
+ workflow: "创建方式",
uploaded: "已上传",
sortAscending: "升序",
sortDescending: "降序",
@@ -3754,6 +3755,13 @@ export const zhCN = {
sortModified: "修改时间",
sortSize: "大小",
},
+ audio: {
+ play: "播放 {name}",
+ pause: "暂停 {name}",
+ playFailed: "无法播放 {name}",
+ fromRun: "来自同一次运行",
+ downloadRun: "全部下载",
+ },
create: {
note: "笔记",
image: "图像",
diff --git a/studio/frontend/tests/library-audio.test.ts b/studio/frontend/tests/library-audio.test.ts
new file mode 100644
index 00000000000..486e9c6171e
--- /dev/null
+++ b/studio/frontend/tests/library-audio.test.ts
@@ -0,0 +1,239 @@
+// SPDX-License-Identifier: AGPL-3.0-only
+// Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0
+
+import assert from "node:assert/strict";
+import test from "node:test";
+
+import { readSrc, registerBundlerResolver } from "./helpers/kit.ts";
+import { loadWithStubs } from "./helpers/module-stubs.ts";
+
+registerBundlerResolver();
+
+const { audioDetail, audioSummary, audioWorkflow, audioWorkflowOptions, runSiblings } =
+ await import("../src/features/library/audio-items.ts");
+const { EMPTY_FILTERS, filtersActive, matchesFilters } = await import(
+ "../src/features/library/filters.ts"
+);
+const policy = await import("../src/features/audio/audio-page-policy.ts");
+const workflows = await import("../src/features/audio/workflows.ts");
+
+type Item = Parameters<typeof audioDetail>[0];
+
+function clip(id: string, audio: Partial<NonNullable<Item["audio"]>> | null): Item {
+ return {
+ id,
+ name: `${id}.wav`,
+ source: audio ? "generated" : "uploaded",
+ contentType: "audio/wav",
+ sizeBytes: 4,
+ createdAt: 1,
+ updatedAt: 1,
+ fileUrl: `/files/${id}`,
+ threadId: null,
+ threadTitle: null,
+ textOnly: false,
+ favorite: false,
+ folderId: null,
+ openedAt: null,
+ model: null,
+ audio: audio && {
+ workflow: "speak",
+ role: "output",
+ groupId: null,
+ durationS: 42,
+ model: "unsloth/orpheus-3b",
+ mode: null,
+ variation: null,
+ ...audio,
+ },
+ };
+}
+
+const stem = (id: string, role: string, groupId = "run") =>
+ clip(id, { workflow: "separate", role, groupId });
+
+test("a clip names the Audio page workflow that made it; other audio names none", () => {
+ for (const id of ["speak", "clone", "edit", "convert", "music", "separate"]) {
+ assert.equal(audioWorkflow(clip(id, { workflow: id }))?.id, id);
+ }
+ assert.equal(audioWorkflow(clip("upload", null)), null);
+ // A workflow a newer server adds falls back to the plain audio icon.
+ assert.equal(audioWorkflow(clip("future", { workflow: "dub" })), null);
+});
+
+test("a stem shows its stem, music its kind and take, speech nothing extra", () => {
+ assert.equal(audioDetail(stem("v", "vocals")), "Vocals");
+ assert.equal(audioDetail(clip("m", { workflow: "music", mode: "song", variation: 2 })), "Song 2");
+ assert.equal(audioDetail(clip("s", { workflow: "music", mode: "sfx" })), "Sound effect");
+ assert.equal(audioDetail(clip("e", { workflow: "music", role: "edit", mode: "edit" })), "Edit");
+ assert.equal(audioDetail(clip("t", {})), null);
+ assert.deepEqual(audioSummary(stem("v", "vocals")), ["0:42", "Vocals"]);
+ assert.deepEqual(audioSummary(clip("t", { durationS: null })), ["Speak"]);
+ assert.deepEqual(audioSummary(clip("upload", null)), []);
+});
+
+test("a run lists its own clips in the Audio page's order", () => {
+ const items = [
+ stem("other", "other"),
+ stem("bass", "bass"),
+ stem("vocals", "vocals"),
+ stem("drums", "drums"),
+ stem("elsewhere", "vocals", "another-run"),
+ clip("loose", {}),
+ ];
+ const ids = (list: Item[]) => list.map((item) => item.id);
+ assert.deepEqual(ids(runSiblings(items, items[1]!)), ["vocals", "drums", "bass", "other"]);
+ assert.deepEqual(runSiblings(items, items[5]!), []);
+ const takes = [2, 1, 3].map((n) =>
+ clip(`take${n}`, { workflow: "music", role: "variation", groupId: "song", variation: n }),
+ );
+ assert.deepEqual(ids(runSiblings(takes, takes[0]!)), ["take1", "take2", "take3"]);
+});
+
+test("the Workflow filter offers only workflows present and keeps only their clips", () => {
+ const items = [stem("v", "vocals"), clip("speech", {}), clip("upload.mp3", null)];
+ assert.deepEqual(
+ audioWorkflowOptions(items).map((workflow) => workflow.id),
+ ["speak", "separate"],
+ );
+ const filters = { ...EMPTY_FILTERS, workflows: new Set(["separate"]) };
+ assert.equal(filtersActive(filters), true);
+ assert.equal(filtersActive(EMPTY_FILTERS), false);
+ assert.deepEqual(
+ items.filter((item) => matchesFilters(item, filters, false)).map((item) => item.id),
+ ["v"],
+ );
+ assert.equal(
+ items.every((item) => matchesFilters(item, EMPTY_FILTERS, false)),
+ true,
+ );
+});
+
+test("View in Audio opens the clip's own workflow instead of passing through Speak", () => {
+ const origin = readSrc("features/library/origin.ts");
+ assert.doesNotMatch(origin, /task: "text-to-speech"/);
+ assert.match(origin, /isAudioWorkflowId\(workflow\) \? \{ \.\.\.search, workflow \} : search/);
+});
+
+function chatWithModelFor(lora: { audio_type: string; export_type: string }, deviceType = "linux") {
+ const navigations: unknown[] = [];
+ const toasts: unknown[] = [];
+ const { chatWithModel } = loadWithStubs<{
+ chatWithModel: (navigate: (to: unknown) => Promise<void>, item: unknown) => Promise<void>;
+ }>(new URL("../src/features/library/actions.ts", import.meta.url), {
+ fflate: {},
+ "@/config/env": { usePlatformStore: { getState: () => ({ deviceType }) } },
+ "@/features/audio/audio-page-policy": policy,
+ "@/features/audio/workflows": workflows,
+ "@/features/auth": { getAuthSessionEpoch: () => 0 },
+ "@/features/chat": {
+ listLoras: async () => ({ loras: [{ adapter_path: "/out/my-voice", ...lora }] }),
+ },
+ "@/features/model-picker": {},
+ "@/i18n": { translate: (key: string) => key },
+ "@/lib/audio-utils": {},
+ "@/lib/api-base": { isTauri: false },
+ "@/lib/native-files": {},
+ "@/lib/toast": { toast: (title: unknown) => toasts.push(title) },
+ "@/lib/video-utils": {},
+ "./api": {},
+ "./file-kind": {},
+ "./file-name": {},
+ "./start-chat": {},
+ });
+ const item = { name: "my-voice", model: { path: "/out/my-voice", origin: "training", exportType: "merged" } };
+ return chatWithModel(async (to) => void navigations.push(to), item).then(() => ({ navigations, toasts }));
+}
+
+test("Chat with a speech fine-tune loads it on its Audio page with its audio type", async () => {
+ // A native checkpoint needs its audio type for the custom-code approval and runtime checks.
+ const native = await chatWithModelFor({ audio_type: "moss_tts_local", export_type: "merged" });
+ assert.deepEqual(native.navigations, [
+ {
+ to: "/audio",
+ search: { model: "/out/my-voice", loadId: "/out/my-voice", audioType: "moss_tts_local", workflow: "speak" },
+ },
+ ]);
+ assert.deepEqual(native.toasts, []);
+ // One the Audio page cannot load keeps the old pointer to its model menu.
+ const other = await chatWithModelFor({ audio_type: "whisper", export_type: "lora" });
+ assert.deepEqual(other.navigations, [{ to: "/audio" }]);
+ assert.deepEqual(other.toasts, ["library.toast.speechModel"]);
+});
+
+test("Chat with on a Mac skips a fine-tune the Audio page cannot run there", async () => {
+ const music = await chatWithModelFor({ audio_type: "minimax_music3", export_type: "merged" }, "mac");
+ assert.deepEqual(music.navigations, [{ to: "/audio" }]);
+ assert.deepEqual(music.toasts, ["library.toast.speechModel"]);
+ const merged = await chatWithModelFor({ audio_type: "moss_tts_local", export_type: "merged" }, "mac");
+ assert.equal((merged.navigations[0] as { search?: { loadId?: string } }).search?.loadId, "/out/my-voice");
+});
+
+test("the preview plays clips with the Audio page's waveform and stops a card that is playing", () => {
+ const preview = readSrc("features/library/components/library-preview.tsx");
+ assert.doesNotMatch(preview, /<audio src=\{url!\} controls/);
+ assert.match(preview, /<Waveform[\s\S]*?onError=\{handleMediaError\}/);
+ assert.match(preview, /if \(open\) stopLibraryAudio\(\);/);
+ // The card's play button sits beside the card's own button, never inside it.
+ const cards = readSrc("features/library/components/library-cards.tsx");
+ assert.match(cards, /<\/button>\n\s*\{select && \([\s\S]*?\)\}\n\s*\{control\}/);
+});
+
+test("a separation is deleted in one call", () => {
+ const separate = readSrc("features/audio/pages/separate-page.tsx");
+ assert.match(separate, /await handleDeleteGroup\(\s*groupId,/);
+ assert.match(readSrc("features/audio/api.ts"), /\/api\/inference\/audio\/gallery\/group\//);
+});
+
+test("the card player stops a clip whose card is gone and reports a failed stream once", async () => {
+ const toasts: unknown[] = [];
+ const players: FakeAudio[] = [];
+ class FakeAudio {
+ src = "";
+ paused = true;
+ error: { message: string } | null = null;
+ onended: (() => void) | null = null;
+ onerror: (() => void) | null = null;
+ rejectPlay: ((reason: unknown) => void) | null = null;
+ constructor() {
+ players.push(this);
+ }
+ play() {
+ this.paused = false;
+ return new Promise<void>((_resolve, reject) => {
+ this.rejectPlay = reject;
+ });
+ }
+ pause() {
+ this.paused = true;
+ }
+ }
+ (globalThis as { Audio?: unknown }).Audio = FakeAudio;
+ const playback = loadWithStubs<{
+ toggleLibraryAudio: (item: unknown) => Promise<void>;
+ stopLibraryAudioUnlessShown: (shown: ReadonlySet<string>) => void;
+ useLibraryAudioPlaying: (id: string) => boolean;
+ }>(new URL("../src/features/library/audio-playback.ts", import.meta.url), {
+ "@/i18n": { translate: (key: string) => key },
+ "@/lib/toast": { toast: { error: (title: unknown) => toasts.push(title) } },
+ react: { useSyncExternalStore: (_subscribe: unknown, get: () => boolean) => get() },
+ "./api": { errorMessage: String, fetchLibraryStreamUrl: async () => "blob:clip" },
+ });
+ const playing = (id: string) => playback.useLibraryAudioPlaying(id);
+
+ await playback.toggleLibraryAudio({ id: "audio:a", name: "a.wav" });
+ assert.equal(playing("audio:a"), true);
+ playback.stopLibraryAudioUnlessShown(new Set(["audio:a", "audio:b"]));
+ assert.equal(playing("audio:a"), true);
+ playback.stopLibraryAudioUnlessShown(new Set(["audio:b"]));
+ assert.equal(playing("audio:a"), false);
+ assert.equal(players[0]!.paused, true);
+
+ await playback.toggleLibraryAudio({ id: "audio:b", name: "b.wav" });
+ players[0]!.error = { message: "network" };
+ players[0]!.onerror?.();
+ players[0]!.rejectPlay?.(new Error("aborted"));
+ await new Promise((resolve) => setTimeout(resolve, 0));
+ assert.equal(playing("audio:b"), false);
+ assert.deepEqual(toasts, ["library.audio.playFailed"]);
+});
diff --git a/studio/frontend/tests/library-state.test.ts b/studio/frontend/tests/library-state.test.ts
index 05d760f8d61..655d27c769f 100644
--- a/studio/frontend/tests/library-state.test.ts
+++ b/studio/frontend/tests/library-state.test.ts
@@ -397,6 +397,9 @@ function loadDownloads(
downloadLibraryItems: (items: { name: string; sizeBytes: number | null }[]) => Promise<void>;
}>(new URL("../src/features/library/actions.ts", import.meta.url), {
fflate,
+ "@/config/env": { usePlatformStore: { getState: () => ({ deviceType: "linux" }) } },
+ "@/features/audio/audio-page-policy": {},
+ "@/features/audio/workflows": {},
"@/features/auth": { getAuthSessionEpoch: () => session.epoch },
"@/features/chat": {},
"@/features/model-picker": {},