perf(app): unmount closed right panel body#619
Conversation
There was a problem hiding this comment.
Suggested priority: P2 (includes user-path files (packages/app/src/pages/session/review-panel-scroll.ts, packages/app/src/pages/session/review-panel-view.tsx, packages/app/src/pages/session/review-tab.test.tsx, packages/app/src/pages/session/review-tab.tsx, packages/app/src/pages/session/session-side-panel.tsx)).
P1/P0 are reserved for maintainer confirmation. Please relabel manually if this is a release blocker, security issue, data-loss risk, or updater/runtime failure.
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe right-panel body is now conditionally mounted only when open, and ref cleanup is coordinated through the component hierarchy by allowing undefined in ref callbacks and notifying listeners when components unmount. ChangesRight Panel Ref Lifecycle and Conditional Mounting
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
Perf delta summaryComparator: pass
|
There was a problem hiding this comment.
Code Review
This pull request implements the unmounting of the right panel's tab body when closed to improve performance. Key changes include updating scroll reference types to handle undefined, adding cleanup logic to clear scroll references on unmount, and wrapping the panel body in a conditional Show component. New E2E and unit tests were added to verify these changes. Feedback was provided regarding a potential visual regression where the panel content disappears instantly during the closing transition, suggesting a transition-aware unmounting strategy to maintain UI consistency.
Summary
Unmount the right panel tab body while the desktop right panel is closed, while keeping the outer panel shell available for width state and open/close transitions.
Also clear the Review scroll element ref on unmount so the review scroll controller does not retain a stale DOM node after the panel body is removed.
Why
Closes #602.
The old right panel architecture kept the tab body mounted even when the panel was visually closed. That meant hidden tabs, tab lists, and active tab content could still exist in the DOM and keep lifecycle work alive. This PR draws the first lifecycle boundary: closed right panel means no mounted panel body.
Related Issue
Closes #602
Human Review Status
Pending. A human should make the final merge decision after reviewing the final diff and verification evidence.
Review Focus
Please focus on the mount boundary in
SessionSidePaneland the Review scroll ref cleanup. This PR intentionally does not change the scroll state machine, timeline virtualization, active-tab lazy mounting, or broader right-panel structure.Risk Notes
Low. The visual shell and width persistence stay in place, but closed-panel content now remounts when the panel opens. Review scroll refs are cleared on unmount to avoid stale DOM references.
How To Verify
Screenshots or Recordings
No screenshot attached because this PR has no intended visual delta. The behavior was checked in Electron: opening the right panel still shows the status panel, and closing it removes the panel body from the rendered/accessibility tree.
Checklist
dev, and my PR title and commit messages use Conventional Commits in EnglishSummary by CodeRabbit
Bug Fixes
Performance Improvements
Tests