fix: exclude temporary paste writes from clipboard manager history - #773
Conversation
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 SummaryThis 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.
|
|
@grohith327 - wanna take this in for the clipboard fix? |
|
Thanks for cleaning this up @postoso ! appreciate the useful PRs man |
grohith327
left a comment
There was a problem hiding this comment.
This is useful, thank you!
Description
FluidVoice temporarily writes dictated text to
NSPasteboard.generalwhen 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.TransientTypeandorg.nspasteboard.AutoGeneratedType. The normal string remains available to Cmd+V, and the existing clipboard restoration behavior is unchanged.ConcealedTypeis 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
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
xcodebuild build-for-testingTypingServiceTransientPasteboardTestsNSPasteboardwriteScreenshots / Video
End-to-end verification: https://github.com/user-attachments/assets/bdbecb8f-ca65-4d07-8086-591583f22069
There are no UI layout changes.