fix(desktop): keep all sessions when ALL-profiles scope is active with a single profile - #84313
Closed
andyst-dev wants to merge 1 commit into
Closed
Conversation
Contributor
fix(desktop): keep all sessions when ALL-profiles scope is active with a single profile
|
…h a single profile Grouping -> Profile persists $showAllProfiles, which drives $profileScope to ALL_PROFILES even when there is only one profile. The sidebar scoped that as showAllProfiles = multiProfile && scope === ALL, which is false for a single profile, so the flat list filtered against the __all__ sentinel and matched nothing — rendering the sidebar empty even though the backend served every row. Extract the scope selector into a pure helper that treats ALL_PROFILES as 'include everything' regardless of the multi-profile grouping gate, and use it for the scoped sessions list. Single-profile users in the ALL scope now see their rows (as a flat list, since the grouped view stays gated on multiProfile).
Contributor
Author
|
Rebased onto latest upstream main — resolved the import conflict with the session-index/session-scope split. |
andyst-dev
force-pushed
the
fix/sidebar-all-profiles-single-profile
branch
from
August 17, 2026 08:24
f54c25f to
380cd9c
Compare
|
still hitting this after the Aug 18 update |
Merged
5 tasks
Collaborator
|
Superseded by #89817. That salvage keeps the ALL-scope include-everything rule, rebased onto current main, and:
You're credited via |
OutThisLife
added a commit
that referenced
this pull request
Aug 19, 2026
…cope fix(desktop): keep recents when ALL-profiles scope has one profile (supersedes #84313)
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 #84305
Problem
In the desktop app, choosing Grouping → Profile in the sidebar Filters menu
persists
$showAllProfiles, which drives$profileScopetoALL_PROFILESevenwhen there is only a single profile (
default). The sidebar then computedshowAllProfiles = multiProfile && profileScope === ALL_PROFILES, which isfalsefor a single profile — so the flat sessions list was filtered againstthe
__all__sentinel (normalizeProfileKey(s.profile) === '__all__'), matchingnothing. Result: the sidebar's recents section rendered the empty state
("no sessions") even though the backend returned all rows for
recents_profile=all.Clicking the
defaultchip (which leaves ALL scope) instantly restored the list.The grouped rendering is intentionally gated on
multiProfile(to avoid strandingsingle-profile users in a grouped view with no rail), but the data scoping must
still fan every profile in when the scope is ALL.
Fix
Extract the scope selector into a pure helper,
selectVisibleSessions(sessions, profileScope),that treats
ALL_PROFILESas "include everything" regardless of the multi-profilegrouping gate, and filters by concrete profile otherwise.
scopedSessionsnow uses it,so a single-profile user in the ALL scope sees their rows (as a flat list — the grouped
view stays off because it is still gated on
multiProfile).Tests
Added
apps/desktop/src/app/chat/sidebar/session-scope.test.ts(6 tests) covering:defaultVerified: new + existing sidebar tests pass (125 tests, 14 files),
tsc --noEmitclean,eslint clean.