Skip to content

fix(desktop): clipboard permission dialog should say Strand (DAN-74) - #131

Merged
danielss-dev merged 4 commits into
mainfrom
developements/native-clipboard-plugin-b90a
Sep 21, 2026
Merged

danielss-dev merged 4 commits into
mainfrom
developements/native-clipboard-plugin-b90a

Conversation

@danielss-dev

@danielss-dev danielss-dev commented Sep 21, 2026 •

Copy link
Copy Markdown
Owner

Summary

Programmatic clipboard read/write now goes through official Tauri 2 tauri-plugin-clipboard-manager, so macOS TCC attributes access to Strand (productName / identifier) instead of the webview origin (tauri.dev local / localhost).

Linear: DAN-74

Implementation

  • Register tauri_plugin_clipboard_manager and grant least-privilege clipboard-manager:allow-read-text / allow-write-text (plugin default is empty; allowlist updated in scripts/check-release-security.mjs).
  • Centralize behind ui/src/lib/clipboard.ts:
    • Desktop shell: plugin writeText / readText
    • Web/demo: navigator.clipboard
  • Existing helpers keep their signatures: copyToClipboard (PierreTree re-export) and readClipboardText (terminalClipboard re-export). Call sites stay put, including Work terminal { copy, read } for DAN-71.
  • Hosted review “Copy feedback” uses writeClipboardText so denials still surface through run().
  • Native Edit-menu Predefined Copy/Paste is unchanged.

Native review harness (CI)

scripts/test-review-native.mjs cannot stub frozen Tauri invoke/ipc. writeClipboardText now honors window.__strandCaptureClipboardWrite so Copy feedback is captured without touching the OS clipboard. The harness still stubs navigator.clipboard.writeText as a web fallback.

Proof

  • cargo check -p strand-core -p strand-tauri — pass (tauri-plugin-clipboard-manager 2.3.3 compiles).
  • pnpm --filter ./ui exec tsc --noEmit — pass.
  • clipboard.test.ts + terminalClipboard.test.ts — 22 tests, including the capture seam (plugin and navigator.clipboard are not called when the hook is set).
  • pnpm release:check-security — pass.
  • Full Native agent review (Windows) is the GitHub Actions gate.

macOS TCC

This agent is Linux and cannot show the live macOS permission dialog. Both tauri dev and packaged builds should name Strand because clipboard access now happens in the native app process, not navigator.clipboard on http://localhost:1420. Verify on a Mac by triggering a programmatic copy (tree/diff copy or terminal paste after a prior deny) on a clean TCC profile.

Out of scope

Clipboard UX redesign, productName / identifier branding, other TCC prompts, Taste/Figma-only work.

Open in Web Open in Cursor 

cursoragent and others added 2 commits September 21, 2026 10:13
Route programmatic clipboard read/write through tauri-plugin-clipboard-manager
so macOS TCC names Strand instead of the webview origin. Keep navigator.clipboard
as the web/demo fallback, and leave Edit-menu Copy/Paste and DAN-71 Ctrl+C/V
routing unchanged.

Linear: DAN-74

Co-authored-by: Daniels <danielss-dev@users.noreply.github.com>
The Windows native review gate stubs navigator.clipboard.writeText to capture
Copy feedback. Desktop copy now uses plugin:clipboard-manager|write_text, so
also wrap __TAURI_INTERNALS__.invoke for that command and leave other IPC
untouched.

Linear: DAN-74

Co-authored-by: Daniels <danielss-dev@users.noreply.github.com>
@danielss-dev
danielss-dev marked this pull request as ready for review September 21, 2026 10:51
cursoragent and others added 2 commits September 21, 2026 11:01
Tauri 2 defines __TAURI_INTERNALS__.invoke/ipc as non-writable, so the
previous assignment never captured plugin:clipboard-manager|write_text.
Keep the navigator stub and also intercept the Windows IPC fetch path.

Co-authored-by: Daniels <danielss-dev@users.noreply.github.com>
writeClipboardText honors window.__strandCaptureClipboardWrite so the
Windows native review gate can record Copy feedback without stubbing
frozen Tauri invoke or touching the OS clipboard.

Co-authored-by: Daniels <danielss-dev@users.noreply.github.com>
@danielss-dev
danielss-dev merged commit df612d8 into main Sep 21, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants