sessions: fix Show All Sessions filter out of sync with view on reload#306435
Merged
sessions: fix Show All Sessions filter out of sync with view on reload#306435
Conversation
The IsWorkspaceGroupCappedContext context key was never initialized from persisted storage on reload, causing the menu checkmark to always show as checked (default true) regardless of the stored value. Fix by binding the context key in the constructor and syncing it with the persisted SessionsList state in renderBody. Also fix the Reset action which was resetting the internal state but not the context key. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes the Sessions view title “Filter Sessions” menu checkmarks getting out of sync with the persisted “Show Recent Sessions” / “Show All Sessions” state after reload by properly initializing and synchronizing the IsWorkspaceGroupCappedContext context key.
Changes:
- Bind
IsWorkspaceGroupCappedContextinSessionsViewso the key is initialized (and not implicitlyundefined) on reload. - After
SessionsListis created, sync the context key from the persistedSessionsListstate viaisWorkspaceGroupCapped(). - Update the Reset action to also reset the workspace-group-capped context key.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
DonJayamanne
approved these changes
Mar 30, 2026
lramos15
approved these changes
Mar 30, 2026
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.
Fixes - #306425
Problem
After reloading, the Show All Sessions menu checkmark was always checked (✓), even when the user had previously selected "Show Recent Sessions". The view itself would be correct (showing the persisted filter), but the menu checkmark was out of sync.
Root cause
IsWorkspaceGroupCappedContext— the context key that drives the menu checkmarks — was never initialized from persisted storage on reload. It defaulted totrue(theRawContextKeydefault), which made "Show All Sessions" always appear checked regardless of the stored value.There was also a secondary issue: the Reset action called
sessionsControl.resetFilters()(which resetsworkspaceGroupCappedtotrueinternally and persists it) but did not update the context key accordingly.Fix
SessionsViewconstructor alongside the other context keys (groupingContextKey,sortingContextKey).renderBodyafterSessionsListis created, usingsessionsControl.isWorkspaceGroupCapped().truewhen filters are reset.