Skip to content

feat: inline caption editing in the preview - #24

Merged
Alfredoalv13 merged 1 commit into
mainfrom
feat/inline-caption-editing
Jul 25, 2026
Merged

feat: inline caption editing in the preview#24
Alfredoalv13 merged 1 commit into
mainfrom
feat/inline-caption-editing

Conversation

@Alfredoalv13

Copy link
Copy Markdown
Owner

Summary

  • Wires up the previously-unused inline caption editing engine (captionEditing.tsupdateCaptionCuesForEditedTarget, CaptionEditTarget) to real UI. It had full logic and test coverage but nothing in the app called it.
  • Double-clicking the caption box in the editor preview enters an editable state: a textarea pre-filled with the visible caption block's text, auto-focused and selected.
  • Enter commits (Shift+Enter inserts a newline), Escape or blur cancels.
  • Playback auto-pauses when entering edit mode so the caption block being edited can't scroll out from under the textarea mid-edit.
  • If the visible caption block changes out from under an open edit (e.g. a stray seek), the edit is safely dropped rather than committing against a stale target.

Test plan

  • npx tsc -p tsconfig.json --noEmit — clean
  • npx vitest --run — 819/819 passing
  • Built, signed, and ran the packaged app directly with a real generated caption (real Whisper transcription on an existing recording)
  • Double-clicked the caption box — textarea appeared pre-filled with the exact caption text, auto-focused
  • Edited the text and pressed Enter — committed immediately, new text rendered in the preview
  • Re-opened edit mode, typed a different draft, pressed Escape — draft discarded, prior committed text remained (not the escaped draft)

Double-clicking the caption box in the editor preview now enters an
editable state: a textarea pre-filled with the visible caption block's
text appears in place of the read-only word spans, auto-focused with the
text selected. Enter commits (Shift+Enter for a newline), Escape or blur
cancels. Playback pauses automatically on entering edit mode so the
underlying caption block can't scroll out from under the edit.

This wires up updateCaptionCuesForEditedTarget/CaptionEditTarget in
captionEditing.ts, which already had full logic and test coverage for
redistributing word timing across the edited text (including edits that
span multiple cues) but had no UI calling it.

Verified live against a packaged build: double-click enters edit mode with
the correct pre-filled text, Enter commits and the new text renders
immediately, Escape discards the draft and restores the prior text.
@Alfredoalv13
Alfredoalv13 merged commit e923854 into main Jul 25, 2026
1 check passed
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