Transcript Result Viewer
Relevant source files
The following files were used as context for generating this wiki page:
The Transcript Result Viewer is the primary detail interface within MacParakeet for inspecting, managing, and interacting with finalized transcriptions. It serves as a centralized hub that integrates localized speech-to-text results with multimedia playback, AI-driven analysis, and multi-format export capabilities.
The viewer is designed to be adaptive, automatically adjusting its layout based on the media source (audio vs. video) and providing a tabbed interface for navigating between the raw transcript, summarized insights, and interactive chat. It bridges the gap between raw data capture and actionable content by allowing users to refine text, identify speakers, and generate structured summaries through integrated LLM providers.
Sources: spec/00-vision.md:129-145, plans/completed/2026-03-video-player-and-transcription-ui-revamp.md:10-25
Adaptive Layout Architecture
The Viewer employs an adaptive layout strategy that pivots based on the PlaybackMode of the transcription. This ensures optimal use of screen real estate depending on whether the source was a video (e.g., YouTube, .mp4) or an audio-only file.
Playback Modes
The system detects three distinct states to drive the UI:
- Video Mode: Triggered by YouTube URLs or local video files. It utilizes a split-pane layout (40% video player, 60% tabbed content).
- Audio Mode: Triggered by local audio files. It features a full-width content area with a compact horizontal scrubber bar (approx. 44px height) at the top.
- No Media: A fallback state used when source files are missing or deleted, rendering full-width content without playback controls.
Sources: plans/completed/2026-03-video-player-and-transcription-ui-revamp.md:214-232, plans/completed/2026-03-video-player-and-transcription-ui-revamp.md:255-285
Layout Component Flow
The following diagram illustrates how the viewer determines and renders the appropriate layout:
Core View Components
Tabbed Content Interface
The right-hand (or full-width) pane is organized into three primary functional tabs:
| Tab | Functionality | Key Features |
|---|---|---|
| Transcript | Displays the speaker-labeled text. | Clickable timestamps, active segment highlighting, and speaker renaming. |
| Summary | AI-generated structured summaries. | Prompt dropdown selection, multi-summary collapsible cards, and custom instructions. |
| Chat | Interactive LLM interaction. | Context-aware Q&A based on the specific transcript content. |
Sources: plans/completed/2026-03-video-player-and-transcription-ui-revamp.md:38-42, plans/completed/2026-04-prompt-library-multi-summary.md:162-178
Multimedia Synchronization
Synchronization is maintained between the media player and the transcript text using a shared currentTimeMs property.
- Highlighting: The transcript segment where
startMs <= currentTimeMs < endMsreceives a highlighted background. - Seeking: Timestamp labels in the transcript and interactive chips in the Chat tab act as buttons that trigger
viewModel.seek(toMs:)in the media player.
Sources: plans/completed/2026-03-video-player-and-transcription-ui-revamp.md:300-320
AI Summary & Prompt Integration
The Summary tab within the Viewer allows for generating multiple different summaries for a single transcription using the Prompt Library.
Multi-Summary Management
Users can select from built-in prompts or create custom ones to reshape the transcript data.
- Prompt Snapshots: When a summary is generated, a snapshot of the prompt name and content is saved with the summary to ensure the result remains valid even if the library prompt is later edited.
- Collapsible Cards: Each generated summary is displayed as a card showing the prompt name, a timestamp, and the Markdown-rendered content.
Sources: plans/completed/2026-04-prompt-library-multi-summary.md:14-22, plans/completed/2026-04-prompt-library-multi-summary.md:168-176
Built-in Prompt Categories
Built-in prompts provide specialized analysis for different use cases:
- General Summary: Captures key points, decisions, and action items.
- Action Items: Extracts concrete commitments and owners.
- Chapter Breakdown: Segments the transcript into logical chapters with titles.
- Study Guide: Transforms the text into a learning resource with concepts and review questions.
Sources: Sources/MacParakeetCore/Models/Prompt.swift:150-250
Speaker Diarization & Management
The viewer supports speaker attribution and management when diarization data is present.
Diarization Data Flow
Speaker information is stored using stable raw IDs (e.g., "S1", "S2") to facilitate efficient management.
Speaker Analytics
The Viewer provides an analytics panel summarizing speaker engagement:
- Speaking Time: Calculated from raw
diarizationSegmentsto ensure accuracy. - Word Count: Grouped by speaker ID from the
wordTimestamps. - Rename Capability: Renaming a speaker in the UI updates the label mapping globally for that transcription without requiring a rewrite of the individual word timestamps.
Sources: plans/completed/2026-03-speaker-diarization.md:132-145
Export and Distribution
The Transcript Result Viewer provides an action bar for exporting content into various industry-standard formats.
| Format | Purpose | Details |
|---|---|---|
| SRT/VTT | Subtitles | Cues are automatically split on speaker changes, punctuation, or long pauses (>800ms). |
| Markdown | Documentation | Includes metadata (duration, source URL) and speaker-labeled paragraphs. |
| PDF/DOCX | Presentation | Rich text exports utilizing NSTextStorage and NSLayoutManager for high-fidelity pagination. |
| JSON | Automation | Full data structure including timestamps, speaker mapping, and segments. |
Sources: Sources/MacParakeetCore/Services/ExportService.swift:50-135, Sources/MacParakeetCore/Services/ExportService.swift:204-260
Summary
The Transcript Result Viewer acts as the definitive interface for content generated within MacParakeet. By combining adaptive multimedia playback with specialized AI processing and speaker management, it transforms raw speech data into structured, navigable, and exportable assets. Its design emphasizes speed and privacy, ensuring that all interactions, from playback sync to diarization management, occur locally on the user's device.