From 727107323cfc86bafce79b6b8d233334dce10abe Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 20 Mar 2026 22:20:20 -0700 Subject: [PATCH] Fix transcript text edit not showing after Enter The display renders segment.words (not segment.text), so editing the text field alone had no visible effect. Now finishEditing() rebuilds the words array from the edited text so the change is immediately visible. Co-Authored-By: Claude Opus 4.6 (1M context) --- src/lib/components/TranscriptEditor.svelte | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/lib/components/TranscriptEditor.svelte b/src/lib/components/TranscriptEditor.svelte index 285a6f9..e2e3bf4 100644 --- a/src/lib/components/TranscriptEditor.svelte +++ b/src/lib/components/TranscriptEditor.svelte @@ -60,12 +60,25 @@ function finishEditing(segmentId: string) { const trimmed = editText.trim(); if (trimmed) { - // Update the segment text in the store + // Update the segment text and rebuild words from the edited text. + // The display renders segment.words, so we must update them too. segments.update(segs => segs.map(s => { if (s.id !== segmentId) return s; + // Rebuild words from the edited text, preserving timing from the + // original segment boundaries (individual word timing is lost on edit) + const newWords = trimmed.split(/\s+/).map((word, widx) => ({ + id: `${s.id}-word-${widx}`, + segment_id: s.id, + word, + start_ms: s.start_ms, + end_ms: s.end_ms, + confidence: 1.0, + word_index: widx, + })); return { ...s, text: trimmed, + words: newWords, original_text: s.original_text ?? s.text, is_edited: true, edited_at: new Date().toISOString(),