feat(kon): replace browser clipboard with arboard
- 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>
This commit is contained in:
@@ -33,3 +33,4 @@ serde_json = "1"
|
||||
|
||||
# Async runtime (spawn_blocking for inference)
|
||||
tokio = { version = "1", features = ["rt", "sync"] }
|
||||
arboard = "3.6.1"
|
||||
|
||||
12
src-tauri/src/commands/clipboard.rs
Normal file
12
src-tauri/src/commands/clipboard.rs
Normal file
@@ -0,0 +1,12 @@
|
||||
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(())
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
pub mod audio;
|
||||
pub mod clipboard;
|
||||
pub mod llm;
|
||||
pub mod models;
|
||||
pub mod transcription;
|
||||
|
||||
@@ -68,6 +68,8 @@ pub fn run() {
|
||||
// Windows
|
||||
commands::windows::open_task_window,
|
||||
commands::windows::open_viewer_window,
|
||||
// Clipboard
|
||||
commands::clipboard::copy_to_clipboard,
|
||||
// LLM stubs
|
||||
commands::llm::download_llm_model,
|
||||
commands::llm::check_llm_model,
|
||||
|
||||
Reference in New Issue
Block a user