chore: remove 11 orphan Tauri commands and downstream dead code

Sweep of registered-but-never-invoked commands surfaced by an audit
against the frontend invoke() call sites. Each was confirmed dead via
grep across src-tauri, src, and crates: no caller anywhere.

Removed commands:
- check_model, count_transcripts_command, get_profile_cmd,
  install_update, list_feedback_examples_cmd (utility/CRUD shapes
  never wired)
- save_audio, start_native_capture, stop_native_capture (native-capture
  path superseded by the live transcription session)
- transcribe_pcm, transcribe_pcm_parakeet (PCM commands superseded by
  live session; no frontend caller)
- close_preview_window (preview window is hidden via the
  core:window:allow-hide capability, not the command)

Cascade in audio.rs (~430 lines removed):
- CaptureWorker, NativeCaptureState struct + impl, stop_worker,
  append_recorded_chunk, MAX_NATIVE_CAPTURE_RETURN_SAMPLES,
  persist_audio_samples
- The two cfg(test) tests that exercised stop_worker (the
  recording_filename tests stay, supporting resolve_recording_path
  which the live session uses)

Cascade elsewhere:
- FeedbackDto struct and its From<FeedbackRow> impl
- Stale storage imports in feedback.rs, profiles.rs, transcripts.rs
- tauri::Emitter import in transcription.rs
- app.manage(NativeCaptureState::new()) in lib.rs setup

generate_handler entries removed for all 11 commands. cargo check passes
cleanly with zero warnings; no tests reference any deleted symbols.

Net: 709 deletions, 17 insertions across 9 files.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
jars
2026-05-09 16:03:19 +01:00
parent 2a45cb8033
commit b16fc179b3
9 changed files with 17 additions and 709 deletions

View File

@@ -15,9 +15,8 @@ use magnotia_ai_formatting::extract_corrections;
use magnotia_storage::{
add_profile_term as db_add_profile_term, create_profile as db_create_profile,
delete_profile as db_delete_profile, delete_profile_term as db_delete_profile_term,
get_profile as db_get_profile, list_profile_terms as db_list_profile_terms,
list_profiles as db_list_profiles, update_profile as db_update_profile, ProfileRow,
ProfileTermRow,
list_profile_terms as db_list_profile_terms, list_profiles as db_list_profiles,
update_profile as db_update_profile, ProfileRow, ProfileTermRow,
};
use crate::AppState;
@@ -79,17 +78,6 @@ pub async fn list_profiles_cmd(
.map_err(|e| e.to_string())
}
#[tauri::command]
pub async fn get_profile_cmd(
state: tauri::State<'_, AppState>,
id: String,
) -> Result<Option<ProfileDto>, String> {
db_get_profile(&state.db, &id)
.await
.map(|opt| opt.map(ProfileDto::from))
.map_err(|e| e.to_string())
}
#[tauri::command]
pub async fn create_profile_cmd(
state: tauri::State<'_, AppState>,