Skip to content

sessions: collapse Pinned and Chats sections on first open - #324055

Merged
Sandeep Somavarapu (sandy081) merged 1 commit into
mainfrom
sandy081/sessions-collapse-pinned-chats-first-open
Jul 2, 2026
Merged

Sandeep Somavarapu (sandy081) merged 1 commit into
mainfrom
sandy081/sessions-collapse-pinned-chats-first-open

Conversation

@sandy081

Copy link
Copy Markdown
Member

What

In the Agents window sessions sidebar, the Pinned and Chats sections previously defaulted to expanded. This changes their default collapse state to collapsed on first open (when no saved state exists), while continuing to persist and honor the user's later expand/collapse choice.

Why

Both sections are always visible even when empty (showing a "No pinned sessions" / "No chats" placeholder). Defaulting them expanded added noise at the top of the list. Collapsing them by default keeps the list compact while remaining discoverable.

How

In SessionsList.renderSection (src/vs/sessions/contrib/sessions/browser/views/sessionsList.ts), the pinned and QUICK_CHATS_SECTION_ID sections now use ObjectTreeElementCollapseState.PreserveOrCollapsed as their default. Since the effective state is getSavedCollapseState(section.id) ?? defaultCollapsed, any saved user choice (persisted under sessionsListControl.sectionCollapseState) still takes precedence — only the first-open default changed.

Notes for reviewers

  • SESSIONS_LIST.md spec updated to document the behavior.
  • npm run typecheck-client and npm run valid-layers-check pass.

The Pinned and Chats sections in the Agents window sessions sidebar
previously defaulted to expanded. Default their collapse state to
collapsed on first open (when no saved state exists) while continuing to
persist and honor the user's later expand/collapse choice.

Co-authored-by: Copilot <[email protected]>
Copilot AI review requested due to automatic review settings July 2, 2026 13:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the Agents window sessions sidebar defaults so the always-visible Pinned and Chats sections start collapsed on first open (when there is no saved collapse state), while continuing to persist and respect the user’s expand/collapse choice across loads.

Changes:

  • Change the default collapse state for the pinned and quickchats sections to ObjectTreeElementCollapseState.PreserveOrCollapsed when no saved state exists.
  • Update the Sessions List spec to document the new first-open collapse behavior and persistence key.
Show a summary per file
File Description
src/vs/sessions/SESSIONS_LIST.md Documents the new first-open default collapse behavior and where the user’s choice is persisted.
src/vs/sessions/contrib/sessions/browser/views/sessionsList.ts Applies the new default collapse state for Pinned/Chats sections while preserving saved per-section collapse state.

Review details

  • Files reviewed: 2/2 changed files
  • Comments generated: 1
  • Review effort level: Low

@sandy081
Sandeep Somavarapu (sandy081) merged commit 165ec37 into main Jul 2, 2026
30 checks passed
@sandy081
Sandeep Somavarapu (sandy081) deleted the sandy081/sessions-collapse-pinned-chats-first-open branch July 2, 2026 14:12
@vs-code-engineering vs-code-engineering Bot added this to the 1.128.0 milestone Jul 2, 2026
@vs-code-engineering vs-code-engineering Bot locked and limited conversation to collaborators Aug 16, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants