Repository navigation
fix: restore the clipboard after reply_to_email (#106) - #111
Merged
Merged
Conversation
…first The reply script's "Restore clipboard" block sat after `return outputText` (and the error path returned early too), so it never ran and every reply left the body on the user's clipboard. All paths now fall through to the restore before returning. forward_email's error path also restores the clipboard when a message note was pasted. Fixes #106 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…pboard In open mode nothing follows the paste, so the restored clipboard was written back only 0.5s after Cmd+V. If Mail handles the keystroke late, the paste could pick up the restored clipboard instead of the reply body. Open mode now waits another 0.5s, matching send and draft, which both spend that delay before send/close. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Opened by Claude (AI assistant) on Patrick's behalf.
Fixes #106
What
reply_to_email's AppleScript put the "Restore clipboard" block afterreturn outputText, and itson errorbranch returned early too, so the restore never ran. Every reply (send, draft or open) left the reply body on the user's clipboard.reply_to_email: the error path now setsoutputTextinstead of returning. Thetellblock falls through to the restore, which is followed by a singlereturn outputText.forward_email(withmessage): the success path already restored the clipboard. The error path now restores it too, insidetrybecauseoldClipis undefined if the failure happens before the paste._send_html_emailrestores before its return already. It has no AppleScripton error, so a mid-script failure still skips the restore. That isn't touched here.Tests
ClipboardRestoreTestsintests/test_compose_tools.py, mock-level like the existing ones:returnbefore the restore, and onlyreturn outputTextafter it;Full suite: 123 passed (venv,
mcp<2pinned until #104 lands). Nothing was run against the real Mail.app.🤖 Generated with Claude Code