Skip to content

fix: exclude temporary paste writes from clipboard manager history - #773

Merged
grohith327 merged 1 commit into
altic-dev:mainfrom
postoso:fix/transient-clipboard-marker
Aug 4, 2026
Merged

fix: exclude temporary paste writes from clipboard manager history#773
grohith327 merged 1 commit into
altic-dev:mainfrom
postoso:fix/transient-clipboard-marker

Conversation

@postoso

@postoso postoso commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Description

FluidVoice temporarily writes dictated text to NSPasteboard.general when using Reliable Paste or a paste fallback. Clipboard managers can observe that write before FluidVoice restores the previous clipboard, leaving an unwanted transcription in history.

This marks the shared temporary pasteboard item with org.nspasteboard.TransientType and org.nspasteboard.AutoGeneratedType. The normal string remains available to Cmd+V, and the existing clipboard restoration behavior is unchanged. ConcealedType is intentionally omitted because the transcription is not necessarily sensitive content.

The Reliable Paste setting description is also updated so it no longer warns about the clipboard-history behavior fixed here.

Type of Change

  • Bug fix (non-breaking change)
  • New feature
  • Breaking change
  • Documentation update

Related Issue or Discussion

Reopens #526 after rebasing and adding the requested verification clip. Related to #479, which relies on the clipboard paste path this change improves.

Testing

  • Apple Silicon Mac on macOS 15.7.7
  • SwiftLint strict: 0 violations in the changed Swift files
  • xcodebuild build-for-testing
  • 4 focused TypingServiceTransientPasteboardTests
  • Verified the markers survive a real NSPasteboard write
  • End-to-end Raycast check: FluidVoice inserted the transcription into TextEdit and Raycast returned no clipboard-history result for that text

Screenshots / Video

End-to-end verification: https://github.com/user-attachments/assets/bdbecb8f-ca65-4d07-8086-591583f22069

There are no UI layout changes.

The clipboard-paste insertion path writes the transcription to
NSPasteboard.general to drive a synthetic Cmd+V, then restores the
previous clipboard immediately after. Clipboard managers (Maccy, Raycast,
Paste, etc.) record every pasteboard change, so that temporary write lands
in history even though it is reverted right away. With a clipboard manager
running, every dictation that uses the paste path leaves a transcription
entry in history.

Mark the temporary write with the nspasteboard.org TransientType and
AutoGeneratedType marker types so well-behaved clipboard managers skip it.
The change is confined to withTemporaryPasteboardString, which every
clipboard-paste path funnels through; the string content and restore logic
are untouched, so paste behavior and clipboard restoration are unchanged.
ConcealedType is deliberately not used, since it signals sensitive content.
@greptile-apps

greptile-apps Bot commented Aug 4, 2026

Copy link
Copy Markdown

Greptile Summary

This PR tags temporary clipboard writes as transient and auto-generated so compatible clipboard managers omit dictated text from history, while retaining the plain-string paste and existing clipboard restoration behavior.

  • Adds a shared marked NSPasteboardItem constructor and uses it across all temporary clipboard insertion fallbacks.
  • Updates the Reliable Paste setting description to reflect the corrected behavior.
  • Adds focused integration tests and registers them with the Xcode test target.

Confidence Score: 5/5

The PR appears safe to merge with no actionable regressions identified.

The changed pasteboard item retains the standard string type, all three clipboard insertion fallbacks continue through the unchanged snapshot and restoration flow, and the new test is correctly integrated into the existing test target.

Reviews (1): Last reviewed commit: "fix: exclude temporary paste writes from..." | Re-trigger Greptile

@altic-dev

Copy link
Copy Markdown
Owner

@grohith327 - wanna take this in for the clipboard fix?

@altic-dev

Copy link
Copy Markdown
Owner

Thanks for cleaning this up @postoso ! appreciate the useful PRs man

@grohith327 grohith327 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is useful, thank you!

@grohith327
grohith327 merged commit 6ed758f into altic-dev:main Aug 4, 2026
12 of 13 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.

3 participants