Speakr is a personal, self-hosted web application designed for transcribing audio recordings
Python
refactor: one parameterized shared template for advanced ASR options in the upload dialog and recorder (Jinja with-vars render each surface's own refs, preserving freeze-at-queue semantics), and the recorder gains the transcription model override plumbed through queue, finalize and crash recovery
Murtaza Nasir2d0d18c92ada
diff --git a/static/js/app.modular.js b/static/js/app.modular.jsindex 7e7c57ce..c1833a8a 100644--- a/static/js/app.modular.js+++ b/static/js/app.modular.js@@ -526,6 +526,7 @@ document.addEventListener('DOMContentLoaded', async () => {// the upload UI state changes.const asrInitialPrompt = ref('');const asrHotwords = ref('');+ const asrTranscriptionModel = ref(''); // Per-recording model override (#266 parity with upload)const audioContext = ref(null);const analyser = ref(null);const micAnalyser = ref(null);@@ -1771,7 +1772,7 @@ document.addEventListener('DOMContentLoaded', async () => {recordSystemVideo, recordingVideoActive,inputAudioDevices, selectedMicDeviceId, selectedSecondaryDeviceId, refreshInputAudioDevices,platformInfo, audioCaps, helpModalOsTab, virtualAudioDevices, refreshVirtualAudioDevices,- asrLanguage, asrMinSpeakers, asrMaxSpeakers,+ asrLanguage, asrMinSpeakers, asrMaxSpeakers, asrTranscriptionModel,asrInitialPrompt, asrHotwords, applyInitialPromptTemplateToRecording,audioContext, analyser, micAnalyser, systemAnalyser, visualizer, micVisualizer,systemVisualizer, animationFrameId, recordingMode, activeStreams,diff --git a/static/js/modules/composables/audio.js b/static/js/modules/composables/audio.jsindex 94c0d294..a4f9e0c3 100644--- a/static/js/modules/composables/audio.js+++ b/static/js/modules/composables/audio.js@@ -58,7 +58,7 @@ export function useAudio(state, utils) {isDarkMode, wakeLock, animationFrameId,activeStreams, visualizer, micVisualizer, systemVisualizer, canRecordAudio,canRecordSystemAudio, systemAudioSupported, systemAudioError, globalError,- selectedTagIds, selectedFolderId, asrLanguage, asrMinSpeakers, asrMaxSpeakers, asrInitialPrompt, asrHotwords, uploadQueue,+ selectedTagIds, selectedFolderId, asrLanguage, asrMinSpeakers, asrMaxSpeakers, asrInitialPrompt, asrHotwords, asrTranscriptionModel, uploadQueue,progressPopupMinimized, progressPopupClosed,// Incognito modeenableIncognitoMode, incognitoMode, incognitoRecording, incognitoProcessing,@@ -912,7 +912,8 @@ export function useAudio(state, utils) {min_speakers: asrMinSpeakers.value || '',max_speakers: asrMaxSpeakers.value || '',initial_prompt: asrInitialPrompt.value || '',- hotwords: asrHotwords.value || ''+ hotwords: asrHotwords.value || '',+ transcription_model: asrTranscriptionModel.value || ''},mimeType,incognito: !!(incognitoMode && incognitoMode.value)@@ -1264,6 +1265,7 @@ export function useAudio(state, utils) {max_speakers: asrMaxSpeakers.value || null,initial_prompt: asrInitialPrompt.value || null,hotwords: asrHotwords.value || null,+ transcription_model: asrTranscriptionModel.value || null,};if (mergeIntent) {metadata.merge_intent = mergeIntent;@@ -1332,7 +1334,8 @@ export function useAudio(state, utils) {min_speakers: asrMinSpeakers.value,max_speakers: asrMaxSpeakers.value,initial_prompt: asrInitialPrompt.value,- hotwords: asrHotwords.value+ hotwords: asrHotwords.value,+ transcription_model: asrTranscriptionModel.value},status: 'queued',recordingId: null,@@ -1361,6 +1364,7 @@ export function useAudio(state, utils) {asrMaxSpeakers.value = '';asrInitialPrompt.value = '';asrHotwords.value = '';+ asrTranscriptionModel.value = '';await releaseWakeLock();await hideRecordingNotification();@@ -1638,6 +1642,7 @@ export function useAudio(state, utils) {asrMaxSpeakers.value = '';asrInitialPrompt.value = '';asrHotwords.value = '';+ asrTranscriptionModel.value = '';// If a server-side session was open (Phase B of #287 c/d), abort it// so the chunks on disk are reaped immediately rather than waiting@@ -1833,6 +1838,7 @@ export function useAudio(state, utils) {asrMaxSpeakers.value = recovered.metadata.asrOptions.max_speakers || '';asrInitialPrompt.value = recovered.metadata.asrOptions.initial_prompt || '';asrHotwords.value = recovered.metadata.asrOptions.hotwords || '';+ asrTranscriptionModel.value = recovered.metadata.asrOptions.transcription_model || '';}// Restore the incognito state the recording was left in, so adiff --git a/templates/components/recording-view.html b/templates/components/recording-view.htmlindex 999f0cb2..45924bee 100644--- a/templates/components/recording-view.html+++ b/templates/components/recording-view.html@@ -177,90 +177,12 @@</button><div v-if="showAdvancedOptions" class="mt-2 p-3 bg-[var(--bg-tertiary)] rounded-md border border-[var(--border-secondary)] space-y-3">- <!-- Prompt & hotwords sub-card: same grouping as the upload- modal — the saved-template dropdown fills BOTH fields. -->- <div v-if="connectorSupportsInitialPrompt || connectorSupportsHotwords"- class="rounded-md border border-[var(--border-secondary)] bg-[var(--bg-secondary)] p-3 space-y-3">- <div v-if="initialPromptTemplates && initialPromptTemplates.length">- <label class="block text-xs font-medium text-[var(--text-secondary)] mb-1">- ${ t('initialPromptTemplates.savedTemplate') }- </label>- <select @change="applyInitialPromptTemplateToRecording($event.target.value); $event.target.value=''"- class="w-full px-2 py-1 text-xs bg-[var(--bg-primary)] text-[var(--text-primary)] border border-[var(--border-secondary)] rounded-md shadow-sm focus:outline-none focus:ring-1 focus:ring-[var(--ring-focus)]">- <option value="">${ t('initialPromptTemplates.pickPlaceholder') }</option>- <option v-for="tpl in initialPromptTemplates" :key="tpl.id" :value="tpl.id" v-text="tpl.name"></option>- </select>- <p class="text-[10px] text-[var(--text-muted)] mt-0.5">${ t('initialPromptTemplates.savedTemplateHelp') }</p>- </div>-- <div v-if="connectorSupportsInitialPrompt">- <label for="recordingAsrInitialPrompt" class="block text-xs font-medium text-[var(--text-secondary)] mb-1">- ${ t('form.initialPrompt') }- </label>- <textarea id="recordingAsrInitialPrompt" v-model="asrInitialPrompt"- rows="2"- :placeholder="t('form.initialPromptPlaceholder')"- class="w-full px-2 py-1 text-xs bg-[var(--bg-primary)] text-[var(--text-primary)] border border-[var(--border-secondary)] rounded-md shadow-sm focus:outline-none focus:ring-1 focus:ring-[var(--ring-focus)] resize-y"></textarea>- <p class="text-[10px] text-[var(--text-muted)] mt-0.5">${ t('form.initialPromptHelp') }</p>- </div>-- <div v-if="connectorSupportsHotwords">- <label for="recordingAsrHotwords" class="block text-xs font-medium text-[var(--text-secondary)] mb-1">- ${ t('form.hotwords') }- </label>- <input type="text" id="recordingAsrHotwords" v-model="asrHotwords"- :placeholder="t('form.hotwordsPlaceholder')"- class="w-full px-2 py-1 text-xs bg-[var(--bg-primary)] text-[var(--text-primary)] border border-[var(--border-secondary)] rounded-md shadow-sm focus:outline-none focus:ring-1 focus:ring-[var(--ring-focus)]">- <p class="text-[10px] text-[var(--text-muted)] mt-0.5">${ t('form.hotwordsHelp') }</p>- </div>- </div>-- <div class="grid grid-cols-1 sm:grid-cols-2 gap-3">- <div>- <label for="recordingAsrLanguage" class="block text-xs font-medium text-[var(--text-secondary)] mb-1">- ${ t('form.transcriptionLanguage') }- </label>- <select id="recordingAsrLanguage" v-model="asrLanguage"- class="w-full px-2 py-1 bg-[var(--bg-primary)] text-[var(--text-primary)] border border-[var(--border-secondary)] rounded-md shadow-sm focus:outline-none focus:ring-1 focus:ring-[var(--ring-focus)] text-xs">- <option v-for="lang in languageOptions" :key="lang.value" :value="lang.value" v-text="lang.label"></option>- </select>- </div>- </div>-- <!-- Divider between the language row and the speaker controls -->- <hr v-if="connectorSupportsSpeakerCount || connectorSupportsExactSpeakerCount"- class="border-t border-[var(--border-secondary)] my-1">-- <!-- Speaker Settings (#362): one compact row — label,- Range/Exact toggle (range connectors only), narrow- inputs. A single count writes min == max. -->- <div v-if="connectorSupportsSpeakerCount || connectorSupportsExactSpeakerCount"- class="flex flex-wrap items-center gap-x-3 gap-y-1.5">- <label class="text-xs font-medium text-[var(--text-secondary)]" v-text="t('form.speakers')"></label>- <div v-if="connectorSupportsSpeakerCount"- class="inline-flex rounded border border-[var(--border-secondary)] overflow-hidden">- <button type="button" @click="setSpeakerCountMode('range')"- :class="['px-2 py-0.5 text-[10px] transition-colors', !exactSpeakerEntry ? 'bg-[var(--bg-accent)] text-[var(--text-accent)] font-medium' : 'text-[var(--text-muted)] hover:text-[var(--text-secondary)]']"- v-text="t('form.speakerModeRange')"></button>- <button type="button" @click="setSpeakerCountMode('single')"- :class="['px-2 py-0.5 text-[10px] transition-colors border-l border-[var(--border-secondary)]', exactSpeakerEntry ? 'bg-[var(--bg-accent)] text-[var(--text-accent)] font-medium' : 'text-[var(--text-muted)] hover:text-[var(--text-secondary)]']"- v-text="t('form.speakerModeExact')"></button>- </div>- <input v-if="exactSpeakerEntry"- type="number" id="recordingAsrSpeakersExact" v-model.number="asrSpeakersExact"- min="1" max="20"- class="w-20 px-2 py-1 bg-[var(--bg-primary)] text-[var(--text-primary)] border border-[var(--border-secondary)] rounded-md shadow-sm focus:outline-none focus:ring-1 focus:ring-[var(--ring-focus)] text-xs">- <template v-else>- <label for="recordingAsrMinSpeakers" class="text-[11px] text-[var(--text-muted)]" v-text="t('form.minSpeakers')"></label>- <input type="number" id="recordingAsrMinSpeakers" v-model="asrMinSpeakers"- min="1" max="20" :placeholder="t('form.auto')"- class="w-16 px-2 py-1 bg-[var(--bg-primary)] text-[var(--text-primary)] border border-[var(--border-secondary)] rounded-md shadow-sm focus:outline-none focus:ring-1 focus:ring-[var(--ring-focus)] text-xs">- <label for="recordingAsrMaxSpeakers" class="text-[11px] text-[var(--text-muted)]" v-text="t('form.maxSpeakers')"></label>- <input type="number" id="recordingAsrMaxSpeakers" v-model="asrMaxSpeakers"- min="1" max="20" :placeholder="t('form.auto')"- class="w-16 px-2 py-1 bg-[var(--bg-primary)] text-[var(--text-primary)] border border-[var(--border-secondary)] rounded-md shadow-sm focus:outline-none focus:ring-1 focus:ring-[var(--ring-focus)] text-xs">- </template>- </div>+ {% with apply_template_fn='applyInitialPromptTemplateToRecording',+ prompt_ref='asrInitialPrompt', hotwords_ref='asrHotwords',+ model_ref='asrTranscriptionModel', lang_ref='asrLanguage',+ exact_ref='asrSpeakersExact', min_ref='asrMinSpeakers', max_ref='asrMaxSpeakers' %}+ {% include 'components/shared/asr-options.html' %}+ {% endwith %}</div></div>diff --git a/templates/components/shared/asr-options.html b/templates/components/shared/asr-options.htmlnew file mode 100644index 00000000..2c25d516--- /dev/null+++ b/templates/components/shared/asr-options.html@@ -0,0 +1,115 @@+{#+ Shared Advanced ASR / Transcription options for the upload dialog AND the+ recording view (#362 layout, #266 model select). Both render in the same+ Vue app scope but bind DIFFERENT state (the recorder's asr* refs are frozen+ at queue time and survive crash recovery), so the binding names are Jinja+ parameters supplied via {% with %} at each include site:++ apply_template_fn, prompt_ref, hotwords_ref, model_ref, lang_ref,+ exact_ref, min_ref, max_ref++ One source of markup so the two surfaces cannot drift apart.+#}+<!-- Prompt & hotwords sub-card (#309): the saved-template dropdown+ fills BOTH the initial prompt and hotwords, so the three are+ grouped in one bordered card to make that relationship obvious. -->+<div v-if="connectorSupportsInitialPrompt || connectorSupportsHotwords"+ class="rounded-md border border-[var(--border-secondary)] bg-[var(--bg-secondary)] p-3 space-y-3">+ <!-- Saved transcription template: fills the fields below. Hidden+ until the user has saved templates. -->+ <div v-if="initialPromptTemplates && initialPromptTemplates.length">+ <label class="block text-xs font-medium text-[var(--text-secondary)] mb-1">+ ${ t('initialPromptTemplates.savedTemplate') }+ </label>+ <select @change="{{ apply_template_fn }}($event.target.value); $event.target.value=''"+ class="w-full px-2 py-1 text-sm bg-[var(--bg-primary)] text-[var(--text-primary)] border border-[var(--border-primary)] rounded focus:outline-none focus:ring-1 focus:ring-[var(--ring-focus)]">+ <option value="">${ t('initialPromptTemplates.pickPlaceholder') }</option>+ <option v-for="tpl in initialPromptTemplates" :key="tpl.id" :value="tpl.id" v-text="tpl.name"></option>+ </select>+ <p class="text-[10px] text-[var(--text-muted)] mt-0.5">${ t('initialPromptTemplates.savedTemplateHelp') }</p>+ </div>++ <!-- Initial Prompt -->+ <div v-if="connectorSupportsInitialPrompt">+ <label class="block text-xs font-medium text-[var(--text-secondary)] mb-1">+ ${ t('form.initialPrompt') }+ </label>+ <textarea v-model="{{ prompt_ref }}"+ rows="2"+ :placeholder="t('form.initialPromptPlaceholder')"+ class="w-full px-2 py-1 text-sm bg-[var(--bg-primary)] text-[var(--text-primary)] border border-[var(--border-primary)] rounded focus:outline-none focus:ring-1 focus:ring-[var(--ring-focus)] resize-y"></textarea>+ <p class="text-[10px] text-[var(--text-muted)] mt-0.5">${ t('form.initialPromptHelp') }</p>+ </div>++ <!-- Hotwords -->+ <div v-if="connectorSupportsHotwords">+ <label class="block text-xs font-medium text-[var(--text-secondary)] mb-1">+ ${ t('form.hotwords') }+ </label>+ <input v-model="{{ hotwords_ref }}"+ type="text"+ :placeholder="t('form.hotwordsPlaceholder')"+ class="w-full px-2 py-1 text-sm bg-[var(--bg-primary)] text-[var(--text-primary)] border border-[var(--border-primary)] rounded focus:outline-none focus:ring-1 focus:ring-[var(--ring-focus)]">+ <p class="text-[10px] text-[var(--text-muted)] mt-0.5">${ t('form.hotwordsHelp') }</p>+ </div>+</div>++<!-- Model + language share a row: neither needs full modal+ width. The model select (issue #266) renders only when the+ admin exposes at least 2 models. -->+<div class="grid grid-cols-1 sm:grid-cols-2 gap-3">+ <div v-if="transcriptionModelOptions && transcriptionModelOptions.length > 1">+ <label class="block text-xs font-medium text-[var(--text-secondary)] mb-1">+ ${ t('form.transcriptionModel') }+ </label>+ <select v-model="{{ model_ref }}"+ class="w-full px-2 py-1 text-sm bg-[var(--bg-primary)] text-[var(--text-primary)] border border-[var(--border-primary)] rounded focus:outline-none focus:ring-1 focus:ring-[var(--ring-focus)]">+ <option value="">${ t('form.useResolvedDefault') }</option>+ <option v-for="opt in transcriptionModelOptions" :key="opt.value" :value="opt.value" v-text="opt.label || opt.value"></option>+ </select>+ </div>+ <div>+ <label class="block text-xs font-medium text-[var(--text-secondary)] mb-1">+ ${ t('form.transcriptionLanguage') }+ </label>+ <select v-model="{{ lang_ref }}"+ class="w-full px-2 py-1 text-sm bg-[var(--bg-primary)] text-[var(--text-primary)] border border-[var(--border-primary)] rounded focus:outline-none focus:ring-1 focus:ring-[var(--ring-focus)]">+ <option v-for="lang in languageOptions" :key="lang.value" :value="lang.value" v-text="lang.label"></option>+ </select>+ </div>+</div>++<!-- Divider between the language row and the speaker controls -->+<hr v-if="connectorSupportsSpeakerCount || connectorSupportsExactSpeakerCount"+ class="border-t border-[var(--border-secondary)] my-1">++<!-- Speaker Settings (#362): one compact row — label, the+ persisted Range/Exact toggle (range connectors only),+ and narrow inputs. A single count writes min == max. -->+<div v-if="connectorSupportsSpeakerCount || connectorSupportsExactSpeakerCount"+ class="flex flex-wrap items-center gap-x-3 gap-y-1.5">+ <label class="text-xs font-medium text-[var(--text-secondary)]" v-text="t('form.speakers')"></label>+ <div v-if="connectorSupportsSpeakerCount"+ class="inline-flex rounded border border-[var(--border-secondary)] overflow-hidden">+ <button type="button" @click="setSpeakerCountMode('range')"+ :class="['px-2 py-0.5 text-[10px] transition-colors', !exactSpeakerEntry ? 'bg-[var(--bg-accent)] text-[var(--text-accent)] font-medium' : 'text-[var(--text-muted)] hover:text-[var(--text-secondary)]']"+ v-text="t('form.speakerModeRange')"></button>+ <button type="button" @click="setSpeakerCountMode('single')"+ :class="['px-2 py-0.5 text-[10px] transition-colors border-l border-[var(--border-secondary)]', exactSpeakerEntry ? 'bg-[var(--bg-accent)] text-[var(--text-accent)] font-medium' : 'text-[var(--text-muted)] hover:text-[var(--text-secondary)]']"+ v-text="t('form.speakerModeExact')"></button>+ </div>+ <input v-if="exactSpeakerEntry"+ v-model.number="{{ exact_ref }}"+ type="number" min="1" max="20"+ class="w-20 px-2 py-1 text-sm bg-[var(--bg-primary)] text-[var(--text-primary)] border border-[var(--border-primary)] rounded focus:outline-none focus:ring-1 focus:ring-[var(--ring-focus)]">+ <template v-else>+ <label class="text-[11px] text-[var(--text-muted)]" v-text="t('form.minSpeakers')"></label>+ <input v-model.number="{{ min_ref }}"+ type="number" min="1" max="20"+ class="w-16 px-2 py-1 text-sm bg-[var(--bg-primary)] text-[var(--text-primary)] border border-[var(--border-primary)] rounded focus:outline-none focus:ring-1 focus:ring-[var(--ring-focus)]">+ <label class="text-[11px] text-[var(--text-muted)]" v-text="t('form.maxSpeakers')"></label>+ <input v-model.number="{{ max_ref }}"+ type="number" min="1" max="20"+ class="w-16 px-2 py-1 text-sm bg-[var(--bg-primary)] text-[var(--text-primary)] border border-[var(--border-primary)] rounded focus:outline-none focus:ring-1 focus:ring-[var(--ring-focus)]">+ </template>+</div>diff --git a/templates/components/upload-view.html b/templates/components/upload-view.htmlindex 96881944..eacca34d 100644--- a/templates/components/upload-view.html+++ b/templates/components/upload-view.html@@ -600,109 +600,12 @@<div class="disclosure-anim" :class="{ 'is-open': showAdvancedOptions }"><div class="disclosure-anim__inner"><div class="disclosure-panel p-3 bg-[var(--bg-tertiary)] space-y-3 border border-[var(--border-secondary)]">- <!-- Prompt & hotwords sub-card (#309): the saved-template dropdown- fills BOTH the initial prompt and hotwords, so the three are- grouped in one bordered card to make that relationship obvious. -->- <div v-if="connectorSupportsInitialPrompt || connectorSupportsHotwords"- class="rounded-md border border-[var(--border-secondary)] bg-[var(--bg-secondary)] p-3 space-y-3">- <!-- Saved transcription template: fills the fields below. Hidden- until the user has saved templates. -->- <div v-if="initialPromptTemplates && initialPromptTemplates.length">- <label class="block text-xs font-medium text-[var(--text-secondary)] mb-1">- ${ t('initialPromptTemplates.savedTemplate') }- </label>- <select @change="applyInitialPromptTemplate($event.target.value); $event.target.value=''"- class="w-full px-2 py-1 text-sm bg-[var(--bg-primary)] text-[var(--text-primary)] border border-[var(--border-primary)] rounded focus:outline-none focus:ring-1 focus:ring-[var(--ring-focus)]">- <option value="">${ t('initialPromptTemplates.pickPlaceholder') }</option>- <option v-for="tpl in initialPromptTemplates" :key="tpl.id" :value="tpl.id" v-text="tpl.name"></option>- </select>- <p class="text-[10px] text-[var(--text-muted)] mt-0.5">${ t('initialPromptTemplates.savedTemplateHelp') }</p>- </div>-- <!-- Initial Prompt -->- <div v-if="connectorSupportsInitialPrompt">- <label class="block text-xs font-medium text-[var(--text-secondary)] mb-1">- ${ t('form.initialPrompt') }- </label>- <textarea v-model="uploadInitialPrompt"- rows="2"- :placeholder="t('form.initialPromptPlaceholder')"- class="w-full px-2 py-1 text-sm bg-[var(--bg-primary)] text-[var(--text-primary)] border border-[var(--border-primary)] rounded focus:outline-none focus:ring-1 focus:ring-[var(--ring-focus)] resize-y"></textarea>- <p class="text-[10px] text-[var(--text-muted)] mt-0.5">${ t('form.initialPromptHelp') }</p>- </div>-- <!-- Hotwords -->- <div v-if="connectorSupportsHotwords">- <label class="block text-xs font-medium text-[var(--text-secondary)] mb-1">- ${ t('form.hotwords') }- </label>- <input v-model="uploadHotwords"- type="text"- :placeholder="t('form.hotwordsPlaceholder')"- class="w-full px-2 py-1 text-sm bg-[var(--bg-primary)] text-[var(--text-primary)] border border-[var(--border-primary)] rounded focus:outline-none focus:ring-1 focus:ring-[var(--ring-focus)]">- <p class="text-[10px] text-[var(--text-muted)] mt-0.5">${ t('form.hotwordsHelp') }</p>- </div>- </div>-- <!-- Model + language share a row: neither needs full modal- width. The model select (issue #266) renders only when the- admin exposes at least 2 models. -->- <div class="grid grid-cols-1 sm:grid-cols-2 gap-3">- <div v-if="transcriptionModelOptions && transcriptionModelOptions.length > 1">- <label class="block text-xs font-medium text-[var(--text-secondary)] mb-1">- ${ t('form.transcriptionModel') }- </label>- <select v-model="uploadTranscriptionModel"- class="w-full px-2 py-1 text-sm bg-[var(--bg-primary)] text-[var(--text-primary)] border border-[var(--border-primary)] rounded focus:outline-none focus:ring-1 focus:ring-[var(--ring-focus)]">- <option value="">${ t('form.useResolvedDefault') }</option>- <option v-for="opt in transcriptionModelOptions" :key="opt.value" :value="opt.value" v-text="opt.label || opt.value"></option>- </select>- </div>- <div>- <label class="block text-xs font-medium text-[var(--text-secondary)] mb-1">- ${ t('form.transcriptionLanguage') }- </label>- <select v-model="uploadLanguage"- class="w-full px-2 py-1 text-sm bg-[var(--bg-primary)] text-[var(--text-primary)] border border-[var(--border-primary)] rounded focus:outline-none focus:ring-1 focus:ring-[var(--ring-focus)]">- <option v-for="lang in languageOptions" :key="lang.value" :value="lang.value" v-text="lang.label"></option>- </select>- </div>- </div>-- <!-- Divider between the language row and the speaker controls -->- <hr v-if="connectorSupportsSpeakerCount || connectorSupportsExactSpeakerCount"- class="border-t border-[var(--border-secondary)] my-1">-- <!-- Speaker Settings (#362): one compact row — label, the- persisted Range/Exact toggle (range connectors only),- and narrow inputs. A single count writes min == max. -->- <div v-if="connectorSupportsSpeakerCount || connectorSupportsExactSpeakerCount"- class="flex flex-wrap items-center gap-x-3 gap-y-1.5">- <label class="text-xs font-medium text-[var(--text-secondary)]" v-text="t('form.speakers')"></label>- <div v-if="connectorSupportsSpeakerCount"- class="inline-flex rounded border border-[var(--border-secondary)] overflow-hidden">- <button type="button" @click="setSpeakerCountMode('range')"- :class="['px-2 py-0.5 text-[10px] transition-colors', !exactSpeakerEntry ? 'bg-[var(--bg-accent)] text-[var(--text-accent)] font-medium' : 'text-[var(--text-muted)] hover:text-[var(--text-secondary)]']"- v-text="t('form.speakerModeRange')"></button>- <button type="button" @click="setSpeakerCountMode('single')"- :class="['px-2 py-0.5 text-[10px] transition-colors border-l border-[var(--border-secondary)]', exactSpeakerEntry ? 'bg-[var(--bg-accent)] text-[var(--text-accent)] font-medium' : 'text-[var(--text-muted)] hover:text-[var(--text-secondary)]']"- v-text="t('form.speakerModeExact')"></button>- </div>- <input v-if="exactSpeakerEntry"- v-model.number="uploadSpeakersExact"- type="number" min="1" max="20"- class="w-20 px-2 py-1 text-sm bg-[var(--bg-primary)] text-[var(--text-primary)] border border-[var(--border-primary)] rounded focus:outline-none focus:ring-1 focus:ring-[var(--ring-focus)]">- <template v-else>- <label class="text-[11px] text-[var(--text-muted)]" v-text="t('form.minSpeakers')"></label>- <input v-model.number="uploadMinSpeakers"- type="number" min="1" max="20"- class="w-16 px-2 py-1 text-sm bg-[var(--bg-primary)] text-[var(--text-primary)] border border-[var(--border-primary)] rounded focus:outline-none focus:ring-1 focus:ring-[var(--ring-focus)]">- <label class="text-[11px] text-[var(--text-muted)]" v-text="t('form.maxSpeakers')"></label>- <input v-model.number="uploadMaxSpeakers"- type="number" min="1" max="20"- class="w-16 px-2 py-1 text-sm bg-[var(--bg-primary)] text-[var(--text-primary)] border border-[var(--border-primary)] rounded focus:outline-none focus:ring-1 focus:ring-[var(--ring-focus)]">- </template>- </div>+ {% with apply_template_fn='applyInitialPromptTemplate',+ prompt_ref='uploadInitialPrompt', hotwords_ref='uploadHotwords',+ model_ref='uploadTranscriptionModel', lang_ref='uploadLanguage',+ exact_ref='uploadSpeakersExact', min_ref='uploadMinSpeakers', max_ref='uploadMaxSpeakers' %}+ {% include 'components/shared/asr-options.html' %}+ {% endwith %}<p class="text-xs text-[var(--text-muted)] pt-1"><i class="fas fa-info-circle mr-1 text-[var(--text-accent)]"></i>