Skip to content
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

Add unread highlighting mentions in the RoomPreview when a user menti… #349

Merged

Conversation

yangcancai
Copy link
Contributor

When the unread messages change, the num_unread_mentions value is also passed. If this value is greater than 0, the badge is displayed in red; otherwise, it is shown in gray.
issue: #329

Copy link
Member

@kevinaboos kevinaboos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, looks great! I just left a few tiny nitpicks.

src/home/rooms_list.rs Outdated Show resolved Hide resolved
src/home/rooms_list.rs Outdated Show resolved Hide resolved
src/home/room_preview.rs Outdated Show resolved Hide resolved
@kevinaboos kevinaboos added the waiting-on-author This issue is waiting on the original author for a response label Jan 24, 2025
@yangcancai yangcancai requested a review from kevinaboos January 25, 2025 01:54
Copy link
Member

@kevinaboos kevinaboos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, i forgot to check the code closely the first time. Sorry, I was distracted.

It seems like the key part of the logic is missing -- you're not actually displaying the number of unread mentions. You're only changing the color.

The logic should be:

  • if num_unread_mentions > 0, make the badge color red and display the number of unread mentions.
  • else if num_unread_messages > 0, make the badge gray and display the number of unread messages
  • else hide the badge.

@yangcancai yangcancai requested a review from kevinaboos January 25, 2025 13:23
Copy link
Member

@kevinaboos kevinaboos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thanks!

@kevinaboos kevinaboos merged commit 9c393a6 into project-robius:main Jan 26, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting-on-author This issue is waiting on the original author for a response
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants