Add Copy Button to Hover Content#271990
Merged
benvillalobos merged 18 commits intomicrosoft:mainfrom Oct 29, 2025
Merged
Conversation
Remove fading animation, increase font size Set pointer-events auto on .hover-copy-button Set button opacity to 1 when showing
Nits Test not showing on color picker Revert "Test not showing on color picker" This reverts commit 9637876. Remove all uses of opacity Nit: remove comment Remove comment
…may want to plug into AI Use dom.show and hide Hover copy button: Apply css class instead of manually applying attributes Nits: Remove hover css and remove empty line Remove redundant codicon class assignment
Simplify tooltip Remove one line fn Remove z index Use helper fn for keydown event Use clickaction helper Add jsdoc The copy button should add the class to its container
Contributor
There was a problem hiding this comment.
Pull Request Overview
Adds a copy button to marker hover parts so users can copy hover content via click or keyboard (Enter/Space). Key changes:
- Introduces HoverCopyButton component and integrates it into marker hover rendering.
- Adds CSS for conditional visibility and styling of the copy button.
- Adds unit tests for presence and interaction (click and keyboard) of the copy button.
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/vs/editor/contrib/hover/browser/hoverCopyButton.ts | Implements the HoverCopyButton logic and accessibility attributes. |
| src/vs/editor/contrib/hover/browser/contentHoverWidgetWrapper.ts | Wires clipboard service through to rendered hover parts. |
| src/vs/editor/contrib/hover/browser/contentHoverRendered.ts | Integrates copy button into marker hover parts using accessible content source. |
| src/vs/editor/contrib/hover/browser/hover.css | Adds layout and visibility rules for copy button. |
| src/vs/editor/contrib/hover/test/browser/hoverCopyButton.test.ts | Adds tests for creation and interaction of the copy button. |
src/vs/editor/contrib/hover/test/browser/hoverCopyButton.test.ts
Outdated
Show resolved
Hide resolved
aiday-mar
approved these changes
Oct 29, 2025
dmitrivMS
pushed a commit
that referenced
this pull request
Oct 29, 2025
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Fixes #209415
Adds a copy button to all
MarkerHovers. This includesInfo,Hint,Warning, andErrorhovers (anything with a code included in the message).Known Issues
getAccessibleContent(the method that extracts text out of hovers) does not includeadditionalInformation. See in the video how the second copy does not include the second linecopy.mp4