- FilterBar component with text search, label chips, due date and priority dropdowns - "/" keyboard shortcut and toolbar button to toggle filter bar - Keyboard card navigation with J/K/H/L keys, Enter to open, Escape to clear - Focus ring on keyboard-selected cards with auto-scroll - Desktop notifications for due/overdue cards via tauri-plugin-notification - CommentsSection component with add/delete and relative timestamps - Filtered card count display in column headers
45 lines
1.6 KiB
Rust
45 lines
1.6 KiB
Rust
use tauri_plugin_fs::FsExt;
|
|
|
|
#[tauri::command]
|
|
fn get_portable_data_dir() -> Result<String, String> {
|
|
let exe_path = std::env::current_exe().map_err(|e| e.to_string())?;
|
|
let exe_dir = exe_path
|
|
.parent()
|
|
.ok_or_else(|| "Failed to get exe directory".to_string())?;
|
|
let data_dir = exe_dir.join("data");
|
|
Ok(data_dir.to_string_lossy().to_string())
|
|
}
|
|
|
|
#[cfg_attr(mobile, tauri::mobile_entry_point)]
|
|
pub fn run() {
|
|
tauri::Builder::default()
|
|
.plugin(tauri_plugin_opener::init())
|
|
.plugin(tauri_plugin_fs::init())
|
|
.plugin(tauri_plugin_dialog::init())
|
|
.plugin(tauri_plugin_shell::init())
|
|
.plugin(tauri_plugin_notification::init())
|
|
.setup(|app| {
|
|
// Get portable data directory next to the exe
|
|
let exe_path =
|
|
std::env::current_exe().expect("Failed to get exe path");
|
|
let exe_dir = exe_path
|
|
.parent()
|
|
.expect("Failed to get exe directory");
|
|
let data_dir = exe_dir.join("data");
|
|
|
|
// Ensure data directory exists
|
|
std::fs::create_dir_all(&data_dir)
|
|
.expect("Failed to create portable data directory");
|
|
|
|
// Allow FS plugin access to the portable data directory
|
|
app.fs_scope()
|
|
.allow_directory(&data_dir, true)
|
|
.expect("Failed to allow data directory in FS scope");
|
|
|
|
Ok(())
|
|
})
|
|
.invoke_handler(tauri::generate_handler![get_portable_data_dir])
|
|
.run(tauri::generate_context!())
|
|
.expect("error while running tauri application");
|
|
}
|