fix(ai-vault): preserve transient panel state#9419
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
💤 Files with no reviewable changes (1)
📝 WalkthroughWalkthroughAI Vault transient UI state is centralized in a cached hook that manages scope selection, collapsed groups, and expanded session details. Scope normalization handles unavailable project or workspace contexts, while disclosure state is bounded and resettable for tests. The panel and virtual session list now consume this shared state through props and callbacks. Tests cover persistence across remounts, context changes, explicit scope selection, rapid toggles, eviction limits, cache clearing, and scope normalization. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Workspace,Project, orAll) when the Agents panel is unmounted while switching right-sidebar tabs.Allwhen the preferred context is unavailable without forgetting the preference, and restore it when that context returns.Fixes #9418
Related: #8146, #8961
Screenshots
The screenshots use mock sessions only; no personal session data is included.
Before
Projectis selected, the Codex session details are expanded, and the Claude group is collapsed.Explorer
The right sidebar is switched away from Agents to Explorer.
After
Returning to Agents restores the selected scope and both disclosure states.
Testing
pnpm lintpnpm typecheckpnpm testpnpm buildValidation completed:
Allselection, rapid toggles, and bounded disclosure caches.pnpm lintis blocked by the pre-existingswitch-exhaustiveness-checkerror insrc/renderer/src/components/skills/skill-freshness-group.tsx:101; changed files are clean.pnpm teston locally available Node 26 completed with 31,702 passed, 52 skipped, and 36 failures across six unrelated files. All 36 failures are caused by Node 26 exposing an unavailable experimentalwindow.localStoragewithout--localstorage-file; the run also reported one unrelated WSL relayEPIPE. This repository requires Node 24, which was not installed locally.Mock-data UI automation also asserted the state after an Agents → Explorer → Agents round trip:
Projectselected, Claude group collapsed, and session details expanded.AI Review Report
Two independent reviews found no blocking or major issue. They explicitly checked scope normalization and preference restoration, remount behavior, rapid toggles, stable group/session keys, bounded memory use, render-path performance, and compatibility with the existing persisted sort/group/agent filters. One review recommended explicit Workspace fallback coverage; that regression test was added.
Cross-platform compatibility was reviewed for macOS, Linux, and Windows. This is renderer-only state management and does not change shortcuts, labels, paths, shell behavior, or Electron platform APIs. SSH, remote, WSL, and local sessions use the same opaque host-aware session IDs, with no local-only assumption. Agent, integration, GitHub/GitLab, and other git-provider behavior remains provider-neutral. No layout, color, typography, spacing, or design-token behavior changed.
Security Audit
The new cache stores only typed scope values and opaque group/session keys in renderer memory. It is bounded to 512 entries per disclosure set and resets on app reload. The review found no new user-input parsing, command execution, file/path handling, authentication, secrets, dependency, network, persistent-storage, or IPC surface. No follow-up security work is required.
Notes
just-zzpGitHub profile).