feat(captions): generate auto-captions as styled subtitles#23
Merged
Conversation
Auto-captions previously always became plain text annotations (fixed white Inter style). The editor already has a styled-subtitle system (SubtitleOverlay with classic/minimal/bold/boxed/cinematic templates) that renders in preview and export — wire the caption pipeline to it. - captionSegmentsToSubtitleItems: same grouping/dedupe/finalize chain as the annotation converter, emitting SubtitleItem[]; timeline-gap reconciliation skipped (subtitles render serially in a fixed slot). - 'Caption style' selector in the auto-captions dialog: styled subtitles (default) or the original text annotations. - Subtitle generation replaces existing subtitleRegions (a generation describes the whole video), matching the sidebar generator. With this, the in-app pipeline covers the Electron subtitle script's remaining advantage; the script and generate-subtitles IPC are now candidates for retirement. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Styled subtitles had no timeline presence — only the Enterprise sidebar — while caption-annotations share the annotation lane with images, arrows, captions and markers, so a subtitle and an arrow at the same time fight for the same row. - Subtitle lane (teal) under the annotation row; renders only when subtitles exist since they're created by the generators, not drawn. - Items show a text preview, drag/resize routes through onSubtitleSpanChange, Delete/Backspace removes the selected one. - Subtitles join the soft-snap span set (edges attract, never push). - Selection is mutually exclusive with the other lanes; stale selection clears when regions vanish (undo/regenerate). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Selecting a subtitle on the timeline lane switches the sidebar to the Enterprise tab, expands the Subtitles section, scrolls the selected line into view, focuses its textarea, and highlights it teal — so the text is one click away from editing. Sidebar Tabs and the panel Accordion become controlled components so timeline selection can drive them; manual open/close behavior is unchanged. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #22 (whisper-small + language selector) — merge that first; this PR's base is its branch and can be retargeted to
mainafter.Closes the last gap between the two caption stacks: transcription output can now land in the fork's styled subtitle system (SubtitleOverlay templates: classic / minimal / bold / boxed / cinematic, rendered in preview and export) instead of plain text annotations.
Changes
captionSegmentsToSubtitleItemsin the captioning lib — same grouping/dedupe/finalize chain as the annotation converter, emittingSubtitleItem[]. Timeline-gap reconciliation skipped: subtitles render one at a time in a fixed slot, so flush blocks aren't an issue.subtitleRegionsand enablesshowSubtitles(a generation describes the whole video — same semantics as the sidebar generator).Consequence
The in-app pipeline now has: accurate model (#22), timeline button UX, packaged-app support, and the styled templates. The Electron-side
extract-subtitles.mjs+generate-subtitlesIPC no longer have a unique advantage — retiring them is a follow-up decision.Verification
tsc 0 errors · biome clean · vitest 225/225 · i18n-check 12 locales · vite build OK
🤖 Generated with Claude Code