diff --git a/components/ExportDialog.tsx b/components/ExportDialog.tsx index 7023f95..abe97bc 100644 --- a/components/ExportDialog.tsx +++ b/components/ExportDialog.tsx @@ -113,6 +113,7 @@ export default function ExportDialog() { const [textFormat, setTextFormat] = useState("txt"); const [includeTimestamps, setIncludeTimestamps] = useState(false); const [shortCues, setShortCues] = useState(true); + const [speakerLabels, setSpeakerLabels] = useState(true); const [timelineFormat, setTimelineFormat] = useState("resolve"); const [timelineFrameRate, setTimelineFrameRate] = @@ -273,6 +274,7 @@ export default function ExportDialog() { const textSupportsTimestamps = DOC_FORMATS.has(textFormat); const textSupportsShortCues = SUBTITLE_FORMATS.has(textFormat); + const textSupportsSpeakerLabels = textFormat !== "json"; const exportText = useCallback(() => { // Read live store state at click time so a rename / replace-in-project @@ -287,6 +289,7 @@ export default function ExportDialog() { speakers: speakersFromWords(s.words, s.speakers), ...(textSupportsTimestamps ? { timestamps: includeTimestamps } : {}), ...(textSupportsShortCues ? { shortCues } : {}), + ...(textSupportsSpeakerLabels ? { speakerLabels } : {}), }); setError(null); trackEvent("export_completed", { @@ -294,6 +297,7 @@ export default function ExportDialog() { format: textFormat, ...(textSupportsTimestamps ? { timestamps: includeTimestamps } : {}), ...(textSupportsShortCues ? { shortCues } : {}), + ...(textSupportsSpeakerLabels ? { speakerLabels } : {}), }); } catch (err) { setError(err instanceof Error ? err.message : en["error.export"]); @@ -302,8 +306,10 @@ export default function ExportDialog() { textFormat, textSupportsTimestamps, textSupportsShortCues, + textSupportsSpeakerLabels, includeTimestamps, shortCues, + speakerLabels, baseName, ]); @@ -514,6 +520,17 @@ export default function ExportDialog() { {t("export.includeTimestamps")} )} + {textSupportsSpeakerLabels && ( + + )} {textSupportsShortCues && (