Skip to content

feat(ui): add playback, subtitles, and downloads - #18

Merged
prateekchaplot merged 2 commits into
mainfrom
arch/tts/t3.2
Nov 21, 2026
Merged

prateekchaplot merged 2 commits into
mainfrom
arch/tts/t3.2

Conversation

@prateekchaplot

Copy link
Copy Markdown
Owner

Task T3.2 from docs/ARCHITECTURE.md section 14.2 (refs sections 10.3, 12; AC8-AC10 contract-level in mock).

What changed

  • hooks/usePlayback.ts: callback-ref audio binding, rAF highlight loop, exported binary search ( indActiveWordIndex), cue-to-word mapping, seek/clamp, Space + arrow shortcuts logic.
  • PlaybackPanel.tsx: ready-state rendering (including succeeded-without-audio), audio controls, +-5 s buttons, duration/aligned-ratio metadata, keyboard hints, embeds subtitle view and download bar.
  • SubtitleView.tsx: active-word highlight with scroll-into-view, click-to-seek words, unaligned-word styling, sentence cue buttons.
  • DownloadBar.tsx: WAV/SRT/VTT downloads named with the section 9.2 rule (client rebuild, since Content-Disposition is unreadable via fetch).
  • App.tsx renders the panel (T3.1 placeholder hand-off); additive styles.

Verification

  • 83 Vitest (32 new), ESLint, \ sc --noEmit, Prettier (CRLF), live + mock Vite builds.
  • Temporary mock-mode Chromium run (not committed): 13/13 checks - highlight advances and pauses, word click seeks, cue click seeks to its first word, ArrowRight +5 s, Space toggles, ended clears highlight, three downloads named \one-two-three-four-five-six_YYYYMMDD-HHMMSS.{wav,srt,vtt}\ with valid RIFF/WEBVTT/SRT content.
  • 196 unit + 16 integration pytest, Ruff check/format, strict mypy, \git diff --check.

Notes

  • Word spans are mouse-only seek targets; cue buttons and shortcuts carry keyboard seeking (recorded for T4.2 to revisit).
  • Tracker updated with T3.2 Doing + decisions; task stays Doing until this PR merges.

PlaybackPanel renders the ready state and embeds SubtitleView (active-word highlight, click-to-seek, cue list) and DownloadBar (WAV/SRT/VTT with the API's download naming). usePlayback owns the audio ref, rAF highlight loop, binary search, seeking, and Space/arrow shortcuts.
@prateekchaplot
prateekchaplot merged commit a291da1 into main Nov 21, 2026
5 checks passed
@prateekchaplot
prateekchaplot deleted the arch/tts/t3.2 branch November 21, 2026 05:06
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.

1 participant