Add ability to change transcription engine from Settings
New features: - Settings > Transcription Engine > "Change Transcription Engine" button stops the sidecar, deletes downloaded files, and reloads the app to show the engine selection screen - Improved SidecarSetup descriptions with detailed explanations of each variant and "Recommended" tag on Cloud (Deepgram) - Cloud option listed first as the recommended choice - New reset_sidecar Tauri command that cleans up sidecar files Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -68,6 +68,7 @@ pub fn run() {
|
|||||||
sidecar::get_sidecar_port,
|
sidecar::get_sidecar_port,
|
||||||
sidecar::start_sidecar,
|
sidecar::start_sidecar,
|
||||||
sidecar::stop_sidecar,
|
sidecar::stop_sidecar,
|
||||||
|
sidecar::reset_sidecar,
|
||||||
write_log,
|
write_log,
|
||||||
])
|
])
|
||||||
.run(tauri::generate_context!())
|
.run(tauri::generate_context!())
|
||||||
|
|||||||
@@ -685,6 +685,42 @@ pub fn stop_sidecar(state: tauri::State<'_, ManagedSidecar>) -> Result<(), Strin
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Stop the running sidecar, delete its files and version marker.
|
||||||
|
/// The next app launch will show the sidecar download prompt.
|
||||||
|
#[tauri::command]
|
||||||
|
pub fn reset_sidecar(state: tauri::State<'_, ManagedSidecar>) -> Result<(), String> {
|
||||||
|
// Stop the running sidecar first
|
||||||
|
{
|
||||||
|
let mut mgr = state
|
||||||
|
.0
|
||||||
|
.lock()
|
||||||
|
.map_err(|e| format!("Lock error: {e}"))?;
|
||||||
|
mgr.stop();
|
||||||
|
}
|
||||||
|
|
||||||
|
let data = data_dir();
|
||||||
|
|
||||||
|
// Delete the version file so check_sidecar returns false
|
||||||
|
let vf = version_file();
|
||||||
|
if vf.exists() {
|
||||||
|
std::fs::remove_file(&vf)
|
||||||
|
.map_err(|e| format!("Failed to delete version file: {e}"))?;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Delete all sidecar directories
|
||||||
|
if let Ok(entries) = std::fs::read_dir(&data) {
|
||||||
|
for entry in entries.flatten() {
|
||||||
|
let name = entry.file_name().to_string_lossy().to_string();
|
||||||
|
if name.starts_with("sidecar-") && entry.path().is_dir() {
|
||||||
|
eprintln!("[sidecar] Removing {}", entry.path().display());
|
||||||
|
let _ = std::fs::remove_dir_all(entry.path());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
// Tests
|
// Tests
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -232,6 +232,18 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function handleChangeSidecar() {
|
||||||
|
try {
|
||||||
|
const { invoke } = await import("@tauri-apps/api/core");
|
||||||
|
await invoke("reset_sidecar");
|
||||||
|
// Force a page reload which will re-trigger the setup flow
|
||||||
|
window.location.reload();
|
||||||
|
} catch (err) {
|
||||||
|
console.error("Failed to reset sidecar:", err);
|
||||||
|
saveMessage = `Error: ${err}`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
async function handleManagedLogin() {
|
async function handleManagedLogin() {
|
||||||
try {
|
try {
|
||||||
await backendStore.apiPost("/api/login", {
|
await backendStore.apiPost("/api/login", {
|
||||||
@@ -749,6 +761,17 @@
|
|||||||
</div>
|
</div>
|
||||||
<button onclick={handleCheckUpdates}>Check Now</button>
|
<button onclick={handleCheckUpdates}>Check Now</button>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
<!-- Transcription Engine -->
|
||||||
|
<section class="settings-section">
|
||||||
|
<h3>Transcription Engine</h3>
|
||||||
|
<p style="font-size: 12px; color: var(--text-secondary); margin-bottom: 12px;">
|
||||||
|
Switch between local (Whisper) and cloud (Deepgram) transcription engines.
|
||||||
|
This will stop the current engine, remove the downloaded files, and restart
|
||||||
|
with the new engine selection.
|
||||||
|
</p>
|
||||||
|
<button class="danger-btn" onclick={handleChangeSidecar}>Change Transcription Engine</button>
|
||||||
|
</section>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="settings-footer">
|
<div class="settings-footer">
|
||||||
@@ -919,4 +942,18 @@
|
|||||||
.save-message.error {
|
.save-message.error {
|
||||||
color: #f44336;
|
color: #f44336;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.danger-btn {
|
||||||
|
background: transparent;
|
||||||
|
border: 1px solid var(--accent-red, #f44336);
|
||||||
|
color: var(--accent-red, #f44336);
|
||||||
|
padding: 8px 16px;
|
||||||
|
border-radius: 6px;
|
||||||
|
cursor: pointer;
|
||||||
|
font-size: 13px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.danger-btn:hover {
|
||||||
|
background: rgba(244, 67, 54, 0.1);
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -84,11 +84,29 @@
|
|||||||
|
|
||||||
{#if setupState === "choose"}
|
{#if setupState === "choose"}
|
||||||
<p class="setup-description">
|
<p class="setup-description">
|
||||||
The app needs to download its transcription engine before you can start.
|
Choose a transcription engine. You can change this later in Settings.
|
||||||
Choose the version that best fits your hardware.
|
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div class="variant-options">
|
<div class="variant-options">
|
||||||
|
<label class="variant-option" class:selected={variant === "cloud"}>
|
||||||
|
<input
|
||||||
|
type="radio"
|
||||||
|
name="variant"
|
||||||
|
value="cloud"
|
||||||
|
bind:group={variant}
|
||||||
|
/>
|
||||||
|
<div class="variant-info">
|
||||||
|
<span class="variant-name">Cloud (Deepgram)</span>
|
||||||
|
<span class="variant-desc">~50 MB download</span>
|
||||||
|
<span class="variant-detail">
|
||||||
|
Fast, accurate streaming transcription via Deepgram's servers.
|
||||||
|
Requires internet and a Deepgram API key.
|
||||||
|
Best for most users — low resource usage, works on any hardware.
|
||||||
|
</span>
|
||||||
|
<span class="variant-tag recommended">Recommended</span>
|
||||||
|
</div>
|
||||||
|
</label>
|
||||||
|
|
||||||
<label class="variant-option" class:selected={variant === "cpu"}>
|
<label class="variant-option" class:selected={variant === "cpu"}>
|
||||||
<input
|
<input
|
||||||
type="radio"
|
type="radio"
|
||||||
@@ -97,8 +115,13 @@
|
|||||||
bind:group={variant}
|
bind:group={variant}
|
||||||
/>
|
/>
|
||||||
<div class="variant-info">
|
<div class="variant-info">
|
||||||
<span class="variant-name">Standard (CPU)</span>
|
<span class="variant-name">Local - CPU</span>
|
||||||
<span class="variant-desc">Works on all computers (~500 MB download)</span>
|
<span class="variant-desc">~500 MB download</span>
|
||||||
|
<span class="variant-detail">
|
||||||
|
Runs Whisper AI models locally on your CPU. No internet needed
|
||||||
|
after download. Good for privacy or offline use, but slower and
|
||||||
|
uses more system resources than cloud.
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
@@ -110,21 +133,13 @@
|
|||||||
bind:group={variant}
|
bind:group={variant}
|
||||||
/>
|
/>
|
||||||
<div class="variant-info">
|
<div class="variant-info">
|
||||||
<span class="variant-name">GPU Accelerated (CUDA)</span>
|
<span class="variant-name">Local - GPU (NVIDIA CUDA)</span>
|
||||||
<span class="variant-desc">Faster transcription with NVIDIA GPU (~2 GB download)</span>
|
<span class="variant-desc">~2 GB download</span>
|
||||||
</div>
|
<span class="variant-detail">
|
||||||
</label>
|
Runs Whisper AI models locally using your NVIDIA GPU for fast
|
||||||
|
transcription. No internet needed after download. Requires an
|
||||||
<label class="variant-option" class:selected={variant === "cloud"}>
|
NVIDIA GPU with CUDA support.
|
||||||
<input
|
</span>
|
||||||
type="radio"
|
|
||||||
name="variant"
|
|
||||||
value="cloud"
|
|
||||||
bind:group={variant}
|
|
||||||
/>
|
|
||||||
<div class="variant-info">
|
|
||||||
<span class="variant-name">Cloud Only (Deepgram)</span>
|
|
||||||
<span class="variant-desc">Lightweight, requires Deepgram API key (~50 MB download)</span>
|
|
||||||
</div>
|
</div>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
@@ -273,6 +288,30 @@
|
|||||||
color: #888;
|
color: #888;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.variant-detail {
|
||||||
|
font-size: 11px;
|
||||||
|
color: #666;
|
||||||
|
line-height: 1.4;
|
||||||
|
margin-top: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.variant-tag {
|
||||||
|
display: inline-block;
|
||||||
|
font-size: 10px;
|
||||||
|
font-weight: 600;
|
||||||
|
text-transform: uppercase;
|
||||||
|
letter-spacing: 0.5px;
|
||||||
|
padding: 2px 6px;
|
||||||
|
border-radius: 3px;
|
||||||
|
margin-top: 4px;
|
||||||
|
width: fit-content;
|
||||||
|
}
|
||||||
|
|
||||||
|
.variant-tag.recommended {
|
||||||
|
background: rgba(76, 175, 80, 0.15);
|
||||||
|
color: #4CAF50;
|
||||||
|
}
|
||||||
|
|
||||||
.download-btn {
|
.download-btn {
|
||||||
display: block;
|
display: block;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|||||||
Reference in New Issue
Block a user