Skip to content

Attach context feature for sessions dedicated window#296120

Merged
osortega merged 31 commits into
mainfrom
copilot-worktree-2026-02-18T21-00-40
Feb 19, 2026
Merged

Attach context feature for sessions dedicated window#296120
osortega merged 31 commits into
mainfrom
copilot-worktree-2026-02-18T21-00-40

Conversation

@osortega
Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI review requested due to automatic review settings February 18, 2026 21:41
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request adds file attachment functionality to the Agent Sessions window's new chat interface. Users can now attach files to their chat requests before sending them, similar to the functionality available in the standard VS Code chat interface.

Changes:

  • Added file attachment UI with a "+" button to select files via quick access picker
  • Implemented attachment pill rendering with remove functionality
  • Passed attached context through the request flow to the chat widget

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
src/vs/sessions/contrib/sessions/browser/sessionsManagementService.ts Updated sendLocalSession to accept and apply attachedContext from sendOptions to the chat widget's attachment model
src/vs/sessions/contrib/chat/browser/newChatViewPane.ts Added attachment UI (button, picker, pills), attachment state management, and integration with send request flow
src/vs/sessions/contrib/chat/browser/media/chatWidget.css Added CSS styling for attach button, attachment container, and attachment pills
Comments suppressed due to low confidence (2)

src/vs/sessions/contrib/chat/browser/newChatViewPane.ts:1087

  • The attachedContext is being duplicated - it's included both in sendOptions.attachedContext (line 1075) and as a separate field in the data object passed to onSendRequest (line 1087). This redundancy can lead to confusion and potential bugs if the two get out of sync.

Since sendOptions already contains attachedContext and is part of INewChatSendRequestData, the separate attachedContext field at line 1087 appears unnecessary. Consider removing line 1087 to avoid this duplication.

			attachedContext: this._attachedContext.length > 0 ? [...this._attachedContext] : undefined,
		};

		const folderUri = this._selectedFolderUri ?? this.workspaceContextService.getWorkspace().folders[0]?.uri;

		this._options.onSendRequest?.({
			resource,
			target,
			query,
			sendOptions,
			selectedOptions: new Map(this._selectedOptions),
			folderUri,
			attachedContext: this._attachedContext.length > 0 ? [...this._attachedContext] : undefined,

src/vs/sessions/contrib/chat/browser/newChatViewPane.ts:546

  • The remove button is missing keyboard support. While tabIndex and role are set, there's no KEY_DOWN event listener to handle Enter or Space key presses for users navigating via keyboard.

Add a keyboard event listener similar to the click handler to support accessibility, e.g., dom.addDisposableListener(removeButton, dom.EventType.KEY_DOWN, (e) => { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); this._removeAttachment(entry.id); } }).

			const removeButton = dom.append(pill, dom.$('.sessions-chat-attachment-remove'));
			removeButton.title = localize('removeAttachment', "Remove");
			removeButton.tabIndex = 0;
			removeButton.role = 'button';
			dom.append(removeButton, renderIcon(Codicon.close));
			this._register(dom.addDisposableListener(removeButton, dom.EventType.CLICK, (e) => {
				e.stopPropagation();
				this._removeAttachment(entry.id);
			}));

Comment thread src/vs/sessions/contrib/chat/browser/newChatViewPane.ts Outdated
Comment thread src/vs/sessions/contrib/chat/browser/newChatViewPane.ts Outdated
Comment thread src/vs/sessions/contrib/chat/browser/newChatViewPane.ts Outdated
Comment thread src/vs/sessions/contrib/chat/browser/newChatViewPane.ts
Comment thread src/vs/sessions/contrib/chat/browser/newChatViewPane.ts Outdated
osortega and others added 21 commits February 18, 2026 14:15
Removed filesView section from LAYOUT.md
Removed import for filesView contribution.
@osortega osortega marked this pull request as ready for review February 18, 2026 23:41
@osortega osortega changed the title Copilot worktree 2026 02 18 t21 00 40 Attach context feature for sessions dedicated window Feb 18, 2026
@vs-code-engineering vs-code-engineering Bot added this to the February 2026 milestone Feb 18, 2026
dmitrivMS
dmitrivMS previously approved these changes Feb 18, 2026
@osortega osortega merged commit 72f2323 into main Feb 19, 2026
18 checks passed
@osortega osortega deleted the copilot-worktree-2026-02-18T21-00-40 branch February 19, 2026 01:18
@vs-code-engineering vs-code-engineering Bot locked and limited conversation to collaborators Apr 5, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants