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:
jake
2026-03-16 21:48:19 +00:00
parent 292f9716ff
commit 0bbdbc0591
8 changed files with 22 additions and 6 deletions

View 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(())
}

View File

@@ -1,4 +1,5 @@
pub mod audio;
pub mod clipboard;
pub mod llm;
pub mod models;
pub mod transcription;

View File

@@ -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,