Skip to content

sessions: hide the Pinned section when it has no pinned sessions - #325135

Merged
Sandeep Somavarapu (sandy081) merged 1 commit into
mainfrom
sandy081/agents/hide-empty-pinned-section-agents-window
Jul 9, 2026
Merged

Sandeep Somavarapu (sandy081) merged 1 commit into
mainfrom
sandy081/agents/hide-empty-pinned-section-agents-window

Conversation

@sandy081

Copy link
Copy Markdown
Member

What

In the Agents window sessions list, the Pinned section was always rendered — even when empty — showing a muted "No pinned sessions" placeholder row (gated by the sessions.list.showEmptyDefaultGroups setting). This changes the behavior so the Pinned section is only shown when it actually contains pinned sessions; otherwise it is hidden entirely.

Why

An empty Pinned section with a placeholder row adds noise to the list for users who do not pin sessions. Hiding it when empty keeps the list cleaner.

Changes

  • Removed the code that injected an empty pinned section into the list.
  • Removed the "No pinned sessions" empty-state placeholder row.
  • The sessions.list.showEmptyDefaultGroups setting now only controls the empty Chats section (unchanged behavior); updated its description and doc comment.
  • Updated SESSIONS_LIST.md docs accordingly.

Notes for reviewers

  • The Chats section behavior is unchanged (still always-visible via the setting when a provider supports quick chats).
  • The groupSessionsForList helper already only emits a Pinned section when it is non-empty, so existing unit tests remain valid.
  • Typecheck and hygiene pass.

The Pinned section was always rendered in the Agents window sessions list
(even when empty) with a "No pinned sessions" placeholder, gated by the
`sessions.list.showEmptyDefaultGroups` setting. Show it only when it actually
contains pinned sessions.

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

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

This PR changes the Agents window sessions list so the Pinned section is only rendered when it actually contains pinned sessions, instead of always showing an empty placeholder row gated by sessions.list.showEmptyDefaultGroups. The showEmptyDefaultGroups setting now governs only the empty Chats section. This is a small, self-contained UX cleanup that removes list noise for users who don't pin sessions.

I verified the change is complete and consistent: groupSessionsForList already only emits a pinned section when non-empty (sessionsList.ts:3122), the injection of the empty pinned section and its noPinnedSessions placeholder are fully removed with no dangling references, the showEmptyDefaultGroups variable is still used for the Chats section (no dead code), and the placeholder renderer is generic so no orphaned code remains. Existing groupSessionsForList unit tests remain valid, and the setting description plus SESSIONS_LIST.md docs were updated to match.

Changes:

  • Removed the empty-pinned-section injection and the "No pinned sessions" placeholder row from SessionsList.
  • Narrowed the sessions.list.showEmptyDefaultGroups setting description and code comments to reference only the Chats section.
  • Updated SESSIONS_LIST.md to describe the Pinned section as shown only when it has pinned sessions.
Show a summary per file
File Description
src/vs/sessions/contrib/sessions/browser/views/sessionsList.ts Removed empty Pinned section injection and its placeholder row; updated related comments
src/vs/sessions/contrib/sessions/browser/sessions.contribution.ts Updated setting description to reference only the Chats group
src/vs/sessions/SESSIONS_LIST.md Updated docs to reflect Pinned section hidden when empty

Review details

  • Files reviewed: 3/3 changed files
  • Comments generated: 0
  • Review effort level: Medium

@sandy081
Sandeep Somavarapu (sandy081) merged commit 1c2a09b into main Jul 9, 2026
30 checks passed
@sandy081
Sandeep Somavarapu (sandy081) deleted the sandy081/agents/hide-empty-pinned-section-agents-window branch July 9, 2026 14:31
@vs-code-engineering vs-code-engineering Bot added this to the 1.129.0 milestone Jul 9, 2026
@vs-code-engineering vs-code-engineering Bot locked and limited conversation to collaborators Aug 23, 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