- New copy_to_clipboard Tauri command using arboard 3.6 - Replaced all 5 navigator.clipboard.writeText() calls across DictationPage, HistoryPage, FilesPage, and viewer with invoke() - Native clipboard access independent of WebView permissions Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
13 lines
374 B
Rust
13 lines
374 B
Rust
use arboard::Clipboard;
|
|
|
|
/// Copy text to the system clipboard via arboard.
|
|
#[tauri::command]
|
|
pub fn copy_to_clipboard(text: String) -> Result<(), String> {
|
|
let mut clipboard =
|
|
Clipboard::new().map_err(|e| format!("Clipboard init failed: {e}"))?;
|
|
clipboard
|
|
.set_text(&text)
|
|
.map_err(|e| format!("Clipboard write failed: {e}"))?;
|
|
Ok(())
|
|
}
|