Repository navigation
Fix #348945: preserve collapsed Inbox category when revealing active session - #349664
Saurabh Sungh (genius-0963) wants to merge 1 commit into
Conversation
…g active session
There was a problem hiding this comment.
🟡 Changes recommended
The extra argument to SessionsList.reveal causes a TypeScript error and is ignored at runtime, leaving the collapse bug unresolved because preserveCollapsed is not implemented.
1 open issue
What changed in this PR
This PR aims to fix #348945 by preserving collapsed Inbox categories when the Agents window reveals the active session after reload.
Changes:
- Passes
trueas the second argument to the active-session reveal call, requesting collapse preservation.
| File | Description |
|---|---|
src/vs/sessions/contrib/sessions/browser/views/sessionsView.ts |
Updates the active-session autorun’s reveal call to request preservation of collapsed categories. |
Review effort: Balanced
Krish Khinchi (krishkhinchi)
left a comment
There was a problem hiding this comment.
The proposed fix is correct in intent, but the implementation is incomplete. SessionsList.reveal() currently accepts only one argument (sessionsList.ts:6512), so passing true introduces a TypeScript error and does not prevent the tree from expanding collapsed ancestors.
Please implement preserveCollapsed support in SessionsList.reveal() and its interface, ensuring that the underlying tree reveal operation respects the existing collapsed state rather than simply ignoring the additional argument. Also verify that the existing restore paths and related unit tests continue to behave correctly.
Recommendation: Request Changes until the method signature, implementation, and regression test are updated and verified.

Summary of Changes
Fixes #348945
When reloading the Agents window or initializing the active session, the
autoruninsessionsView.tswatching the active session callssessionsControl.reveal(activeSession.resource)withoutpreserveCollapsed.In
SessionsList.reveal(sessionResource, preserveCollapsed = false), omittingpreserveCollapseddefaults tofalse, which callsthis.revealActiveItem(session)and invokesthis.tree.reveal(element, 0.5). This causes the tree to recursively expand all ancestor nodes, forcing open any user-collapsed Inbox category (such as "Ready for you" or "Inbox").Other restore paths (such as
restoreLastSelectedSession()) already passpreserveCollapsed = true(this.sessionsControl.reveal(activeSession.resource, true)).This fix passes
preserveCollapsed = true(sessionsControl.reveal(activeSession.resource, true)) in theautorun, ensuring that a user's collapsed Inbox category remains collapsed when the active session is revealed on window reload.How to Test / Verification
node test/unit/browser/index.js --browser chromium --run src/vs/sessions/contrib/sessions/test/browser/sessionsList.test.ts --grep "Inbox collapse survives updates"