Repository navigation
sessions: expand the Pinned section when the first session is pinned - #345233
Merged
Ross Wollman (rwoll) merged 1 commit intoOct 30, 2026
Merged
Conversation
The Pinned section defaults to collapsed and is hidden while empty, so pinning the first session created a collapsed section that hid the session. Expand Pinned when a session is pinned unless the user has a saved collapse state for it. Co-authored-by: Copilot <[email protected]> 🤖 Authored with GitHub Copilot on behalf of @rwoll.
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for the Pinned-section expansion change.
No open issues 🎉
What changed in this PR
This PR makes the Agents window’s Pinned section expand when a session is pinned without a saved collapse preference, while preserving an explicitly collapsed state. It does not address the separate missing-section issue in #326026.
Changes:
- Handle pin-change notifications before refreshing the sessions list.
- Add opt-in live pin behavior to the test harness.
- Add regression tests for first-pin expansion and preservation of a saved collapsed state.
| File | Description |
|---|---|
src/vs/sessions/contrib/sessions/test/browser/sessionsListTestUtils.ts |
Adds livePins support to update pin state and emit notifications. |
src/vs/sessions/contrib/sessions/test/browser/sessionsList.test.ts |
Tests first-pin expansion and preservation of the user’s collapse preference. |
src/vs/sessions/contrib/sessions/browser/views/sessionsList.ts |
Saves an expanded Pinned state on pinning when no collapse preference exists. |
Review effort: Balanced
Ross Wollman (rwoll)
marked this pull request as ready for review
October 30, 2026 19:26
Ross Wollman (rwoll)
enabled auto-merge (squash)
October 30, 2026 19:26
Martin Aeschlimann (aeschli)
approved these changes
Oct 30, 2026
Bhavya U (bhavyaus)
approved these changes
Oct 30, 2026
Ross Wollman (rwoll)
deleted the
agents/fix-first-pin-collapsed-group-bug
branch
October 30, 2026 20:16
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.
Found by an automated Agents window QA run.
Related: #326026. That issue is about the Pinned section missing until reload, which is a different symptom. This PR does not claim to fix it.
Repro
Expected: an expanded Pinned group appears, showing the session.
Actual: a collapsed Pinned header appears at the top, and the session you just pinned is hidden until you expand it.
Root cause
#324055 made the Pinned section default to
PreserveOrCollapsedwhen there is no saved collapse state. At that time Pinned was always visible, even with no pins. Later, #325135 hid Pinned while it is empty. Together, these mean the first pin always creates a new Pinned tree node with no saved state, so it renders collapsed and hides the session.Fix
SessionsListnow handlesSessionListModelChangeKind.Pinnedchanges fromISessionsListModelService. When a session becomes pinned and the user has no saved collapse state forpinned, it saves the section as expanded. Then the rerender shows the section open. A collapse the user chose (pinned: trueinsessionsListControl.sectionCollapseState) is kept as is. Unpinning does nothing.The test harness gets an opt-in
livePinsoption, sopinSessionupdates pin state and fires change events like the real service. ExistingliveListModeltests keep their current behavior.Validation
./scripts/test.sh --reporter dot --run src/vs/sessions/contrib/sessions/test/browser/sessionsList.test.ts --run src/vs/sessions/contrib/sessions/test/browser/sessionsListTools.test.ts: passed (437 passing).first pin shows an expanded Pinned sectionandfirst pin keeps a user-collapsed Pinned section: passed. With the production change reverted, the first test failed (pinnedExpanded: 'false'), as expected.npm run eslint -- <changed files>: passed.npm run typecheck-client: passed.809053d4c7a. The build ran inside the desktop container, signed in as the GitHub test account. Before and after media are below.End-to-end: before and after
cd2259bd)809053d4c7a)After you collapse Pinned yourself, pinning a second session keeps it collapsed:
Recording, before (Insiders): right-click a session, Pin, and the session disappears under a collapsed Pinned header.
before-insiders.webm
Recording, after (Code OSS from this branch): right-click a session, Pin, and Pinned appears expanded with the session.
after-code-oss.webm
Not verified live: unpin and re-pin across a reload. The unit tests cover the saved-state logic.
🤖 Authored with GitHub Copilot on behalf of Ross Wollman (@rwoll).