Skip to content

Fix: Chat member sidebar shows space members, not room #117

@mjkatgithub

Description

@mjkatgithub

Planning

  • Size: S
  • Estimate: 2 SP

Goal

When a user opens a channel inside a space (e.g. #general), the right-hand member sidebar must list and count only joined members of that room — like Element, Cinny, and Sable.

Today it shows a deduplicated union of members across the whole space (space room + all visible child channels), which inflates the count (~1780 vs ~743) and can hide room-only members (e.g. bots present only in that channel).

Root cause (confirmed in code)

In app/pages/chat.vue:

<ChatMemberList
  v-else-if="selectedSpaceIdRef && spaceMemberGroups.length > 0"
  :grouped-members="spaceMemberGroups"
/>
<ChatMemberList v-else :members="memberItems" />
  • memberItems — correct: selectedRoom.getMembers() for the active room.
  • spaceMemberGroups — from useSpaceMembers, which iterates rootSpaceId + all visibleRoomsForSidebar IDs, dedupes by userId, and applies space-level custom roles.

Whenever a space is selected and roles exist, the space aggregate wins; room members are never shown.

Scope

  • Right sidebar (members panel) uses active selectedRoomId membership when a room is open.
  • Member count label reflects that room (joined members only).
  • Grouping: prefer room power levels / Matrix roles for channels (align with Element); space custom roles may remain for space-only views or settings — define in implementation.
  • Include all joined room members (bots, guests with join, etc.).
  • Home / DM rooms: keep existing memberItems behavior.

Out of scope

Branch

bug/chat-room-member-list

Acceptance criteria

  • In a large space channel (e.g. Morpheus #general): count matches Element (~700s), not root space (~1780).
  • Room-only bots/users appear in the list (e.g. both bots when both are joined in that room).
  • Switching channels updates list and count immediately.
  • DMs and Home group chats unchanged.

Test checklist

Unit

  • Member list source selects room vs space based on selectedRoomId + context.
  • Count equals joined members on mocked Room.getMembers().

Manual

  • Compare #general member count with Element.
  • Verify both room bots visible when joined in room.
  • Switch channel → list updates.

Related

Epic

Sub-issue of #3 (Phase 3).

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status
    Ready

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions