Repository navigation
fix(commands): copy commands say when the clipboard refused (#1250 row 9) - #1421
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…w 9) Copy Last Response awaited nothing and always said Copied; it now awaits the write and shows a fixed failure sentence on rejection. Copy Resume Command's failure uses the same sentence instead of the raw DOMException text. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e shared sentence (#1421 review) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
Author
Review disposition, round 1 (head
|
| Finding | Disposition |
|---|---|
a1: a refused copy reports ran to commands.run callers |
Declined. Throwing would make runGuarded add its own "Command failed: " toast, so every human path would get two messages for one failure. The commands.run contract already says ran means only that the dispatcher returned, and tells the caller to observe the app. |
| a2: nothing pinned that the command stays pending until the write settles | Fixed. A deferred-write test: the command is not settled and silent before the write, then says "Copied". It fails with a fire-and-forget .then. |
| b1: Browser Pocket's pick (no composer) swallowed a refused write and said "Element copied" | Fixed: it says the refusal. The test in pick.renderer.test.ts fails on the old pick. |
| b2 / c1: the wording was compared against the constant only | Fixed: it is asserted literally. |
| c2: the assistant-message picker and the code-block picker said "Clipboard write failed" | Fixed: both use the shared sentence. The constant moved to lib/clipboardFailure.ts. |
| c3 (nit): "red on main" is true suite-level; the success case is green by design | Acknowledged; the body says which tests are red. |
Verification:
npx tsc -b: clean.features/workspace/commands,features/browser-pocket,workspace/hook/actionsanduseKeybinds: 452/452.
🤖 Generated with Claude Code
This was referenced Sep 27, 2026
Juliusolsson05
added a commit
that referenced
this pull request
Sep 27, 2026
pick.renderer.test.ts: keep #1421's refused-copy test and this PR's cancelled pick, which now resolves { kind: 'cancelled' } rather than null. pick.ts auto-merged with both the outcome handling and the checked clipboard write. 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.
Refs #1250 (row 9). #1250 is a batch issue, so the other rows stay open.
Problem
paneCommands.ts) wrote to the clipboard fire-and-forget and then always showed "Copied to clipboard". When Electron refused the write (for example, the document is not focused after the palette or a context menu), the rejection went unhandled, under a toast that claimed the opposite.sessionCommands.ts) caught its failure but showedcopy failed: <DOMException message>: raw browser text (q22).Change
lib/clipboardFailure.ts.Plan:
docs/plans/2026-09-27-copy-last-response-failure.md.Tests (the failure cases are red on main; the success case is green by design)
New
copyCommands.clipboard.renderer.test.tsruns the real commands. The runtime entries are the recorded rendering bundle2026-05-20T19-11-51-193-d4a44a16; the clipboard is the one stubbed edge.pick.renderer.test.ts: a refused pick copy says so and never "Element copied".Verification
rm -rf .tsc-out; npx tsc -b: clean.NODE_ENV=test npx vitest runonfeatures/workspace/commands,features/browser-pocket,workspace/hook/actionsanduseKeybinds: 452/452.🤖 Generated with Claude Code