fix: Rooms sidebar delay #110
Open
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.
fixes: #23
Optimize Rooms Sidebar Loading Performance
Summary
This PR significantly improves the loading performance and user experience of the Rooms sidebar by reducing initial DOM complexity, introducing lazy loading for heavy UI elements, and adding a loading indicator.
Problem
The Rooms sidebar took 3+ seconds to load on a full refresh due to several performance bottlenecks:
Solution
To improve initial render time and UX, this PR introduces lazy loading, a loading indicator, and DOM simplification:
Changes
Lazy Loading Involvement Buttons
lazy_involvement_controller.jsto handle lazy loading logiclazy_involvement_trigger_controller.jsto trigger loading on room item hover_shared.html.erbto use lazy-loaded Turbo FramesLoading Indicator
sidebar_loading_controller.jsto manage sidebar loading statesidebar_helper.rbto render a loading spinner when the sidebar loads viasrcsidebar.cssDOM Structure Simplification
<span>wrapper around involvement button Turbo Framestxt-smallclass directly to the Turbo FrameFiles Changed
app/views/users/sidebars/rooms/_shared.html.erbapp/frontend/controllers/lazy_involvement_controller.jsapp/frontend/controllers/lazy_involvement_trigger_controller.jsapp/frontend/controllers/sidebar_loading_controller.jsapp/helpers/users/sidebar_helper.rbapp/assets/stylesheets/application/sidebar.cssBenefits
Testing
Performance Impact
Expected improvements:
Result
The Rooms sidebar now loads faster and feels more responsive, especially for users with many starred rooms, by deferring heavy UI elements until they are needed.
before changes
Screencast.From.2025-12-27.01-34-15.mp4
After changes
Screencast.From.2025-12-27.01-35-42.mp4