feat(ui): load language catalog + setWhisperLanguage in settings store (T8.7, M4.2)

This commit is contained in:
iamdoubz
2026-07-07 13:08:59 -05:00
parent 4c00496c09
commit 489271964f
+20
View File
@@ -14,6 +14,7 @@ import {
type HardwareStatus,
type LlmStatus,
type ModelInfo,
type LanguageOption,
type PrivacySelfCheck,
type McpStatus,
type McpAccessEntry,
@@ -27,6 +28,7 @@ const DEFAULT_SETTINGS: AppSettings = {
llm_model: "llama3",
preferred_backend: "auto",
whisper_model: "base.en-q5_1",
whisper_language: null, // auto-detect by default (T8.7, FR-TRX-4)
low_overhead: false,
default_record: false, // recording OFF by default (ADR-0009)
consent_acknowledged: false,
@@ -58,6 +60,8 @@ class SettingsStore {
// Hardware + model management (Phase 3, T3.6/T3.7).
hardware = $state<HardwareStatus | null>(null);
models = $state<ModelInfo[]>([]);
// Transcription language catalog for the Settings dropdown (T8.7, FR-TRX-4).
languages = $state<LanguageOption[]>([]);
audioDevices = $state<AudioDeviceInfo[]>([]);
inputDevices = $state<AudioDeviceInfo[]>([]);
downloadProgress = $state<Record<string, { received: number; total: number | null }>>({});
@@ -96,6 +100,7 @@ class SettingsStore {
await this.loadAudioDevices();
await this.loadInputDevices();
await this.loadModels();
await this.loadLanguages();
await this.loadPrivacy();
await this.loadLlmStatus();
await this.loadMcpStatus();
@@ -193,6 +198,21 @@ class SettingsStore {
}
}
async loadLanguages() {
try {
this.languages = await api.listWhisperLanguages();
} catch {
this.languages = [];
}
}
/** `null` = auto-detect (T8.7, FR-TRX-4). Only meaningful when the active
* model is multilingual — the Settings UI disables/hides this control
* otherwise, and the backend forces "en" regardless if it's set anyway. */
async setWhisperLanguage(code: string | null) {
await this.patch({ whisper_language: code });
}
async loadPrivacy() {
try {
this.privacy = await api.privacySelfCheck();