Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds first-class support for attaching integrated browser tabs/pages as chat context, enabling explicit “attach” flows that can trigger page sharing and show browser attachments consistently alongside other attachment types.
Changes:
- Introduces a new
browserViewchat variable entry kind and corresponding attachment widgets/rendering paths. - Adds browser-aware attachment resolution (including prompting to share the page with the agent).
- Extends implicit context rendering to recognize browser resources and show proper labels/icons.
Show a summary per file
| File | Description |
|---|---|
| src/vs/workbench/contrib/chat/common/attachments/chatVariableEntries.ts | Adds IBrowserViewVariableEntry and type guard; extends variable entry union. |
| src/vs/workbench/contrib/chat/browser/widget/media/chat.css | Tweaks text-decoration behavior to support strikethrough inheritance for attachment labels. |
| src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.ts | Renders browserView attachments in the input attachment pills via BrowserViewAttachmentWidget. |
| src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAttachmentsContentPart.ts | Renders browserView attachments in the chat transcript attachments area. |
| src/vs/workbench/contrib/chat/browser/attachments/implicitContextAttachment.ts | Adds browser implicit-context label rendering (globe icon + live label updates). |
| src/vs/workbench/contrib/chat/browser/attachments/chatImplicitContext.ts | Suggests active browser tab as implicit context and adjusts implicit-entry export behavior. |
| src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentWidgets.ts | Implements BrowserViewAttachmentWidget for browser attachments (status, hover, open behavior). |
| src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentResolveService.ts | Resolves browser view attachments and prompts to share when needed. |
| src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentModel.ts | Routes vscodeBrowser URIs through the attachment resolve service when adding files. |
| src/vs/workbench/contrib/chat/browser/actions/chatContextActions.ts | Enables attaching browser resources from the “Attach Context” quick pick flow. |
| src/vs/workbench/contrib/browserView/common/browserEditorInput.ts | Adds onDidResolveModel and isSharingAvailable helpers to support attachment UI behavior. |
Copilot's findings
Comments suppressed due to low confidence (1)
src/vs/workbench/contrib/chat/browser/attachments/implicitContextAttachment.ts:259
- renderBrowserResource() sets the label text/icon but doesn’t reflect whether the implicit context is disabled (e.g. via label strikethrough). After the CSS change, the disabled state may no longer be obvious for browser implicit context. Consider accepting an
enabled(ordisabled) parameter and settingstrikethrough/title consistently with the file branch.
private renderBrowserResource(browserUri: URI, label: IResourceLabel, contextNode: HTMLElement): string | undefined {
const id = BrowserViewUri.getId(browserUri);
const input = id && this.browserViewService.getKnownBrowserViews().get(id);
if (!input) {
return undefined;
}
const update = () => {
label.setLabel(input.getName(), undefined, { iconPath: Codicon.globe });
contextNode.ariaLabel = localize('chat.implicitBrowserContext', "Suggested browser context, {0}", input.getName());
};
- Files reviewed: 11/11 changed files
- Comments generated: 8
Contributor
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: @jrualesMatched files:
|
Yoyokrazy
approved these changes
Apr 29, 2026
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.
Closes #312169