Skip to content

Conversation

@staticpayload
Copy link

@staticpayload staticpayload commented Dec 28, 2025

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:

  • Click ⭐ once → Room added to "My Rooms" (involvement: everything)
  • Click ⭐ again → Room removed from "My Rooms" but stays in All Rooms (involvement: mentions)

Actual behavior (bug):

  • From room view, the cycle was: mentions → everything → invisible → mentions
  • When invisible was set, the room disappeared from the sidebar completely

Root Cause

In involvements_helper.rb, the next_involvement_for method used different involvement orders:

SHARED_INVOLVEMENT_ORDER = %w[ mentions everything invisible ]        # Room view
SHARED_SIDEBAR_INVOLVEMENT_ORDER = %w[ mentions everything ]          # Sidebar

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
end

Now both the sidebar and room view cycle through: mentions ↔ everything

Behavior After Fix

Location Before After
Sidebar ✅ mentions ↔ everything ✅ mentions ↔ everything
Room view ❌ mentions → everything → invisible ✅ mentions ↔ everything

Note: Users can still set a room to "invisible" through other means if they explicitly want to hide it. This fix only prevents accidental hiding via the star button.

Testing

  • Unstarring from room view keeps room in All Rooms
  • Starring from room view adds room to My Rooms
  • Sidebar star behavior unchanged
  • Direct rooms still use their own involvement order

AI Disclosure

This PR was developed with AI assistance:

  • Opus 4.5 for planning and code review
  • GLM 4.7 for code execution
  • GitHub PR review for quality assurance

@staticpayload

This comment was marked as spam.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unstarring a room from the actual room view removes it from All Rooms list too

1 participant