Open source CapCut alternative.
TypeScript
fix(site): badge the Audio tab only for its own generations, not chat voiceovers
David Lede9583b71aec
diff --git a/site/src/cut/components/AudioPanel.tsx b/site/src/cut/components/AudioPanel.tsxindex 52155ad6..af7f660f 100644--- a/site/src/cut/components/AudioPanel.tsx+++ b/site/src/cut/components/AudioPanel.tsx@@ -157,6 +157,11 @@ function VoiceGenerator({ projectId }: { projectId: string }) {language,name: `AI voice — ${lead}`,});+ // The Audio tab is the only surface that badges its own rail icon: a+ // voiceover the user generated here, finishing while they stepped away,+ // rides a count. Chat- and scene-made voiceovers never badge — the chat+ // card is their indicator. (landed() no-ops while this tab is watched.)+ useGenNotify.getState().landed("audio", asset.id);const cur = useEditor.getState();cur.addAsset(asset);cur.addAudioFromAsset(asset.id, playhead, {diff --git a/site/src/cut/lib/tts.ts b/site/src/cut/lib/tts.tsindex a19c7e87..df10c69f 100644--- a/site/src/cut/lib/tts.ts+++ b/site/src/cut/lib/tts.ts@@ -3,7 +3,6 @@import { geminiModels } from "@/lib/inference/gemini-models";import { bytesFromBase64 } from "./bytes";import { hostedPost } from "./hosted";-import { useGenNotify } from "./genNotify";import { importFileToProject } from "./media";import type { MediaAsset } from "./types";import {@@ -440,9 +439,10 @@ export async function speechClipToAsset(asset.name = label;asset.origin = "voiceover";if (language) asset.language = language;- // Every committed voiceover funnels through here (the panel, the subtitles- // readout, the AI tool), so this is where a finished one gets its badge.- useGenNotify.getState().landed("audio", asset.id);+ // No Audio-tab badge here: this is the shared commit path (the panel, the+ // subtitles readout, the chat tools, the scene narration). Only the Audio+ // panel's own generator badges its tab — a chat- or run-made voiceover is+ // announced in the chat, never on the tab. The panel calls landed() itself.return asset;}