Repository navigation
sessions: hide the Pinned section when it has no pinned sessions - #325135
Sandeep Somavarapu (sandy081) merged 1 commit into
Conversation
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]>
There was a problem hiding this comment.
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 fromSessionsList. - Narrowed the
sessions.list.showEmptyDefaultGroupssetting description and code comments to reference only the Chats section. - Updated
SESSIONS_LIST.mdto 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
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.showEmptyDefaultGroupssetting). 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
pinnedsection into the list.sessions.list.showEmptyDefaultGroupssetting now only controls the empty Chats section (unchanged behavior); updated its description and doc comment.SESSIONS_LIST.mddocs accordingly.Notes for reviewers
groupSessionsForListhelper already only emits a Pinned section when it is non-empty, so existing unit tests remain valid.