Skip to content

feat(captions): generate auto-captions as styled subtitles#23

Merged
joaothaira merged 3 commits into
mainfrom
feat/captions-to-subtitles
Jun 11, 2026
Merged

feat(captions): generate auto-captions as styled subtitles#23
joaothaira merged 3 commits into
mainfrom
feat/captions-to-subtitles

Conversation

@ThairaHub

Copy link
Copy Markdown
Collaborator

Stacked on #22 (whisper-small + language selector) — merge that first; this PR's base is its branch and can be retargeted to main after.

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

  • captionSegmentsToSubtitleItems in the captioning lib — same grouping/dedupe/finalize chain as the annotation converter, emitting SubtitleItem[]. Timeline-gap reconciliation skipped: subtitles render one at a time in a fixed slot, so flush blocks aren't an issue.
  • “Caption style” selector in the auto-captions dialog: Styled subtitles (templates) — default — or Text annotations (upstream's original behavior, kept).
  • Subtitle output replaces subtitleRegions and enables showSubtitles (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-subtitles IPC 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

ThairaHub and others added 3 commits June 11, 2026 16:54
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>
Base automatically changed from feat/caption-model-small-language to main June 11, 2026 20:55
@joaothaira joaothaira merged commit 96a82b9 into main Jun 11, 2026
@joaothaira joaothaira deleted the feat/captions-to-subtitles branch June 11, 2026 20:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants