Display matrix.to
links to a specific user as "user tags"
#84
Labels
enhancement
New feature or request
good first issue
Good for newcomers
help wanted
Looking for help from anyone!
Milestone
Currently, when a message includes a tagged username, it is displayed just like a regular link. Instead, we should display it using a special visual element that is embedded into the message's HTML content (this isn't relevant for plaintext messages).
Element displays user tags as shown below, and calls them "User Pills" because the displayed element is pill-shaped:
Discord displays them like so:
Implementation
Makepad's HTML widget supports displaying custom widgets as inline HTML components, so it should be straightforward to create a new widget (e.g.,
UserTag
) and include that as a possible template for any HTML URL that is amatrix.to
link to a specific user. User tag links look like this:The Robrix-specific HTML widget instance is defined here:
robrix/src/shared/html_or_plaintext.rs
Lines 34 to 36 in 61f4994
We will likely need to completely replace Makepad's default
HtmlLink
widget with a custom widget that supports displaying either a regular HTML link or a specialUserTag
. Once that widget is implemented, we'll need to override the default handling for thea
HTML tag (a link), which is specified here in the code:robrix/src/shared/html_or_plaintext.rs
Line 61 in 61f4994
A
UserTag
should contain anAvatar
and aLabel
with the user's displayable name.Upon being clicked, aThis was implemented in #90.UserTag
should open theUserProfileSlidingPane
, which anAvatar
already supports as of #78.The text was updated successfully, but these errors were encountered: