diff --git a/src/exportHandler/exportHandler.ts b/src/exportHandler/exportHandler.ts index 30884e550..7d197a537 100644 --- a/src/exportHandler/exportHandler.ts +++ b/src/exportHandler/exportHandler.ts @@ -255,6 +255,7 @@ export interface ExportOptions { removeIds?: boolean; includeAudio?: boolean; includeTimestamps?: boolean; + excludeLabels?: boolean; /** Per-file 0-based milestone indices to include when exporting audio. An empty array skips that file entirely. Files omitted from this map are exported in full (no milestone step). */ selectedMilestonesByFile?: Record; } @@ -2066,8 +2067,15 @@ export const exportCodexContentAsSubtitlesVtt = async ( totalCells += cells.length; debug(`File has ${cells.length} active cells`); - const vttContent = generateVttData(cells, includeStyles, cueSplitting, file.fsPath); - debug({ vttContent, cells, includeStyles }); + // Generate VTT content + const vttContent = generateVttData( + cells, + includeStyles, + cueSplitting, + file.fsPath, + options?.excludeLabels === true + ); + debug({ vttContent, cells, includeStyles }); const timestamp = new Date().toISOString().replace(/[:.]/g, "-"); const fileName = basename(file.fsPath).replace(".codex", "") || "unknown"; diff --git a/src/exportHandler/vttUtils.ts b/src/exportHandler/vttUtils.ts index bd7e3fdf7..04c5b1d00 100644 --- a/src/exportHandler/vttUtils.ts +++ b/src/exportHandler/vttUtils.ts @@ -71,7 +71,8 @@ export const generateVttData = ( cells: CodexNotebookAsJSONData["cells"], includeStyles: boolean, cueSplitting: boolean, - filePath: string + filePath: string, + excludeLabels: boolean = false ): string => { if (!cells.length) return ""; @@ -95,7 +96,7 @@ export const generateVttData = ( const text = includeStyles ? processVttContent(unit.value) : removeHtmlTags(unit.value); const finalText = ensureDialogueLineBreaks(text); - const rawLabel = unit.metadata?.cellLabel?.trim(); + const rawLabel = excludeLabels ? undefined : unit.metadata?.cellLabel?.trim(); const payload = rawLabel ? `${finalText}` : finalText; diff --git a/src/projectManager/projectExportView.ts b/src/projectManager/projectExportView.ts index 0e65c5d71..512d9f6cb 100644 --- a/src/projectManager/projectExportView.ts +++ b/src/projectManager/projectExportView.ts @@ -696,6 +696,21 @@ function getWebviewContent( .format-option-row[data-option].hidden { display: none !important; } .format-option p, .format-option-content p { line-height: 1.45; margin: 4px 0 0 0; } .format-option-content { display: flex; flex-direction: column; gap: 4px; } + .format-option-toggle { + display: flex; + align-items: center; + gap: 6px; + font-size: 0.9em; + color: var(--vscode-descriptionForeground); + cursor: pointer; + user-select: none; + } + .format-option-toggle input[type="checkbox"] { margin: 0; cursor: pointer; } + .format-section-suboption { + padding: 10px 12px; + background-color: var(--vscode-editor-background); + border-top: 1px solid var(--vscode-input-border); + } .format-tag { display: inline-block; padding: 1px 4px; @@ -1248,6 +1263,12 @@ function getWebviewContent( +
+ +
@@ -2954,6 +2975,10 @@ function getWebviewContent( options.includeAudio = true; options.includeTimestamps = selectedAudioMode === 'audio-timestamps'; } + if (selectedFormat && selectedFormat.startsWith('subtitles-vtt-')) { + const cb = document.getElementById('vttExcludeLabelsCb'); + if (cb && cb.checked) options.excludeLabels = true; + } const selectedMilestones = buildSelectedMilestonesPayload(); if (selectedMilestones) { options.selectedMilestonesByFile = selectedMilestones; diff --git a/src/providers/codexCellEditorProvider/codexCellEditorMessagehandling.ts b/src/providers/codexCellEditorProvider/codexCellEditorMessagehandling.ts index 39a560b99..b0312d062 100644 --- a/src/providers/codexCellEditorProvider/codexCellEditorMessagehandling.ts +++ b/src/providers/codexCellEditorProvider/codexCellEditorMessagehandling.ts @@ -1483,10 +1483,10 @@ const messageHandlers: Record Promise MAX_BYTES) { - throw new Error("Video file exceeds maximum allowed size (500 MB)"); + throw new Error("Video file exceeds maximum allowed size 900 MB)"); } // Determine document segment