Repository navigation
Support video and native context-menu media paste in Markdown - #341552
Merged
Merged
Conversation
Accept image, video, and audio payloads through existing file/snippet infrastructure, consume native clipboard data directly, and report unsupported file-only formats explicitly. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The locked dependency cannot deliver context-menu payloads, tests are not wired into CI, and large media transfers are unbounded.
3 open findings
What changed in this PR
Extends Markdown custom-editor clipboard paste from images to image, video, and audio media while preserving native metadata and bytes.
Changes:
- Adds native clipboard media classification.
- Reuses existing media file creation and embed generation.
- Adds host and classifier tests for supported and invalid media.
| File | Description |
|---|---|
src/test/markdownEditorImagePaste.test.ts |
Tests video/audio creation and validation. |
src/preview/markdownEditorImagePaste.ts |
Accepts media MIME types and updates messages. |
scripts/clipboardMedia.test.mts |
Tests native clipboard classification. |
markdown-editor-src/imagePasteController.ts |
Processes native and async clipboard media. |
markdown-editor-src/clipboardMedia.ts |
Classifies supported native media files. |
🧠 Review effort: Balanced
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Remember the last focused content element and restore it synchronously when a host menu action targets the webview body, preserving existing focused inputs and ignoring disconnected elements. Update the webview shell CSP hash and add regressions. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
roblourens
previously approved these changes
Oct 14, 2026
Request clipboard bytes sequentially through file handles, keep each base64 response bounded to 256 KiB of file data, and release renderer handles after each paste. Run native clipboard and transfer regressions in PR CI. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
Pin @vscode/markdown-editor 0.0.2-127, published from 3966f6f0, so clean checkouts receive the native clipboard callback and context-menu focus handling. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Henning Dieterichs (hediet)
enabled auto-merge
October 14, 2026 18:38
Ladislau Szomoru (lszomoru)
approved these changes
Oct 15, 2026
Anthony Kim (anthonykim1)
approved these changes
Oct 15, 2026
Eric Dallo (ericdallo)
added a commit
to editor-code-assistant/eca-webview
that referenced
this pull request
Oct 22, 2026
VS Code 1.143 refocuses a webview's last focused element before running clipboard commands whenever <body> is active (microsoft/vscode#341552). Selecting message text leaves focus on <body> and the last focused element is usually the prompt textarea, so Cmd/Ctrl+C and context-menu Copy moved focus there, wiping the selection and copying nothing. Make the messages scroller click-focusable (tabIndex -1, kept out of the Tab order) so selecting text focuses it instead and VS Code leaves the selection alone. It stays on the scroller itself since a focusable ancestor would break arrow/Page-key scrolling. Reported upstream as microsoft/vscode#343489. 🤖 Generated with [ECA](https://eca.dev) (nubank-anthropic/opus-5.5 - max) Co-Authored-By: eca-agent <git@eca.dev>
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
Companion clipboard strategy: https://github.com/microsoft/vscode-packages/pull/363. Media support compiles against published editor types; complete context-menu behavior requires that package change to be published and adopted. Local file-linked development dependencies are deliberately excluded from this PR.
Validation
The first CI run's full ESLint process was killed with exit 137. Targeted lint passed; the focus follow-up starts a fresh CI run.