Skip to content

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

Closed
postoso wants to merge 1 commit into
altic-dev:mainfrom
postoso:fix/transient-clipboard-marker
Closed

fix: exclude temporary paste writes from clipboard manager history#526
postoso wants to merge 1 commit into
altic-dev:mainfrom
postoso:fix/transient-clipboard-marker

Conversation

@postoso

@postoso postoso commented Jul 5, 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

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.

@github-actions github-actions Bot added needs PR template Pull request is missing required template content. needs screenshots Pull request needs screenshot or video evidence. labels Jul 5, 2026
@github-actions

github-actions Bot commented Jul 5, 2026

Copy link
Copy Markdown

This PR has been closed because it still does not follow the required PR template after the 48-hour correction window.

Please open a new PR with the required description, related issue or accepted Discussion, testing notes, and screenshot/video evidence when applicable.

@github-actions github-actions Bot removed needs PR template Pull request is missing required template content. needs screenshots Pull request needs screenshot or video evidence. labels Jul 5, 2026
@postoso
postoso force-pushed the fix/transient-clipboard-marker branch from cea7caa to 3979f64 Compare July 6, 2026 10:41
@altic-dev

Copy link
Copy Markdown
Owner

this seems like a good one! wanna fix all of the issues and perhaps add a clip for me to verify ? I can happily merge this ;) might be useful for me as well.

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.
@postoso
postoso force-pushed the fix/transient-clipboard-marker branch from 3979f64 to 83828d3 Compare August 4, 2026 00:28
@github-actions github-actions Bot added needs PR template Pull request is missing required template content. needs screenshots Pull request needs screenshot or video evidence. labels Aug 4, 2026
@github-actions github-actions Bot closed this Aug 4, 2026
@greptile-apps

greptile-apps Bot commented Aug 4, 2026

Copy link
Copy Markdown

Greptile Summary

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

  • Adds a shared constructor for marker-bearing temporary pasteboard items.
  • Uses that item throughout the shared clipboard-paste insertion path.
  • Updates the Reliable Paste description and adds focused pasteboard tests.

Confidence Score: 5/5

The PR appears safe to merge; the temporary paste remains available as plain text and the existing clipboard restoration and fallback behavior is preserved.

The marker-bearing item is written through the same shared path used by every clipboard insertion fallback, retains the required plain-string representation, and does not alter synchronization, action dispatch, or restoration decisions.

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

@postoso

postoso commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

Rebased this onto current main and resolved the old conflicts.

The temporary pasteboard write now carries the normal string plus the Transient and AutoGenerated markers. Concealed is intentionally omitted. I also updated the stale Reliable Paste description and added coverage confirming the markers survive a real NSPasteboard write.

Verified with SwiftLint, build-for-testing, 4 focused tests, and an end-to-end Raycast check. FluidVoice inserted the transcription into TextEdit, restored the clipboard, and Raycast returned no clipboard-history result for the inserted text.

Video attached below.

pr526-fluidvoice-raycast-proof.mp4

@github-actions github-actions Bot removed needs PR template Pull request is missing required template content. needs screenshots Pull request needs screenshot or video evidence. labels Aug 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants