Repository navigation
canvases: feat: hide canvas-created sessions from the sessions list by default - #350587
Merged
Ulugbek Abdullaev (ulugbekna) merged 4 commits intoNov 26, 2026
Merged
Ulugbek Abdullaev (ulugbekna) merged 4 commits into
Ulugbek Abdullaev (ulugbekna) merged 4 commits into
Conversation
…y default Sessions started from the Canvases section are left out of the Sessions list by default while their canvas is pinned in the sidebar. They appear automatically once the user sends a message in the session or removes its last pinned canvas without marking it done, and can be shown or hidden explicitly from the pin context menu, canvas page header, or session context menu. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved visibility and recovery defects can leave sessions hidden without accessible pins, sync hidden state across devices without matching pins, and cause Undo to fail after session replacement.
4 open issues
What changed in this PR
This PR keeps canvas-created backing sessions out of the Agents window’s Sessions list by default, avoiding duplicate sidebar entries while retaining explicit listing controls.
Changes:
- Persists canvas-session visibility and carries it across session replacement.
- Adds Show/Hide actions with Undo and automatic reveal on replies or last-pin removal.
- Documents the listing contract and adds lifecycle, action, and sidebar tests.
| File | Description |
|---|---|
src/vs/workbench/contrib/sessions/test/browser/sessionsListModelService.test.ts |
Tests visibility persistence, replacement, Undo, and cleanup. |
src/vs/workbench/contrib/sessions/test/browser/sessionsListActions.test.ts |
Tests Hide action eligibility and Undo. |
src/vs/workbench/contrib/sessions/providers/agentHost/browser/baseAgentHostSessionsProvider.ts |
Exposes the canvas draft’s session ID. |
src/vs/workbench/contrib/sessions/common/sessionsProvider.ts |
Adds session identity to provider canvas drafts. |
src/vs/workbench/contrib/sessions/common/sessionsManagement.ts |
Adds session identity to managed canvas drafts. |
src/vs/workbench/contrib/sessions/common/sessionCommands.ts |
Defines the canvas-session Hide command. |
src/vs/workbench/contrib/sessions/browser/views/sessionsListCommon.ts |
Adds a pinned-canvas context key. |
src/vs/workbench/contrib/sessions/browser/views/sessionsListActions.ts |
Implements Hide with an Undo notice. |
src/vs/workbench/contrib/sessions/browser/views/sessionsList.ts |
Supplies visibility state to context menus. |
src/vs/workbench/contrib/sessions/browser/sessionsManagementService.ts |
Forwards draft session identity. |
src/vs/workbench/contrib/sessions/browser/sessionsListModelService.ts |
Stores and manages canvas-session visibility. |
src/vs/workbench/contrib/sessions/browser/pinnedCanvases.ts |
Shares listing context keys and ownership helpers. |
src/vs/sessions/SESSIONS_LIST.md |
Documents visibility ownership and lifecycle rules. |
src/vs/sessions/services/sessions/test/browser/sessionsManagementService.test.ts |
Tests draft identity forwarding. |
src/vs/sessions/contrib/sessions/test/browser/sessionsListTestUtils.ts |
Supports hidden canvas sessions in list fixtures. |
src/vs/sessions/contrib/sessions/test/browser/sessionsList.test.ts |
Tests context menus in both sidebar layouts. |
src/vs/sessions/contrib/sessions/test/browser/automationSessionsListing.test.ts |
Tests reply-triggered canvas-session reveal. |
src/vs/sessions/contrib/sessions/browser/automationSessionsListing.ts |
Reveals default-hidden sessions on user replies. |
src/vs/sessions/contrib/providers/agentHost/test/browser/localAgentHostSessionsProvider.test.ts |
Tests draft-to-committed identity replacement. |
src/vs/sessions/contrib/canvases/test/electron-browser/pinnedCanvasPage.test.ts |
Tests reactive page listing context. |
src/vs/sessions/contrib/canvases/test/electron-browser/pinnedCanvasActions.test.ts |
Tests Show/Hide menus and command routing. |
src/vs/sessions/contrib/canvases/test/electron-browser/newCanvasSessionAction.test.ts |
Covers creation hiding and failure rollback. |
src/vs/sessions/contrib/canvases/test/browser/pinnedCanvasService.test.ts |
Covers reveal behavior after unpinning and closing. |
src/vs/sessions/contrib/canvases/electron-browser/pinnedCanvasPage.ts |
Updates header context and accessibility help. |
src/vs/sessions/contrib/canvases/electron-browser/pinnedCanvasActions.ts |
Adds Show/Hide actions to canvas surfaces. |
src/vs/sessions/contrib/canvases/electron-browser/newCanvasSessionAction.ts |
Hides drafts before opening and restores listing on failure. |
src/vs/sessions/contrib/canvases/browser/pinnedCanvasService.ts |
Coordinates last-pin reveal with archive and close behavior. |
Review effort: Balanced
Ladislau Szomoru (lszomoru)
previously approved these changes
Nov 26, 2026
- Reconcile hidden, unpinned sessions when a pending archive is rejected or a confirmed archive is undone, while keeping confirmed archives hidden. - Suspend canvas-session exclusion while `chat.canvases.enabled` is off, preserving stored reasons and firing `CanvasListing` on changes. - Update pending `hideCanvasSessions` Undo targets during identity migration. - Persist hidden canvas sessions as `StorageTarget.MACHINE` and update `src/vs/sessions/SESSIONS_LIST.md`. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Ladislau Szomoru (lszomoru)
previously approved these changes
Nov 26, 2026
Alexandru Dima (alexdima)
previously approved these changes
Nov 26, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to a conflict with the base branch
Nov 26, 2026
Resolve import conflicts in sessionsList.ts and sessionsList.test.ts. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Ulugbek Abdullaev (ulugbekna)
dismissed stale reviews from Alexandru Dima (alexdima) and Ladislau Szomoru (lszomoru)
via
November 26, 2026 19:36
303932f
…text menu test Give each test session a distinct descending `createdAt` timestamp so `SessionsSorting.Created` ordering does not depend on wall-clock ticks between `createTestSession` calls. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Ladislau Szomoru (lszomoru)
approved these changes
Nov 26, 2026
Alexandru Dima (alexdima)
approved these changes
Nov 26, 2026
Ulugbek Abdullaev (ulugbekna)
deleted the
ulugbekna/agents/canvas-sessions-default-hidden
branch
November 26, 2026 20:53
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.

Why
Opening a canvas from the Canvases section starts an empty backing quick chat. Listing that zero-turn session in the Sessions list creates a duplicate sidebar entry while the user is working with the canvas.
Summary
ISessionsListModelService. Persist hidden canvas sessions in profile-scoped machine storage (sessionsListControl.hiddenCanvasSessions,StorageTarget.MACHINE) as aMap<sessionId, 'default' | 'explicit'>. Integrate it intoisSessionListed, identity migration (onDidReplaceSessionandpreviousIdentities, including pending Hide Undo targets), andonDidDeleteSessioncleanup. Suspend canvas-session exclusion whilechat.canvases.enabledis disabled without discarding stored reasons, firingCanvasListingwhen availability changes. Automation sessions keep their own listing rules.sessionIdonISessionsProviderCanvasDraftandICanvasSessionDraft.NewCanvasSessionActionhides the draft session as'default'before opening the canvas, tracks session replacement, and rolls back if opening fails or pinning hits the cap.IChatService.onDidAcceptRequest) reveals a'default'-hidden canvas session, while leaving'explicit'-hidden sessions hidden.PinnedCanvasService. Closing a canvas from the sidebar (markChatDone: true) keeps a confirmed archived session hidden and reveals the session if marking it done did not archive it.Menus.SidebarCanvasContext) and the canvas page header (AgentsWindowMenus.CustomViewCanvas, withCodicon.eye/Codicon.eyeClosed), plus Hide from Sessions List onSessionItemContextMenuIdfor sessions that have a pinned canvas, with an Undo notice.src/vs/sessions/SESSIONS_LIST.md.Validation
pnpm run build-fast— passedpnpm run build-fast --client-only— passed./scripts/test.sh --reporter dot --runacross all modified and new test suites (sessionsListModelService.test.ts,pinnedCanvasService.test.ts,newCanvasSessionAction.test.ts,pinnedCanvasActions.test.ts,pinnedCanvasPage.test.ts,automationSessionsListing.test.ts,sessionsList.test.ts,sessionsListActions.test.ts) — 792 passing, 0 failing after review fixes (and 39 passing inpinnedCanvasService.test.tsafter final type adjustment)pnpm run typecheck-client— passed (0 errors)pnpm run oxlinton all changed TypeScript files — passed (0 issues)pnpm run valid-layers-check— passedsessions.sidebar.separateNavigation: trueandfalselayouts (create hidden, Show/Hide from pin menu and session menu with Undo, Remove from Sidebar auto-reveal, sidebar Close Canvas staying hidden, Go to Chat staying hidden, and reply auto-reveal).