-
Notifications
You must be signed in to change notification settings - Fork 270
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat: Added 'Online User Status' Filter to Members List #782
base: develop
Are you sure you want to change the base?
Feat: Added 'Online User Status' Filter to Members List #782
Conversation
Hey @dhairyashiil, I believe this feature might not be a priority for Embedded Chat at the moment. Since the online status of members is already indicated by the green dot over the circle, adding an extra filtering option for this seems redundant. What are your thoughts on this, @dhairyashiil, @Spiral-Memory? |
Hello Smriti, I see your point, but I think this feature could still be useful in some situations:
I agree that for small chats with just 1-10 people, it’s not needed, but when there are more members, it could really help. |
Yeah, initially it felt like a useless option to me as well, but it does have its own use. and Since Rocket.Chat follows this idea, we’re good to integrate it into Embedded Chat as well. Will review, @dhairyashiil . |
Hello @Spiral-Memory and @smritidoneria, I believe the filter now makes even more sense. By selecting "Online" from the filter, you will see the total number of online users currently. For reference, please see the screenshot (SS) of Rocket Chat. . divider.and.count.mp4 |
@Spiral-Memory, quick question: If there are a total of 6 users in the room and 2 of them are online, should we show 'Showing 2 of 2' or 'Showing 2 of 6'? |
Technically it should 2/6, but follow whatever RC is following |
Hello @Spiral-Memory, we haven't discussed this PR today. Please review it when you get a chance. Thank you. |
@@ -52,19 +58,60 @@ const RoomMembers = ({ members }) => { | |||
}, [RCInstance]); | |||
|
|||
useEffect(() => { | |||
const fetchStatuses = async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a bit unsure about this, this is why I didn't say anything on this, this is like creating so many requests to the server right ?
You need not to do that, you may simply filter from the member list right ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh, yupp. That's correct.
Then maybe we can implement a batch strategy.
If the API supports it, we could make a single request that retrieves the statuses of multiple users at once, instead of making a request for each individual member. For example, an endpoint like GET /users/statuses?ids=1,2,3,4,... would reduce the number of requests from N to 1.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe, you can just filter the list
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, so by getting the member IDs from the member list and using the API const res = await RCInstance.getUserStatus(user._id);
, correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See you already have the member list and in that list, you've the status of all the members..
Now when then online filter is set, you can iterate and filter out all online people..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, got it. will work on this.
Thank you for time 👍
15554ff
to
27dcbe6
Compare
Brief Title
Feat: Added 'Online User Status' Filter to Members List
Acceptance Criteria fulfillment
Fixes #781
Video/Screenshots
online.user.status.filter.mp4
and
online.user.status.filter.in.theme.mp4
Admin View:
PR Test Details
Note: The PR will be ready for live testing at https://rocketchat.github.io/EmbeddedChat/pulls/pr-782 after approval. Contributors are requested to replace
<pr_number>
with the actual PR number.