- DevTools off by default (no more auto-open on launch) - New "Developer" tab in Settings with a checkbox to toggle devtools - Toggle takes effect immediately (opens/closes inspector) - Setting persists: devtools restored on next launch if enabled - toggle_devtools Tauri command wraps window.open/close_devtools Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
80 lines
2.6 KiB
Rust
80 lines
2.6 KiB
Rust
pub mod commands;
|
|
pub mod db;
|
|
pub mod llama;
|
|
pub mod sidecar;
|
|
pub mod state;
|
|
|
|
use tauri::window::Color;
|
|
use tauri::Manager;
|
|
|
|
use commands::ai::{ai_chat, ai_configure, ai_list_providers};
|
|
use commands::export::export_transcript;
|
|
use commands::project::{
|
|
create_project, delete_project, get_project, list_projects, load_project_file,
|
|
load_project_transcript, save_project_file, save_project_transcript, update_segment,
|
|
};
|
|
use commands::settings::{load_settings, save_settings, toggle_devtools};
|
|
use commands::sidecar::{check_sidecar, check_sidecar_update, download_sidecar};
|
|
use commands::system::{
|
|
get_data_dir, llama_list_models, llama_start, llama_status, llama_stop, log_frontend,
|
|
};
|
|
use commands::transcribe::{download_diarize_model, run_pipeline, transcribe_file};
|
|
use state::AppState;
|
|
|
|
#[cfg_attr(mobile, tauri::mobile_entry_point)]
|
|
pub fn run() {
|
|
let app_state = AppState::new().expect("Failed to initialize app state");
|
|
|
|
tauri::Builder::default()
|
|
.plugin(tauri_plugin_opener::init())
|
|
.plugin(tauri_plugin_dialog::init())
|
|
.manage(app_state)
|
|
.setup(|app| {
|
|
// Tell the sidecar manager where Tauri placed bundled resources
|
|
// and where to extract the sidecar archive
|
|
if let (Ok(resource_dir), Ok(data_dir)) =
|
|
(app.path().resource_dir(), app.path().app_local_data_dir())
|
|
{
|
|
sidecar::init_dirs(resource_dir, data_dir);
|
|
}
|
|
|
|
// Set the webview background to match the app's dark theme
|
|
if let Some(window) = app.get_webview_window("main") {
|
|
let _ = window.set_background_color(Some(Color(10, 10, 35, 255)));
|
|
}
|
|
Ok(())
|
|
})
|
|
.invoke_handler(tauri::generate_handler![
|
|
create_project,
|
|
get_project,
|
|
list_projects,
|
|
delete_project,
|
|
save_project_transcript,
|
|
load_project_transcript,
|
|
update_segment,
|
|
save_project_file,
|
|
load_project_file,
|
|
transcribe_file,
|
|
run_pipeline,
|
|
download_diarize_model,
|
|
export_transcript,
|
|
ai_chat,
|
|
ai_list_providers,
|
|
ai_configure,
|
|
llama_start,
|
|
llama_stop,
|
|
llama_status,
|
|
llama_list_models,
|
|
get_data_dir,
|
|
load_settings,
|
|
save_settings,
|
|
check_sidecar,
|
|
download_sidecar,
|
|
check_sidecar_update,
|
|
log_frontend,
|
|
toggle_devtools,
|
|
])
|
|
.run(tauri::generate_context!())
|
|
.expect("error while running tauri application");
|
|
}
|