feat #14740: language picker before transcribing

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
hauke
2026-11-18 11:39:41 +01:00
co-authored by Claude Opus 5.5
parent 48000f47eb
commit 9e53d0b390
6 changed files with 52 additions and 12 deletions
+9 -2
View File
@@ -28,6 +28,7 @@
} from '../lib/api'
import CallList from '../lib/CallList.svelte'
import { formatDateTime, formatDetailTime, formatMinutes } from '../lib/format'
import LanguageSelect from '../lib/LanguageSelect.svelte'
import Player from '../lib/Player.svelte'
import { segmentAt } from '../lib/playback'
import StatusPill from '../lib/StatusPill.svelte'
@@ -45,6 +46,8 @@
let selectedId = $state<CallId | null>(null)
let detail = $state<CallDetail | null>(null)
let detailError = $state('')
/** The language picked for the shown call's transcription. */
let language = $state('de')
let actionError = $state('')
let busy = $state(false)
@@ -109,6 +112,8 @@
try {
const next = await getCall(id)
if (request === detailRequest && id === selectedId) {
// A refresh of the same call keeps what the user picked.
if (next.call.id !== detail?.call.id) language = next.language
detail = next
detailError = ''
}
@@ -219,8 +224,8 @@
}
}
const transcribe = () => run(transcribeCall)
const retry = () => run(retryCall)
const transcribe = () => run((id) => transcribeCall(id, language))
const retry = () => run((id) => retryCall(id, language))
const discard = () =>
run(discardCall, () => {
clearSelection()
@@ -466,9 +471,11 @@
{/if}
<span class="actions">
{#if call.status === 'awaiting_decision'}
<LanguageSelect bind:value={language} disabled={busy} />
<button class="btn primary" disabled={busy} onclick={transcribe}>Transkribieren</button>
<button class="btn danger" disabled={busy} onclick={discard}>Verwerfen</button>
{:else if call.status === 'failed'}
<LanguageSelect bind:value={language} disabled={busy} />
<button class="btn primary" disabled={busy} onclick={retry}>Erneut versuchen</button>
<button class="btn danger" disabled={busy} onclick={discard}>Verwerfen</button>
{:else if call.status === 'done'}
+11 -2
View File
@@ -11,13 +11,19 @@
type PendingPrompt,
} from '../lib/api'
import { formatMinutes, formatTimeRange } from '../lib/format'
import LanguageSelect from '../lib/LanguageSelect.svelte'
let brief = $state<PendingPrompt | null>(null)
let busy = $state(false)
let error = $state('')
let language = $state('de')
function show(next: PendingPrompt | null) {
if (next?.id !== brief?.id) error = ''
// A refresh of the same call keeps what the user picked.
if (next?.id !== brief?.id) {
error = ''
if (next) language = next.language
}
brief = next
}
@@ -54,6 +60,8 @@
busy = false
}
}
const transcribe = () => run((id) => transcribeCall(id, language))
</script>
<main class="prompt">
@@ -64,7 +72,8 @@
<div class="muted">Weitere Gespräche warten: {brief.more_waiting}</div>
{/if}
<div class="actions">
<button class="btn primary" disabled={busy} onclick={() => run(transcribeCall)}>
<LanguageSelect bind:value={language} disabled={busy} />
<button class="btn primary" disabled={busy} onclick={transcribe}>
Transkribieren
</button>
<button class="btn danger" disabled={busy} onclick={() => run(discardCall)}>Verwerfen</button>
-5
View File
@@ -482,11 +482,6 @@
<section class="card">
<h2>Allgemein</h2>
<div class="grid">
<label for="language">Sprache der Gespräche</label>
<select id="language" bind:value={settings.language}>
<option value="de">Deutsch</option>
<option value="en">Englisch</option>
</select>
<label for="retention">Aufbewahrung der Audiodateien</label>
<span><input id="retention" type="number" min="1" max="3650" bind:value={settings.retention_days} /> Tage</span>
<span></span>