diff --git a/src-tauri/src/commands/transcripts.rs b/src-tauri/src/commands/transcripts.rs index 973d451..c326f86 100644 --- a/src-tauri/src/commands/transcripts.rs +++ b/src-tauri/src/commands/transcripts.rs @@ -1,21 +1,24 @@ -// Tauri commands wrapping the kon_storage transcript and dictionary CRUD. +// Tauri commands wrapping the kon_storage transcript CRUD. // These are the bridge that lets the Svelte frontend treat SQLite as the // canonical store rather than localStorage. // // Day 4 of the upgrade plan. The frontend HistoryPage rename flow has had // a `// TODO: persist to SQLite when update_transcript exists` for some // time; that command now exists. +// +// Task 16 — the legacy global-dictionary commands +// (`list_dictionary_command`, `add_dictionary_entry_command`, +// `delete_dictionary_entry_command`) were dropped; profile-scoped +// `profile_terms` commands in `commands::profiles` are now canonical. use serde::{Deserialize, Serialize}; use kon_storage::{ - add_dictionary_entry, count_transcripts, delete_dictionary_entry, - delete_transcript as db_delete_transcript, get_transcript as db_get_transcript, - insert_transcript as db_insert_transcript, list_dictionary, + count_transcripts, delete_transcript as db_delete_transcript, + get_transcript as db_get_transcript, insert_transcript as db_insert_transcript, list_transcripts_paged, search_transcripts as db_search_transcripts, update_transcript as db_update_transcript, - update_transcript_meta as db_update_transcript_meta, DictionaryEntry, InsertTranscriptParams, - TranscriptRow, + update_transcript_meta as db_update_transcript_meta, InsertTranscriptParams, TranscriptRow, }; use crate::AppState; @@ -233,57 +236,3 @@ pub async fn update_transcript_meta_cmd( Ok(TranscriptDto::from(row)) } -// --- Dictionary commands (custom vocabulary) --- - -#[derive(Debug, Clone, Serialize)] -#[serde(rename_all = "camelCase")] -pub struct DictionaryDto { - pub id: i64, - pub term: String, - pub note: Option, -} - -impl From for DictionaryDto { - fn from(e: DictionaryEntry) -> Self { - Self { - id: e.id, - term: e.term, - note: e.note, - } - } -} - -#[tauri::command] -pub async fn list_dictionary_command( - state: tauri::State<'_, AppState>, -) -> Result, String> { - list_dictionary(&state.db) - .await - .map(|rows| rows.into_iter().map(DictionaryDto::from).collect()) - .map_err(|e| e.to_string()) -} - -#[tauri::command] -pub async fn add_dictionary_entry_command( - state: tauri::State<'_, AppState>, - term: String, - note: Option, -) -> Result { - let term = term.trim(); - if term.is_empty() { - return Err("Dictionary term cannot be empty".into()); - } - add_dictionary_entry(&state.db, term, note.as_deref()) - .await - .map_err(|e| e.to_string()) -} - -#[tauri::command] -pub async fn delete_dictionary_entry_command( - state: tauri::State<'_, AppState>, - id: i64, -) -> Result<(), String> { - delete_dictionary_entry(&state.db, id) - .await - .map_err(|e| e.to_string()) -} diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index ced5e5c..4e9b2fa 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -283,9 +283,6 @@ pub fn run() { commands::transcripts::update_transcript_meta_cmd, commands::transcripts::delete_transcript, commands::transcripts::search_transcripts, - commands::transcripts::list_dictionary_command, - commands::transcripts::add_dictionary_entry_command, - commands::transcripts::delete_dictionary_entry_command, // Diagnostics (panic + error capture, manual report bundle) commands::diagnostics::log_frontend_error, commands::diagnostics::list_recent_errors_command,