HomePhabricator
Diffusion Comm ae17c897557e

[lib] introduce useMembersGroupedByRole

Description

[lib] introduce useMembersGroupedByRole

Summary:
Our new chat member list sidebar organizes the list of members in a chat by their role. This diff introduces a new hook that give a threadInfo will group all the members of that thread by their role and return an array of grouped role infos.

Thankfully rohan created useRolesFromCommunityThreadInfo which handles all the heavy lifting of figuring out the role info for each member in a thread. We can use that to group our members by their role, then sort the roles alphabetically by their role name and return them as an array of GroupedRoleInfos to be consumed later.

Linear task: https://linear.app/comm/issue/ENG-5977/group-each-member-in-the-community-by-role

Depends on D10978

Test Plan:
Confirmed that the roles + members for threads matched exaclty the same values that we had in our old thread members modal

Community parent channel:
Old members list modal:

Screenshot 2024-02-01 at 5.57.22 PM.png (2×3 px, 896 KB)

New member list sidebar:

Screenshot 2024-02-01 at 5.59.33 PM.png (2×3 px, 1003 KB)

Community sub-channel:
Old members list modal:

Screenshot 2024-02-01 at 5.57.50 PM.png (2×3 px, 857 KB)

New member list sidebar:

Screenshot 2024-02-01 at 6.00.03 PM.png (2×3 px, 926 KB)

Community sidebar:
Old members list modal:

Screenshot 2024-02-01 at 5.57.37 PM.png (2×3 px, 875 KB)

New member list sidebar:

Screenshot 2024-02-01 at 6.00.24 PM.png (2×3 px, 961 KB)

GENESIS Chat:
Old members list modal:

Screenshot 2024-02-01 at 5.58.00 PM.png (2×3 px, 869 KB)

New member list sidebar:

Screenshot 2024-02-01 at 6.00.49 PM.png (2×3 px, 925 KB)

Reviewers: atul, inka

Reviewed By: atul

Subscribers: ashoat, tomek

Differential Revision: https://phab.comm.dev/D10919

Details

Provenance
ginsuAuthored on Feb 1 2024, 12:54 PM
Reviewer
atul
Differential Revision
D10919: [lib] introduce useMembersGroupedByRole
Parents
rCOMM75d0111308c5: [native] update one time keys logic
Branches
Unknown
Tags
Unknown