Repository navigation
sessions: support nested custom groups - #343024
Merged
Benjamin Christopher Simmonds (benibenj) merged 6 commits intoOct 20, 2026
Merged
Benjamin Christopher Simmonds (benibenj) merged 6 commits into
Benjamin Christopher Simmonds (benibenj) merged 6 commits into
Conversation
Custom groups in the sessions list can now contain other custom groups at any depth. A group lists its subgroups above its own sessions, and each nesting level steps in so that a subgroup's header starts where its parent's label does while sessions line up with their own group's header. A group's context menu offers Create Subgroup, Create Group on sessions that share a group nests the new group there, and Add to Group names nested groups by their path. Mark All as Done and Mark All as Read on a group include its subgroups' sessions, and a collapsed group's status reflects them too. Deleting a group deletes its subgroups; when that deletes several groups, an Undo notice restores the groups, their order, and their sessions. Groups can be dragged into another group, or before or after any header among its siblings, never into themselves or their subgroups, and the insertion line starts at the depth where the group lands. The groups service owns the hierarchy and its invariants, and the section order service now orders siblings at every level. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot started reviewing on behalf of
Benjamin Christopher Simmonds (benibenj)
October 20, 2026 20:48
Contributor
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: Sandeep Somavarapu (@sandy081)Matched files:
Ladislau Szomoru (@lszomoru)Matched files:
|
Contributor
Screenshot ChangesBase: Added (11) |
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Ordering isolation, standalone-chat alignment, and keyboard access to group movement need correction before approval.
3 open issues
What changed in this PR
Adds nested custom groups to the Agents window sessions list, extending its grouping, ordering, and persistence model.
Changes:
- Adds group hierarchies, subtree deletion, and Undo restoration.
- Updates rendering, menus, bulk actions, and drag-and-drop for nested groups.
- Adds regression tests, visual fixtures, and accessibility documentation.
| File | Description |
|---|---|
| src/vs/sessions/SESSIONS_LIST.md | Documents nesting and ownership contracts. |
| src/vs/sessions/services/sessions/test/browser/sessionSectionOrderService.test.ts | Tests order restoration. |
| src/vs/sessions/services/sessions/test/browser/sessionGroupsService.test.ts | Tests hierarchy, persistence, and restoration. |
| src/vs/sessions/services/sessions/test/browser/sessionComparisonService.test.ts | Updates deletion mock contract. |
| src/vs/sessions/services/sessions/browser/sessionSectionOrderService.ts | Captures and restores header positions. |
| src/vs/sessions/services/sessions/browser/sessionGroupsService.ts | Implements hierarchy and subtree operations. |
| src/vs/sessions/contrib/sessions/test/browser/sessionsListTestUtils.ts | Records group creation and movement. |
| src/vs/sessions/contrib/sessions/test/browser/sessionsListFixtureUtils.ts | Supports nested fixtures and drag simulation. |
| src/vs/sessions/contrib/sessions/test/browser/sessionsListContextMenu.test.ts | Tests subgroup menus and path labels. |
| src/vs/sessions/contrib/sessions/test/browser/sessionsList.test.ts | Tests nested rendering and drops. |
| src/vs/sessions/contrib/sessions/test/browser/sessionsList.fixture.ts | Adds nested-group visual scenarios. |
| src/vs/sessions/contrib/sessions/test/browser/sessionsArchiveActions.test.ts | Tests subtree bulk actions and deletion Undo. |
| src/vs/sessions/contrib/sessions/browser/views/sessionsViewActions.ts | Adds deletion Undo and subtree actions. |
| src/vs/sessions/contrib/sessions/browser/views/sessionsList.ts | Integrates nested groups into list interactions. |
| src/vs/sessions/contrib/sessions/browser/media/sessionsList.css | Adds nesting and insertion-line indentation. |
| src/vs/sessions/contrib/chat/browser/sessionsChatAccessibilityHelp.ts | Explains nested-group operations. |
| src/vs/sessions/common/sessionCommands.ts | Defines the deletion-with-Undo command. |
| build/lib/stylelint/vscode-known-variables.json | Registers nesting CSS variables. |
Review effort: Balanced
Alexandru Dima (alexdima)
previously approved these changes
Oct 20, 2026
The groups service now stores the order of each group's subgroups with the groups, and moveGroup(groupId, parentId, placement) nests and places a group in one change. The section order keeps only the list's top-level headers. Sharing one flat order between every set of siblings let moving a group reorder unrelated groups, for example swap two top-level groups when a third was nested. - Deleting groups captures, and Undo restores, their positions inside the service, so the delete command no longer reaches into the section order. - The service owns the group section id scheme and exposes the ordered group tree, which the list reads instead of rebuilding trees and resolving the order of subgroups itself. - The list has one nesting policy and one row depth method. A done chat that is listed in the Done section no longer steps in for its session's group. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Alexandru Dima (alexdima)
previously approved these changes
Oct 20, 2026
roblourens
previously approved these changes
Oct 20, 2026
The nested group path label uses "›" as its separator, which the hygiene unicode check rejects unless the line opts in. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Benjamin Christopher Simmonds (benibenj)
dismissed stale reviews from roblourens and Alexandru Dima (alexdima)
via
October 20, 2026 21:34
4fab110
Alexandru Dima (alexdima)
previously approved these changes
Oct 20, 2026
Resolve the conflict with #342848 in sessionsList.test.ts by keeping both new suites, and persist bulk group collapse state under the shared group section id. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Benjamin Christopher Simmonds (benibenj)
enabled auto-merge
October 20, 2026 22:37
Dmitriy Vasyura (dmitrivMS)
previously approved these changes
Oct 20, 2026
Bring in grouping by repository (#342997). Repository sections join the top-level header order next to workspace sections, so the nesting-aware header drop treats them as top-level headers too, and promotes a moved repository section like a workspace section. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Drag a top-level group and then a subgroup through the list with the real groups and section order services, starting from a stored order that mixes the levels like the one the first version of nested groups wrote. Each group's subgroups keep their own order. The drag helper is shared with the existing nested drag test. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Alexandru Dima (alexdima)
approved these changes
Oct 20, 2026
Benjamin Christopher Simmonds (benibenj)
merged commit Oct 20, 2026
f75da50
into
main
58 checks passed
Benjamin Christopher Simmonds (benibenj)
deleted the
agents/sessions-list-nested-custom-groups
branch
October 20, 2026 23:43
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.


What changed
Nested custom groups
Drag and drop
Design notes for reviewers
ISessionGroupgains an optionalparentId.ISessionGroupsServiceowns the hierarchy, the order of each group's subgroups, and their invariants:createGroup(name, members, parentId). A new subgroup comes first among its siblings.moveGroup(groupId, parentId, placement?)nests a group and places it next to a sibling, or first, in one change and one event. It refuses moves that would create a cycle.deleteGroupdeletes the subtree and returnsIDeletedSessionGroups, which includes the deleted groups' positions.restoreGroupsbrings back the groups, their positions, and the sessions' membership.getTree()returns aSessionGroupTree, a cycle-safe read-only view (getSubgroups,getPath,getSubtree,canMove) in the user's order at every level.ISessionSectionOrderServicekeeps only the list's top-level headers, where groups share one order with workspace sections, so the list still arranges them. The list prunes groups from it once they are nested.capturePositions(ids)andrestorePositions(positions), so that Undo restores a top-level group's position.ISessionGroupItemgainsdepthandsubtreeSessions.isEmptynow also requires the group to have no subgroups.--session-group-depthCSS variable on their row container. One CSS rule turns it intomargin-left. Done chats listed in the Done section don't step in.getHeaderDrop), and the list applies it (moveHeader). This replaces the top-level-onlyreorderSection.topLevel, where the list reorders its headers; as asubgroup, with anISessionGroupPlacementformoveGroup; orintoa group.sessionsViewPane.deleteSessionGroupWithUndo, registered insessionsViewActions.tslike the archive-with-undo command, so the view can show the notice. The command only callsdeleteGroupand, on Undo,restoreGroups.SESSIONS_LIST.mddocuments the changed ownership, ordering, nesting, drag-and-drop, and persistence contracts.This PR is independent of #342997 (grouping by repository). Both change the header drag-and-drop code in
sessionsList.ts, so whichever merges second needs a small rebase.How to test
sessions.list.showUnreadInCollapsedSections, then collapse a subgroup that contains an unread or waiting session. Its header shows that status.Validation
npm run eslint -- <15 changed TypeScript files>: passed, with no warnings or errors.npm run stylelint -- src/vs/sessions/contrib/sessions/browser/media/sessionsList.css: passed. The new CSS variables are registered invscode-known-variables.json. The file's 3 design-token suggestions also appear onmain.npm run typecheck-client: no errors insrc/vs/sessions. My local checkout reports 134 unrelated errors in agent host Copilot code and an editor test, caused by outdated@github/copilot-sdkand sinon installs.npm run valid-layers-check: no findings insrc/vs/sessions. Locally the command fails on 93 errors insrc/vs/platform/agentHost/node, caused by the same outdated installs and a missing@hpke/core.npm run transpile-client: passed.node --experimental-strip-types build/hygiene.ts <18 changed files>: passed. The first CI run failed hygiene on the›path separator, which now opts in with// allow-any-unicode-next-line.npm run check-cyclic-dependencies: passed, no cyclic dependencies.test/unit/electron/index.js, which./scripts/test.shlaunches):--runGlob "**/sessions/**/test/**/*.test.js"gave 7420 passing, 23 pending.reorderhelpers swaps the two remaining top-level groups after nesting the third. The new test expects them to keep their order.SessionsList_NestedGroups*fixtures: expanded tree, Time grouping, collapsed subgroup status, Create Subgroup editor, hovered subgroup header, context menu, drag into a group, drag before a subgroup, deep nesting, compact, and phone. After the ordering change, the default, Time grouping, drag before a subgroup, and deep nesting fixtures still match their descriptions.sessions/sessionsListfixtures render without errors.report-questioncodicon doesn't render because my outdated codicon font lacks it. This also affects existing fixtures.