Repository navigation
sessions: reorder sessions by drag and drop in workspace, repository and environment sections - #344939
Merged
Sandeep Somavarapu (sandy081) merged 3 commits intoOct 29, 2026
Conversation
…and environment sections With Move Chats drag and drop on, dropping a session on another session's top edge (or the bottom edge of a section's last row) only placed it in Pinned and custom groups; in workspace, repository and environment sections every edge nested it into the target session. Treat those sections as manually ordered too, as the list's reorder scope already does. Date sections keep nesting on every edge. Regressed in #342624. Co-authored-by: Copilot <[email protected]>
…ession-reordering-workspace # Conflicts: # src/vs/sessions/contrib/sessions/test/browser/sessionsListChatMoveDnd.test.ts
Christof Marti (chrmarti)
previously approved these changes
Oct 29, 2026
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The added tests cover only Workspace grouping, leaving changed Repository and Environment behavior without regression coverage for edge placement and middle-row nesting.
1 open issue
What changed in this PR
Restores drag-and-drop session reordering in workspace, repository, and environment sections of the Agents window, while preserving middle-row nesting.
Changes:
- Recognizes these sections as manually ordered when choosing between reordering and nesting.
- Adds workspace regression cases for both insertion edges and retains Date-section nesting tests.
- Updates comments to describe the expanded reorder scope.
| File | Description |
|---|---|
src/vs/sessions/contrib/sessions/test/browser/sessionsListChatMoveDnd.test.ts |
Adds configurable grouping and workspace drag-and-drop coverage. |
src/vs/sessions/contrib/sessions/browser/views/sessionsListChatMove.ts |
Updates comments describing manually ordered sections. |
src/vs/sessions/contrib/sessions/browser/views/sessionsList.ts |
Includes workspace, repository, and environment sections in edge-reorder eligibility. |
Review effort: Balanced
Co-authored-by: Copilot <[email protected]>
Benjamin Christopher Simmonds (benibenj)
approved these changes
Oct 29, 2026
Dmitriy Vasyura (dmitrivMS)
approved these changes
Oct 29, 2026
Sandeep Somavarapu (sandy081)
deleted the
sandy081/agents/fix-session-reordering-workspace
branch
October 29, 2026 10:46
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.

Problem
In the Agents window, dragging a session by its edge works in Pinned and custom groups but not in a workspace folder of the sessions list. This happens with Move Chats drag and drop on (
chat.agentHost.moveChats.enabled). In a workspace folder, every drop on another session's row moved the dragged session into that session instead of reordering it, including the top quarter and the bottom quarter of the section's last row.Root cause
getSessionsListSessionDropplaces a session before/after the target only whenisManuallyOrdered()is true.SessionsListanswered that throughisInManuallyOrderedSection, which only counted pinned sessions and custom-group members. The list's own reorder scope (getReorderScope) treats workspace, repository and environment sections as manually ordered too. So in those sections the edge zones always fell through to nesting.Regressed in #342624, which introduced session nesting by drag and drop. Before it,
canReorderOntoallowed reordering inside workspace sections. Its tests only covered Date grouping.Fix
isInManuallyOrderedSectionalso returns true when the session's own section (when it isn't pinned or in a group) is a workspace, repository or environment section. Date sections keep nesting on every edge, as before. External and Quick Chats sections are unchanged.Tests
sessionsListChatMoveDnd.test.ts: the test list can now use a grouping other than Date. Both edge-placement tests now cover workspace, repository (owner/project) and environment (local) sections, alongside Pinned and custom groups. The top-quarter test also checks that a drop on the middle of a row still nests. The Date-section test is renamed to "in date sections, a session row only nests, at every edge".reordered: 0, nest feedback); with the fix, they pass../scripts/test.sh --runGlob "vs/sessions/contrib/sessions/test/**/*.test.js": passed (1119 passing after merging main).npm run typecheck-client: passed.npm run eslinton the changed files: passed. Hygiene: passed (pre-commit).Live validation
Validated in the Agents window of the Code - OSS dev build (
--agents) against a local mock agent host (agentHostServerMain.js --enable-mock-agent). The scenario creates three sessions in one workspace folder:Repository and environment sections, Date sections, and restart (the order uses the existing sort-key storage) are covered by unit tests only; they were not replayed live.
Performance
The change adds one section-id lookup (
getUngroupedSectionIds(session)[0]) per drag-over on a single dragged session. It is not on a rendering or list-update path, and adds no listeners, storage or I/O. Assessed by inspection; not measured.Review
getSessionsListSessionDrop, is fixed.repository:andenvironment:sections.How to test
chat.agentHost.moveChats.enabled.