Fix: Unstarring room from room view no longer removes from All Rooms #112
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.
Summary
Fixes #76
The Problem
When unstarring a room using the ⭐ button from the room view (navbar), the room was being removed from both "My Rooms" AND "All Rooms".
Expected behavior:
everything)mentions)Actual behavior (bug):
mentions → everything → invisible → mentionsinvisiblewas set, the room disappeared from the sidebar completelyRoot Cause
In
involvements_helper.rb, thenext_involvement_formethod used different involvement orders:The sidebar correctly excluded
invisible, but the room view did not.The Fix
Changed the room view to use the same involvement order as the sidebar:
def next_involvement_for(room, involvement:, from_sidebar: false) if room.direct? DIRECT_INVOLVEMENT_ORDER[...] - elsif from_sidebar - SHARED_SIDEBAR_INVOLVEMENT_ORDER[...] else - SHARED_INVOLVEMENT_ORDER[...] + # Use the same involvement order for both sidebar and room view + # to prevent accidentally hiding rooms by cycling to "invisible" + SHARED_SIDEBAR_INVOLVEMENT_ORDER[...] end endNow both the sidebar and room view cycle through:
mentions ↔ everythingBehavior After Fix
Testing
AI Disclosure
This PR was developed with AI assistance: