sessions: feat: support nested session drag-and-drop - #336448
Draft
Ulugbek Abdullaev (ulugbekna) wants to merge 1 commit into
Draft
Ulugbek Abdullaev (ulugbekna) wants to merge 1 commit into
Ulugbek Abdullaev (ulugbekna) wants to merge 1 commit into
Conversation
Copilot started reviewing on behalf of
Ulugbek Abdullaev (ulugbekna)
September 16, 2026 16:18
View session
Ulugbek Abdullaev (ulugbekna)
changed the base branch from
main
to
ulugbekna/nested-session-hierarchy
September 16, 2026 16:19
This was referenced Sep 16, 2026
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Keyboard-accessible reordering and positive creator-linked ungrouping coverage are missing.
Get a fresh assessment by requesting another Copilot review.
Review effort: Balanced
Findings: 1
Open (2)
What changed in this PR
Adds hierarchy-aware drag-and-drop ordering for nested sessions.
Changes:
- Reorders sessions only among displayed siblings.
- Models group changes before showing positional feedback.
- Preserves positioning for dragged sessions hidden by presentation caps.
| File | Description |
|---|---|
src/vs/sessions/SESSIONS_LIST.md |
Documents sibling reordering. |
src/vs/sessions/contrib/sessions/browser/views/sessionsList.ts |
Implements hierarchy-aware drop validation and ordering. |
src/vs/sessions/contrib/sessions/test/browser/sessionsList.test.ts |
Adds group-drop, cap, and sibling-reorder regressions. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+4004
to
+4005
| const targetParent = parentByChildSessionId.get(target.sessionId); | ||
| if (dragged.some(session => parentByChildSessionId.get(session.sessionId) !== targetParent)) { |
Comment on lines
2151
to
+2152
| for (const relationship of ['unrelated', 'siblings', 'parent'] as const) { | ||
| test(`keeps ${relationship} creator-linked group moves non-positional`, () => { | ||
| test(`uses prospective ${relationship} relationships for group-drop positioning`, () => { |
Ulugbek Abdullaev (ulugbekna)
force-pushed
the
ulugbekna/nested-session-hierarchy
branch
from
September 16, 2026 18:22
f08f0e2 to
203821a
Compare
Reorder siblings across repositories, evaluate prospective hierarchy when changing groups, and preserve positional insertion for incoming sessions beyond presentation caps. Keep unsupported group moves membership-only. Co-authored-by: Copilot App <[email protected]>
Ulugbek Abdullaev (ulugbekna)
force-pushed
the
ulugbekna/nested-agent-sessions
branch
from
September 16, 2026 18:28
a55fd87 to
406b896
Compare
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
Allow meaningful drag-and-drop ordering within the new independent-session hierarchy, including siblings working in different repositories and sessions moving into or out of custom groups.
This draft is part 4 of 4 and is based on #336447. It contains only the drag-and-drop increment; the preceding draft introduces the tree with conservative root-only reorder guards.
Reorder siblings without changing their creator
Require dragged sessions to share the target's displayed parent. Preserve the existing pin and group restrictions, and retain workspace scoping for ungrouped roots. Nested siblings can be reordered even when their own repositories differ.
Apply ordering through the existing list-owned sort-key service. This does not rewrite provider timestamps or creator references, move files, change repositories, or permit arbitrary reparenting.
Make group-drop feedback describe the resulting tree
Joining or leaving a custom group can change whether a session appears beneath its creator. Build a hypothetical hierarchy for that membership change before deciding whether a before/after position is valid. Joining a group also models the unpinning performed by the real operation.
If the dragged sessions and target will be siblings, permit positional insertion. Otherwise, retain the valid group-membership operation but omit the positional cue rather than promising an impossible placement. Drag feedback and the drop use the same target-resolution rules.
Reuse the hypothetical hierarchy while the current hierarchy, dragged session objects/order, and destination group remain unchanged. Normal list updates invalidate this short-lived preview cache; it is not persisted parent state.
Preserve requested positions through presentation limits
A newly grouped, older session may initially sort behind Show More before its new position is assigned. Include the explicitly dragged sessions alongside visible candidates, then restrict them to the applicable sibling/pin/group/workspace scope. Preserve the dragged block's relative order when assigning sort keys, rather than silently skipping an incoming session hidden by the cap.
Coverage
Regressions cover cross-repository sibling reorder, rejected cross-branch reorder, prospective sibling versus parent/unrelated group-drop outcomes, and an incoming root whose old sort key places it beyond the destination cap. After the review fix and restack, the complete stack's 228 focused tests and client typecheck pass on Electron 43.6.0.
For manual review, reorder two children of the same parent, try a cross-branch reorder, move creator-linked sessions between groups, and move an older session before a visible row in a capped group. The drop cue should agree with the resulting position; unsupported positions must remain membership-only.
Stack
Part 4 of 4. Base: #336447. All PRs are drafts; review and merge bottom-up. Original commit labels are retained below; PR 1 also contains its test-only review follow-up.