Persist sessions sidebar section collapse state#299355
Merged
daviddossett merged 3 commits intomainfrom Mar 5, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds persistence for the expanded/collapsed state of timestamped sections in the Agent Sessions sidebar by storing section collapse state in profile-scoped storage and restoring it on render.
Changes:
- Injects
IStorageServiceintoAgentSessionsControland adds helpers to read/write persisted section collapse state. - Updates
collapseByDefaultto consult persisted state before applying the existing default collapse rules. - Listens to the tree’s
onDidChangeCollapseStateand saves the new state (unwrappingIAsyncDataTreeNodeto access the underlying section element).
Comments suppressed due to low confidence (1)
src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsControl.ts:223
- The comments describing default behavior (e.g. “More section is always collapsed…”, “Archived section is collapsed…”) are no longer strictly true once persisted collapse state takes precedence. Please update these comments to reflect that they only apply when there is no saved user preference.
if (element.section === AgentSessionSection.More && !this.options.filter.getExcludes().read) {
return true; // More section is always collapsed unless only showing unread
}
if (element.section === AgentSessionSection.Archived && this.options.filter.getExcludes().archived) {
return true; // Archived section is collapsed when archived are excluded
}
pwang347
approved these changes
Mar 5, 2026
Member
|
@daviddossett some feedback:
Zurich has been holding back larger changes today to stabilise, I feel this change should be reverted and then properly put in for another release. Thoughts? |
daviddossett
added a commit
that referenced
this pull request
Mar 6, 2026
This reverts commit 65ecbd4.
Collaborator
Author
|
Reverting—it felt like a small change for me but apologies for pushing through during testing. |
13 tasks
daviddossett
added a commit
that referenced
this pull request
Mar 6, 2026
This reverts commit 65ecbd4.
This was referenced Mar 6, 2026
mjbvz
added a commit
that referenced
this pull request
Mar 6, 2026
…ebar-collapse-state-1.111 Revert "Persist sessions sidebar section collapse state (#299355)"
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.
Persists the expanded/collapsed state of timestamped sections (Today, Yesterday, Last 7 days, etc.) in the sessions sidebar across view open/close and restarts.
Changes:
IStorageServicetoAgentSessionsControlto persist section collapse stateonDidChangeCollapseStateevent, unwrapping theIAsyncDataTreeNodeto access the actual section element