zulip-flutter icon indicating copy to clipboard operation
zulip-flutter copied to clipboard

content: Highlight non-silent mentions of the self-user

Open chrisbobbe opened this issue 3 months ago • 4 comments

This probably makes sense to do after #646.

We should highlight non-silent mentions of the self-user, following web, so that users can easily see when a mention is intended to get their attention.

For some examples (and here I'm logged in as the "Chris Bobbe" account):

image image

Notice the highlighting is done in two ways:

  • The text of the mention itself is styled
  • The whole message gets an interesting background color

Implementation

To determine if the self-user is mentioned, we'll use the corresponding per-user flags on the message. Any of the "mentioned" flags here (some of which are to be added by #894): https://zulip.com/api/update-message-flags#available-flags mean that the self-user was mentioned.

That's enough to know we should highlight the message. Then to highlight the mention within the message, if one or more of those flags is set we'll search the message content to find the corresponding mentions.

chrisbobbe avatar May 07 '24 23:05 chrisbobbe