Skip to content

Display link previews beneath a message containing a link #81

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

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

Display link previews beneath a message containing a link #81

kevinaboos opened this issue Jul 15, 2024 · 1 comment · May be fixed by #384
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

Most chat/messaging services display a preview of a link (or multiple links) included in a message, which makes it easier to quickly find, understand, and click links. We want to add this feature to Robrix too.

Implementation Approach

As of PR #76, this is now possible because we properly linkify plaintext URLs. This means that links will always be easily discoverable because they'll exist in a canonical HTML link format: <a href=...>Link</a>.

For the Makepad DSL components, we can add an optional LinkPreview view that can be added into the Message view, most likely by included it after the message subview here in the DSL code:

message = <HtmlOrPlaintext> { }

By default, this view would be marked as visible: false, and would only be set to visible: true if a link was found in the message text (which thanks to linkification from PR #76, should be easy to detect).

The LinkPreview view itself should consist of two subviews: an image thumbnail of the linked website, and a text summary of the linked website. The text preview should include the title, an optional subtitle, and a 2-3 line preview of the website text body.
This LinkPreview view should also be clickable (set cursor: Hand and handle click/tap events), and open the linked URL upon click, just like if the user had clicked the actual HTML URL.

The Rust crate called link-preview should be able to help us retrieve and generate the metadata from the link.

Examples

Here's what Discord shows:

image

Here's an example of an Element link preview:

image

Signal messenger shows the preview above the message, but I think showing it below the message makes more sense and is more standard

image
@kevinaboos kevinaboos added enhancement New feature or request help wanted Looking for help from anyone! labels Jul 15, 2024
@kevinaboos kevinaboos moved this to Ready in Robrix Aug 19, 2024
@kevinaboos kevinaboos moved this to Ready in Robrix Sep 18, 2024
@fmzbl fmzbl self-assigned this Nov 5, 2024
@kevinaboos kevinaboos moved this from Ready to In progress in Robrix Nov 12, 2024
@kevinaboos kevinaboos moved this from In progress to Ready in Robrix Jan 3, 2025
@alanpoon alanpoon added the Assigned Assigned to new contributors label Jan 23, 2025
@kevinaboos kevinaboos added good first issue Good for newcomers and removed Assigned Assigned to new contributors labels Jan 24, 2025
@kevinaboos
Copy link
Member Author

this is ready for someone to work on it, and is no longer being worked on or assigned to anyone.

laonger added a commit to laonger/robrix that referenced this issue Feb 7, 2025
…taining a link

Remaining Issue:

	1.	Due to the complexity of the page, many web pages cannot display the preview.
	2.	The preview card requires scrolling the page to be displayed.
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.

3 participants