minutes icon indicating copy to clipboard operation
minutes copied to clipboard

Windows: clipboard copy/paste actions are unimplemented (tray "Paste" + dictation insertion)

Open maosuarez opened this issue 5 months ago • 1 comments

Summary

On Windows, the copy/paste paths in the desktop app are a no-op or return an error. Clipboard writing and paste automation are implemented only for macOS (pbcopy / osascript) and Linux (xclip / xdotool), with an explicit "not implemented" fallback for every other platform — so the tray "Paste summary / Paste transcript" items and dictation text insertion don't work on Windows.

Where

  • tauri/src-tauri/src/text_insertion.rs:356-360 — write_clipboard() returns Err("Clipboard insertion is not implemented on this platform.") under cfg(not(any(target_os = "macos", target_os = "linux"))).
  • tauri/src-tauri/src/commands.rs:2215-2217 — supports_tray_artifact_copy() is cfg!(target_os = "macos"), so it's false on Windows (and Linux).
  • tauri/src-tauri/src/main.rs:1967 — the tray "Paste summary / Paste transcript" items are only appended when supports_tray_artifact_copy() is true, i.e. macOS only.

Impact

Windows users can't copy the summary/transcript from the tray, and dictation insertion has no clipboard path. The failure is silent or an error string rather than a crash, but the feature is simply unavailable.

Proposed direction (open to your preference)

Wire up a cross-platform clipboard copy path on Windows — e.g. the arboard crate — gated so the existing macOS/Linux behavior is untouched, and make supports_tray_artifact_copy() true on Windows once copy works. The more invasive "paste into the focused app" automation (the osascript/xdotool keystroke step) is a separate concern and can stay platform-gated; just enabling clipboard copy already restores the artifact-copy menu.

I'm a Windows contributor and happy to implement this, but wanted to confirm the approach (arboard vs. raw Win32, and whether you want paste-automation in scope) before writing code, per the issue-first workflow.

Environment: Windows 11.

maosuarez avatar Jun 25 '26 02:06 maosuarez

Verified, and your diagnosis is exactly right: write_clipboard() has the cfg(not(any(macos, linux))) not-implemented fallback in text_insertion.rs, supports_tray_artifact_copy() is cfg!(target_os = "macos") in commands.rs, and the tray "Paste summary / Paste transcript" items hang off that in main.rs.

Green light on your proposed approach:

  • Add a cross-platform clipboard copy path via arboard, gated so the existing macOS (pbcopy) and Linux (xclip) arms in write_clipboard() are untouched. arboard is the right pick here: no extra system deps on Windows, and it matches our Rust-fn approach rather than pulling in a Tauri plugin.
  • Flip supports_tray_artifact_copy() to true on Windows once copy works, so the tray artifact-copy items appear.
  • Keep the paste-into-focused-app automation (the osascript / xdotool keystroke step, and dictation auto-insertion which depends on it) platform-gated and out of scope for this PR, as you suggested. Restoring clipboard copy is the clean, self-contained win.

One ask: please keep the macOS/Linux behavior byte-identical (new code behind the Windows cfg arm only), since those paths are load-bearing. Send it whenever, happy to review. Thanks for the precise writeup.

silverstein avatar Jun 25 '26 03:06 silverstein