Show attachments toolbar for implicit context in Ask mode and selections#296630
Merged
daviddossett merged 3 commits intomainfrom Feb 20, 2026
Merged
Show attachments toolbar for implicit context in Ask mode and selections#296630daviddossett merged 3 commits intomainfrom
daviddossett merged 3 commits intomainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the chat input UI so the attachments toolbar is shown not only for explicit attachments, but also when “implicit context” (active editor context in Ask mode and editor selections) is present, making that context visible and actionable from the toolbar.
Changes:
- Adds rendering of
ImplicitContextAttachmentWidgetinrenderAttachedContext()when implicit context values are present. - Updates attachments container visibility logic to consider implicit context in addition to explicit attachments.
Comments suppressed due to low confidence (1)
src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.ts:2411
ImplicitContextAttachmentWidgetmutates properties on the DOM node passed to it (e.g. setsariaLabel/tabIndexon itsdomNodewhen rendering resources). PassingattachedContextContainerhere means those attributes can be applied to the shared container that also holds explicit attachment widgets, which can introduce an unexpected tab stop and confusing screen reader output. Consider creating a dedicated child container for implicit context content and passing that element to the widget instead of the sharedattachedContextContainer.
const implicitContextWidget = this.instantiationService.createInstance(
ImplicitContextAttachmentWidget,
() => this._widget,
isAttachmentAlreadyAttached,
this._implicitContext,
this._contextResourceLabels,
this._attachmentModel,
container,
);
hediet
approved these changes
Feb 20, 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.
Summary
Shows the attachments toolbar when implicit context is visible, specifically:
The toolbar remains hidden in Agent mode when there's no selection and no explicit attachments.
Changes
chatInputPart.ts:ImplicitContextAttachmentWidgetandRange/IRangerenderAttachedContext(), instantiate theImplicitContextAttachmentWidgetwhen there are visible implicit context values (enabled entries in Ask mode, or selections)attachmentsContainerandattachedContextContainervisibility