-
Notifications
You must be signed in to change notification settings - Fork 37.4k
Agent sessions: support multi-select for mark read/unread and archive/unarchive #288449
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…ve/unarchive operations Co-authored-by: bpasero <900690+bpasero@users.noreply.github.com>
There was a problem hiding this 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 PR enables multi-select support for the agent sessions tree view, allowing users to perform batch operations on multiple sessions simultaneously. The implementation follows standard file explorer multi-select patterns with Ctrl/Cmd+click and Shift+click gestures.
Changes:
- Enabled multi-select support in the tree control and extended context handling to pass selected sessions
- Refactored mark read/unread and archive/unarchive actions to iterate over multiple sessions
- Added context key tracking for multi-selection state and appropriate preconditions for single-session operations
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| src/vs/workbench/contrib/chat/common/actions/chatContextKeys.ts | Adds new context key to track when multiple agent sessions are selected |
| src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsModel.ts | Extends IMarshalledAgentSessionContext with sessions array for multi-selection support; includes label splitting defensive fix |
| src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsControl.ts | Enables multipleSelectionSupport in tree config and updates context menu to pass all selected sessions |
| src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsActions.ts | Refactors BaseAgentSessionAction from runWithSession to runWithSessions to handle batch operations; adds precondition to rename action |
Comments suppressed due to low confidence (1)
src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsModel.ts:170
- The sessions field should be marked as optional with a question mark since the code handles its absence with a fallback (context.sessions ?? [context.session]). This would make the TypeScript type definition match the runtime behavior and provide better type safety.
readonly sessions: IAgentSession[]; // support for multi-selection
src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsModel.ts
Show resolved
Hide resolved
src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsActions.ts
Show resolved
Hide resolved
src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsModel.ts
Show resolved
Hide resolved
src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsActions.ts
Show resolved
Hide resolved
…s with pending edits Co-authored-by: bpasero <900690+bpasero@users.noreply.github.com>
Co-authored-by: bpasero <900690+bpasero@users.noreply.github.com>
Enables multi-select support in the agent sessions tree view, allowing batch operations on multiple sessions at once.
Changes
multipleSelectionSupport: trueto enable standard multi-select gestures (Ctrl/Cmd+click, Shift+click)IMarshalledAgentSessionContextwithsessionsarray; context menu now passes all selected sessions when multiple are selectedBaseAgentSessionActionfromrunWithSessiontorunWithSessionsto iterate over all selected sessions for:context.sessions ?? [context.session]fallback for callers that don't provide the new fieldSelection behavior
Follows standard file explorer pattern: right-clicking a session in the current selection operates on all selected sessions; right-clicking outside the selection operates on only that session.
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.