Fix macOS clipboard restore delay#1038
Merged
gabrielste1n merged 2 commits intoJul 3, 2026
Merged
Conversation
Combines the OpenWhispr#1020 rich-format clipboard mock with this branch's reloadable loadClipboardManager harness; all 6 tests pass.
Collaborator
|
thank you for the awesome work here @SyntaxSawdust !! |
gabrielste1n
approved these changes
Jul 3, 2026
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.
Summary
Why
Fixes #1023.
OpenWhispr 1.7.3 increased the macOS clipboard restore delay to 2000ms. That leaves the dictated text on the clipboard for longer after paste, which can cause follow-up paste behavior to use the dictated text rather than the user's previous clipboard content. This restores the shorter macOS delay while keeping the existing expected-text guard that avoids overwriting a newer user clipboard write.
Tests
mise x node@24 -- node --test test/helpers/clipboardRestore.test.jspassed, 5/5.mise x node@24 -- npm run lintpassed.mise x node@24 -- npm run typecheckpassed.mise x node@24 -- npx prettier --check src/helpers/clipboard.js test/helpers/clipboardRestore.test.jspassed.git diff --check upstream/mainpassed.mise x node@24 -- npm run format:checkran but failed on existing unrelated formatting issues inhelpers/audioManager.js,helpers/speakerEmbeddings.js, andhelpers/textEditMonitor.js; the two changed files pass Prettier directly.Scope / non-goals
Caveats
src/helpers/clipboard.jsandtest/helpers/clipboardRestore.test.jsfor Clipboard restore step destroys the formatted-data of the original clipboard contents #834 rich clipboard restoration. This PR fixes a separate [macOS] Dictation pastes twice / previous clipboard not available — 1.7.3 raised the restore delay 450ms → 2000ms #1023 timing regression; if fix: preserve rich clipboard formats on restore #1020 lands first, I will rebase this branch before requesting review.