fix: exclude temporary paste writes from clipboard manager history#526
Open
postoso wants to merge 1 commit into
Open
fix: exclude temporary paste writes from clipboard manager history#526postoso wants to merge 1 commit into
postoso wants to merge 1 commit into
Conversation
|
The PR Policy check is blocking this PR because required template information is missing. Please update the PR description with:
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. |
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.
cea7caa to
3979f64
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The clipboard-paste insertion path writes the transcription to
NSPasteboard.generalto 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.TransientTypeandorg.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
withTemporaryPasteboardStringpath. 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
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
swiftlint --strict --config .swiftlint.yml Sources Tests/FluidDictationIntegrationTests/LLMClientRequestBodyTests.swift Tests/FluidDictationIntegrationTests/TypingServiceTransientPasteboardTests.swiftswiftformat --config .swiftformat Sourcesxcodebuild build-for-testing -project Fluid.xcodeproj -scheme Fluid -destination 'platform=macOS,arch=arm64' CODE_SIGN_IDENTITY='' CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NOAdded dedicated
TypingServiceTransientPasteboardTestscoverage for the extracted helper:.stringvalue needed for pasteManual Raycast check from the original validation:
RAYCAST-TEST-4b7ctext (Concealed,Transient,AutoGenerated)RAYCAST-TEST-4b7c NORMAL; the marked entries did not appearNotes
org.nspasteboard.ConcealedTypeis 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-testingcompiled the app and test target, and CI should run the full hosted suite after the branch update.Screenshots / Video