Skip to content

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

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

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

The clipboard-paste insertion path writes the transcription to NSPasteboard.general to drive a synthetic Cmd+V, then restores the previous clipboard right after. Clipboard managers can still observe that short-lived pasteboard write, so dictations inserted through Reliable Paste or paste fallbacks can end up in clipboard history even though FluidVoice restores the clipboard immediately.

This tags the temporary pasteboard item with the nspasteboard.org marker types org.nspasteboard.TransientType and org.nspasteboard.AutoGeneratedType, using zero-length marker data. Clipboard managers that follow that convention skip the temporary entry, while Cmd+V still receives the plain string and the existing restore path stays unchanged.

The code change is limited to the shared withTemporaryPasteboardString path. That keeps the behavioral surface small: paste still works the same way, the previous clipboard is still restored, and only the metadata on FluidVoice's temporary pasteboard item changes.

Type of Change

  • 🐞 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📝 Documentation update

Related Issue or Discussion

Related to #479 and #494. This does not close either issue: those cover terminal insertion failures. This PR removes clipboard-manager history pollution from the paste-based route, which is complementary to the terminal reliability work.

Testing

  • Tested on Intel Mac
  • Tested on Apple Silicon Mac
  • Tested on macOS 15.7.7
  • Ran linter locally: swiftlint --strict --config .swiftlint.yml Sources Tests/FluidDictationIntegrationTests/LLMClientRequestBodyTests.swift Tests/FluidDictationIntegrationTests/TypingServiceTransientPasteboardTests.swift
  • Ran formatter locally: swiftformat --config .swiftformat Sources
  • Built locally: xcodebuild build-for-testing -project Fluid.xcodeproj -scheme Fluid -destination 'platform=macOS,arch=arm64' CODE_SIGN_IDENTITY='' CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO

Added dedicated TypingServiceTransientPasteboardTests coverage for the extracted helper:

  • the item still carries the plain .string value needed for paste
  • the item is tagged Transient and AutoGenerated with zero-length marker payloads
  • the item is not tagged Concealed

Manual Raycast check from the original validation:

  • wrote one normal control pasteboard entry and three marked entries using the same RAYCAST-TEST-4b7c text (Concealed, Transient, AutoGenerated)
  • Raycast Clipboard History recorded only RAYCAST-TEST-4b7c NORMAL; the marked entries did not appear

Notes

org.nspasteboard.ConcealedType is intentionally not used by this PR. It signals sensitive/password content, which is not the right meaning for a dictation transcript. The code uses only the Transient and AutoGenerated markers.

Full hosted test execution was not run locally because the installed FluidVoice app was open; the hosted test runner can hang in that state. build-for-testing compiled the app and test target, and CI should run the full hosted suite after the branch update.

Screenshots / Video

  • No UI/visual changes; screenshots/video are not applicable.

@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

The PR Policy check is blocking this PR because required template information is missing.

Please update the PR description with:

  • Description
  • Type of Change
  • Related Issue or Discussion
  • Testing
  • Screenshots / Video

Screenshots or video are required for UI, UX, settings, onboarding, overlay, menu bar, or visual behavior changes. If this PR has no visual changes, check the no-visual-change box in the template.

If this remains incomplete for 48 hours after opening, the PR may be closed.

@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
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 cea7caa to 3979f64 Compare July 6, 2026 10:41
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.

1 participant