Persist segment text edits to database on Enter
- Add update_segment Tauri command (calls existing update_segment_text query) - Wire onTextEdit handler from TranscriptEditor to invoke update_segment - Edits are saved to SQLite immediately when user presses Enter Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -188,6 +188,14 @@
|
||||
waveformPlayer?.seekTo(timeMs);
|
||||
}
|
||||
|
||||
async function handleTextEdit(segmentId: string, newText: string) {
|
||||
try {
|
||||
await invoke('update_segment', { segmentId, newText });
|
||||
} catch (err) {
|
||||
console.error('Failed to save segment edit:', err);
|
||||
}
|
||||
}
|
||||
|
||||
async function handleFileImport() {
|
||||
const filePath = await open({
|
||||
multiple: false,
|
||||
@@ -512,7 +520,7 @@
|
||||
<div class="workspace">
|
||||
<div class="main-content">
|
||||
<WaveformPlayer bind:this={waveformPlayer} {audioUrl} />
|
||||
<TranscriptEditor onWordClick={handleWordClick} />
|
||||
<TranscriptEditor onWordClick={handleWordClick} onTextEdit={handleTextEdit} />
|
||||
</div>
|
||||
<div class="sidebar-right">
|
||||
<SpeakerManager />
|
||||
|
||||
Reference in New Issue
Block a user