perf: Defer autoUpdate until menu is open to fix slow profile icon rendering#1450
perf: Defer autoUpdate until menu is open to fix slow profile icon rendering#1450
autoUpdate until menu is open to fix slow profile icon rendering#1450Conversation
…ndering autoUpdate from @floating-ui/dom was being started in connect(), causing immediate layout/size calculations for every menu instance on page load even while closed. Moved autoUpdate to only run when the menu is open, and stop when closed/toggled off. https://claude.ai/code/session_01FkTsyLvEod4qN6T5dNidkL
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughModified lifecycle management for position auto-updates in the menu controller. Auto-updates no longer start unconditionally during connection; instead, they are conditionally managed in the toggle and close methods based on menu visibility state. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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 |
|
passed this to claude with the HAR file from the main dashboard when I ran the tests/benchmarks: Performance impact:
One suggestion (not blocking): if showValue is ever set to true in the future (menu starts open), connect() should handle it: connect() {
this.show = this.showValue;
this.boundUpdate = this.update.bind(this);
this.addEventListeners();
if (this.show) {
this.startAutoUpdate();
}
}Currently no callers set showValue: true, so this is defensive, not urgent. |
The
autoUpdatefrom@floating-ui/domwas being started inconnect(), causing immediate layout/size calculations for every menu instance on page load even while closed. MovedautoUpdateto only run when the menu is open, and stop when closed/toggled off.https://claude.ai/code/session_01FkTsyLvEod4qN6T5dNidkL
Summary by CodeRabbit
Release Notes