sessions: fix: persist and reveal session tree state - #336446
Draft
Ulugbek Abdullaev (ulugbekna) wants to merge 3 commits into
Draft
Ulugbek Abdullaev (ulugbekna) wants to merge 3 commits into
Ulugbek Abdullaev (ulugbekna) wants to merge 3 commits into
Conversation
This was referenced Sep 16, 2026
Ulugbek Abdullaev (ulugbekna)
force-pushed
the
ulugbekna/nested-session-repository-actions
branch
from
September 16, 2026 18:08
01bb902 to
55e36d9
Compare
Remember each session branch across list recreation and grouping changes. Retain state during transient catalog removal and remove it only on definitive deletion. Read one validated storage snapshot per update and make Collapse All preserve section, group, and session choices without discarding absent sessions. Keep the existing bulk-write suppression; generalized search batching follows separately. Co-authored-by: Copilot App <[email protected]>
Wait for tree refiltering, expand only collapsed ancestors of actual matches, and reconcile result focus and visibility without taking focus from the find input. Generalize Collapse All write suppression into reusable batching so revealing many matching branches persists their expansion once rather than writing for every ancestor. Co-authored-by: Copilot App <[email protected]>
Include active, explicitly revealed, and archive-onboarding sessions beyond session and workspace presentation limits without changing saved filters. Preserve simultaneous reveal targets and clear temporary reveal state when its context changes. Use URI identity for explicit navigation and reveal an offscreen active session without recentering one already visible. Co-authored-by: Copilot App <[email protected]>
Ulugbek Abdullaev (ulugbekna)
force-pushed
the
ulugbekna/nested-session-tree-state
branch
from
September 16, 2026 18:13
2c183c2 to
3765663
Compare
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.
Summary
Complete existing collapse, Find, and reveal behavior in the Agents Window before adding recursive independent-session nesting. Expand/collapse, stored section/group state, and Find already exist; this PR addresses individual session branches and targets hidden by collapse or presentation limits.
This draft is part 2 of 4 and is based on #336444, not directly on main. It contains three focused commits and does not create parent/child relationships between independent sessions.
1. Remember individual session branches
Persist each session's collapsed or expanded choice across list recreation and grouping changes. Retain it when a provider temporarily removes the session from its catalog, and remove it only on definitive deletion. Validate stored values and read one snapshot per update. Collapse All includes section, group, and session branches while preserving stored choices for temporarily absent sessions.
2. Expose matches behind collapsed branches
Wait for native tree refiltering to populate match scores, then expand only collapsed ancestors of actual matching descendants. A matching parent alone does not open nonmatching children. Reconcile result focus and visibility without stealing DOM focus from the find input. Generalize the existing Collapse All write suppression into reusable batching, so opening many matching branches saves their state once rather than once per ancestor.
Search expansion uses the normal persisted branch state; this does not add a separate temporary find-expansion state. Opening an empty Find widget does not open unrelated branches.
3. Reveal sessions omitted by Show More
Distinguish sessions excluded by filters from sessions omitted only by sidebar limits. Include the active session, an explicitly requested session, and the archive-onboarding target simultaneously beyond session/workspace caps, without rewriting saved filters. Clear temporary explicit reveal state when its context changes. Preserve existing conditional scrolling for explicit reveal and add offscreen reveal to main-session selection without recentering an already-visible row.
Coverage
The shared state suite uses existing peer-chat branches, independently of the later nested-session feature. Regressions cover storage read/write counts, invalid saved state, grouping/recreation, true and false deletion entries, hidden matches in both Find modes, typing focus, viewport stability, and simultaneous cap exceptions. After the review fix and restack, the complete stack's 228 focused tests and client typecheck pass on Electron 43.6.0.
Stack
Part 2 of 4. Base: #336444. All PRs are drafts; review and merge bottom-up. Original commit labels are retained below; PR 1 also contains its test-only review follow-up.