Skip to content

sessions: fix Show All Sessions filter out of sync with view on reload#306435

Merged
sandy081 merged 2 commits intomainfrom
copilot/sporting-barracuda
Mar 30, 2026
Merged

sessions: fix Show All Sessions filter out of sync with view on reload#306435
sandy081 merged 2 commits intomainfrom
copilot/sporting-barracuda

Conversation

@sandy081
Copy link
Copy Markdown
Member

@sandy081 sandy081 commented Mar 30, 2026

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 to true (the RawContextKey default), 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 resets workspaceGroupCapped to true internally and persists it) but did not update the context key accordingly.

Fix

  1. Bind the context key in the SessionsView constructor alongside the other context keys (groupingContextKey, sortingContextKey).
  2. Sync it from persisted state in renderBody after SessionsList is created, using sessionsControl.isWorkspaceGroupCapped().
  3. Reset it in the Reset action — capture the context key as a closure variable and set it to true when filters are reset.

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>
Copilot AI review requested due to automatic review settings March 30, 2026 18:52
@sandy081 sandy081 self-assigned this Mar 30, 2026
@sandy081 sandy081 enabled auto-merge (squash) March 30, 2026 18:52
@sandy081 sandy081 added this to the 1.115.0 milestone Mar 30, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 IsWorkspaceGroupCappedContext in SessionsView so the key is initialized (and not implicitly undefined) on reload.
  • After SessionsList is created, sync the context key from the persisted SessionsList state via isWorkspaceGroupCapped().
  • Update the Reset action to also reset the workspace-group-capped context key.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@sandy081 sandy081 merged commit 39a50d8 into main Mar 30, 2026
38 of 40 checks passed
@sandy081 sandy081 deleted the copilot/sporting-barracuda branch March 30, 2026 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants