## ADDED Requirements ### Requirement: Editable Transcript Segments The frontend SHALL display transcribed text as individually editable segments that can be modified without disrupting ongoing transcription. #### Scenario: Display new segment - **WHEN** a new transcription segment is received from sidecar - **THEN** a new editable text block SHALL appear in the transcript area - **AND** the block SHALL be visually distinct (e.g., border, background) - **AND** the block SHALL be immediately editable #### Scenario: Edit existing segment - **WHEN** user modifies text in a segment - **THEN** only that segment's local data SHALL be updated - **AND** new incoming segments SHALL continue to append below - **AND** the edited segment SHALL show an "edited" indicator #### Scenario: Save merged transcript - **WHEN** user clicks Save button - **THEN** all segments (edited and unedited) SHALL be concatenated in order - **AND** the merged text SHALL be saved as transcript_blob ### Requirement: Real-time Streaming UI The frontend SHALL provide clear visual feedback during streaming transcription. #### Scenario: Recording active indicator - **WHEN** streaming recording is active - **THEN** a pulsing recording indicator SHALL be visible - **AND** the current/active segment SHALL have distinct styling (e.g., highlighted border) - **AND** the Start Recording button SHALL change to Stop Recording #### Scenario: Processing indicator - **WHEN** audio is being processed but no text has appeared yet - **THEN** a "Processing..." indicator SHALL appear in the active segment area - **AND** the indicator SHALL disappear when text arrives #### Scenario: Streaming status display - **WHEN** streaming session is active - **THEN** the UI SHALL display segment count (e.g., "Segment 5/5") - **AND** total recording duration ### Requirement: Audio Streaming IPC The Electron main process SHALL provide IPC handlers for continuous audio streaming between renderer and sidecar. #### Scenario: Start streaming - **WHEN** renderer calls `startRecordingStream()` - **THEN** main process SHALL send start_stream command to sidecar - **AND** return session confirmation to renderer #### Scenario: Stream audio data - **WHEN** renderer sends audio chunk via `streamAudioChunk(arrayBuffer)` - **THEN** main process SHALL convert WebM to PCM if needed - **AND** forward to sidecar stdin as base64-encoded audio_chunk command #### Scenario: Receive transcription - **WHEN** sidecar emits a segment result on stdout - **THEN** main process SHALL parse the JSON - **AND** forward to renderer via `transcription-segment` IPC event