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

Display matrix.to links to a specific user as "user tags" #84

Open
kevinaboos opened this issue Jul 15, 2024 · 1 comment · May be fixed by #390
Open

Display matrix.to links to a specific user as "user tags" #84

kevinaboos opened this issue Jul 15, 2024 · 1 comment · May be fixed by #390
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Looking for help from anyone!

Comments

@kevinaboos
Copy link
Member

kevinaboos commented Jul 15, 2024

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:

image

Discord displays them like so:

image

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 a matrix.to link to a specific user. User tag links look like this:

<a href=\"https://matrix.to/#/@kevinaboos:matrix.org\">Kevin Boos</a>

The Robrix-specific HTML widget instance is defined here:

// A centralized widget where we define styles and custom elements for HTML
// message content. This is a wrapper around Makepad's built-in `Html` widget.
RobrixHtml = <Html> {

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 special UserTag. Once that widget is implemented, we'll need to override the default handling for the a HTML tag (a link), which is specified here in the code:

A UserTag should contain an Avatar and a Label with the user's displayable name.

Upon being clicked, a UserTag should open the UserProfileSlidingPane, which an Avatar already supports as of #78. This was implemented in #90.

@kevinaboos kevinaboos added enhancement New feature or request good first issue Good for newcomers help wanted Looking for help from anyone! labels Jul 15, 2024
@kevinaboos
Copy link
Member Author

PR #90 added support for handling when a user clicks on a matrix.to link or a user tag. But it doesn't change anything about how those links are displayed (they're still displayed as regular HTML links instead of the desired "User Pill" widget).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Looking for help from anyone!
Projects
Status: Ready
Development

Successfully merging a pull request may close this issue.

2 participants