Feat/auto copy last code block element - #800
Open
AryanNandanwar wants to merge 4 commits into
Open
Conversation
AryanNandanwar
requested review from
Avtrkrb,
akramcodez and
will-lamerton
as code owners
August 5, 2026 19:26
Author
|
I'll update it with the changeset |
AryanNandanwar
marked this pull request as draft
August 6, 2026 18:05
AryanNandanwar
marked this pull request as ready for review
August 6, 2026 18:06
Author
|
Hey @akramcodez Please review this when you get the time. |
Collaborator
|
Hi @AryanNandanwar, thanks for taking this on and for the detailed PR description! I reviewed the code and noticed a major discrepancy between the plan you outlined in the issue thread and the actual implementation in this PR. 1. Architecture Flaw: Backend vs. Frontend Clipboard
2. Unrelated File Commits
3. Test Coverage
Once the clipboard logic is moved to |
Author
|
Thanks for the feedback@akramcodez ! I'll update the PR accordingly |
Co-authored-by: Cursor <cursoragent@cursor.com>
AryanNandanwar
force-pushed
the
feat/auto-copy-last-code-block-element
branch
from
August 8, 2026 13:46
048f98a to
0d2ee7d
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
Adds a keyboard-friendly way to copy AI output from the Nanocoder VS Code chat webview (closes #759).
In the sidebar chat you can:
/copyto copy the last full assistant response to the clipboard/copy codeto copy only the last fenced code block (<pre><code>in the messages DOM)Copy is scoped to assistant messages only (via an
agent-markdownmarker), so user echoes and thought boxes are ignored. The webview finds the text; the extension host writes it withvscode.env.clipboard.writeTextand shows a short in-webview toast.The chosen hotkey avoids conflicts with VS Code’s
Ctrl+Shift+C(external terminal) and Cursor’sCtrl+Alt+C(confetti). Terminal CLI/copybehavior is unchanged.Type of Change
Changeset
pnpm changeset) describing this change for the changelogDocs-only or internal chores need no changeset (or run
pnpm changeset --emptyto note that intentionally).Testing
Automated Tests
.spec.ts/tsxfilespnpm test:allcompletes successfully)(Webview UI lives under
plugins/vscode/, which is outside the root AVA/Biome suite; verified via TypeScript check, extension build, and manual testing below.)Manual Testing
Manual checks:
/copycopies the last full assistant response/copy codecopies the last fenced code block (indentation preserved, no extra trailing blank line)pnpm run build:vscode)Checklist