feat(ui): profile picker + per-profile vocabulary; transcribe invokes carry profileId; drop buildInitialPrompt
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
import { onMount, onDestroy } from "svelte";
|
||||
import { Channel, invoke } from "@tauri-apps/api/core";
|
||||
import { page, settings, templates, profiles, addToHistory, addTask, tasks } from "$lib/stores/page.svelte.js";
|
||||
import { profilesStore } from "$lib/stores/profiles.svelte.ts";
|
||||
import { toasts } from "$lib/stores/toasts.svelte.js";
|
||||
import Card from "$lib/components/Card.svelte";
|
||||
import ModelDownloader from "$lib/components/ModelDownloader.svelte";
|
||||
@@ -123,18 +124,6 @@
|
||||
return currentModelIsEnglishOnly() ? "en" : settings.language;
|
||||
}
|
||||
|
||||
function buildInitialPrompt() {
|
||||
if (!page.activeProfile || page.activeProfile === "None") return "";
|
||||
const profile = profiles.find((entry) => entry.name === page.activeProfile);
|
||||
if (!profile?.words) return "";
|
||||
const words = profile.words
|
||||
.split("\n")
|
||||
.map((word) => word.trim())
|
||||
.filter(Boolean);
|
||||
if (words.length === 0) return "";
|
||||
return `Use these terms when they match the audio: ${words.join(", ")}`;
|
||||
}
|
||||
|
||||
async function refreshRuntimeCapabilities() {
|
||||
runtimeCapabilities = await invoke("get_runtime_capabilities");
|
||||
}
|
||||
@@ -322,7 +311,11 @@
|
||||
engine: settings.engine,
|
||||
modelId: selectedModelId(),
|
||||
language: effectiveLanguage(),
|
||||
initialPrompt: buildInitialPrompt(),
|
||||
// Backend (Task 13) falls back to profile.initial_prompt when this
|
||||
// is empty. Vocabulary now lives on the active profile, not on the
|
||||
// old page.activeProfile localStorage bag.
|
||||
initialPrompt: "",
|
||||
profileId: profilesStore.activeProfileId,
|
||||
saveAudio: settings.saveAudio,
|
||||
outputFolder: settings.outputFolder || null,
|
||||
removeFillers: settings.removeFillers,
|
||||
|
||||
Reference in New Issue
Block a user