-
Notifications
You must be signed in to change notification settings - Fork 29
issues #81: Display link previews beneath a message containing a link #384
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
base: main
Are you sure you want to change the base?
Conversation
…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.
You need to pass the ci first. |
done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, this is a great start on this new feature!
Some questions:
- do we actually need a dedicated cache type for link previews? Seems like a general map would work just fine, since it's a simple case.
- The name "card cache" is confusing. What are "cards" in this context? Isn't it just a cache of link previews? Please change the term "card" accordingly throughout your whole PR.
- Undo all formatting changes. All those unnecessary changes make it really hard for me to properly review this PR.
- The widget structure of where you placed the LinkPreviewCard is ... unusual. See my comments about moving it into the Message widget's
content
subview within itsbody
.
One other issue, when there is more than one link, is the display of this card only one or, all of them, and when displaying too many cards, does it take up too much vertical space in the room_screen? |
…MatrixRequest::FetchLinkPreviewCard` to `LinkPreviewResult`
we just need url to fetch the MatrixRequest::FetchLinkPreview { url } => {
let _fetch_task = Handle::current().spawn(async move {
let preview_service = url_preview::PreviewService::with_no_cache();
match preview_service.generate_preview(&url).await {
Ok(preview) => {
log!("preview data: {:?}", preview);
},
Err(e) => {
log!("Failed to fetch link preview card for {url}: {e}");
}
};
});
} when we get the preview data, then we store to chace or use
you can see this PR #390 |
upgrade url-preview to 0.3.2
upgrade url-preview to 0.3.2
….rs to share/link_preview_card.rs
Fixes #81
Remaining Issue: