Refine note info path and history

This commit is contained in:
Yuri Karamian
2026-08-03 02:03:58 +02:00
parent 213797a38e
commit 6b165059cc
5 changed files with 136 additions and 237 deletions
+17
View File
@@ -1231,6 +1231,23 @@ pub fn save_vault_state(state: State<'_, AppState>, vault_state: VaultState) ->
// ── Clipboard ──
/// Copy text to the system clipboard through the native backend.
#[cfg(desktop)]
#[tauri::command]
pub fn copy_text_to_clipboard(text: String) -> Result<(), String> {
let mut clipboard =
arboard::Clipboard::new().map_err(|e| format!("Clipboard init failed: {}", e))?;
clipboard
.set_text(text)
.map_err(|e| format!("Failed to copy text: {}", e))
}
#[cfg(mobile)]
#[tauri::command]
pub fn copy_text_to_clipboard(_text: String) -> Result<(), String> {
Err("Text clipboard copy is only supported on desktop".to_string())
}
/// Read image from system clipboard (bypasses WebKitGTK clipboard bug).
/// Returns PNG bytes as Vec<u8>, or error if no image on clipboard.
#[cfg(desktop)]
+1
View File
@@ -170,6 +170,7 @@ pub fn run() {
commands::empty_trash,
commands::load_vault_state,
commands::save_vault_state,
commands::copy_text_to_clipboard,
commands::read_clipboard_image,
commands::copy_image_to_clipboard,
commands::save_image,