Open prohde opened 8 years ago
+1 moreover link preview to site that require auth doesn t make sense(preview the login page).
Agreed. I have a bot notify to a room with some URLs after someone pushes commits to a repository. And many link previews annoy me.
I hope it would be customizable in Preferences, like Use Emojis
.
+1 A white-/blacklist for links that are (or aren't) to be previewed could be another approach.
If you really annoyed by this feature (like me), as a quick hack, you can replace
return getDescription(this)? or getTitle(this)?
in the show
method of
https://github.com/RocketChat/Rocket.Chat/blob/69b3c81840b246e74b2041dfd0f212612fd23d22/packages/rocketchat-oembed/client/oembedUrlWidget.coffee#L40
by
return false
so the oembedUrlWidget never shows up.
Or you can try making the condition more intelligent like detecting "sign in" strings:
return (getDescription(this)? or getTitle(this)?) and (not /sign.?in/i.test(getTitle(this)))
or extend, customize for your usual urls.
The real solution would be to make the widget really intelligent, showing helpful digest of the page content. But it will require much more work and adding heuristics is more art than science (I guess this is the way facebook and slack went).
Related RocketChat/Rocket.Chat#5495
Related RocketChat/feature-requests#639
If a user has permission to edit a message, he should also have permission to remove the preview. We'd only need a new icon to delete that preview since we already have a close icon.
@engelgabriel I'm interested in contributing to this, what is the intended design? (Sing Li told me to tag you)
From what I've understood:
Is that correct?
I'm not sure about this part: A preview showing up while you write the message
It seems like that could get very tricky to get a good UX balance, especially keeping the feature synced with mobile etc. The display of the preview will be hard to position without it looking messy, with thumbnails and snippets of different dimensions etc and it might obstruct other interface components.
Maybe just something very subtle to indicate that a link is detected and a preview will be added when the message renders in the stream.
On the second point, I definitely think the message author (or anyone who can edit) should be able to remove previews. Maybe even adding an admin config for a URL blacklist, to never load previews from certain domains. That might be helpful for instances with lots of specific links, where the previews just get in the way. e.g. open.rocket.chat
admins could put GitHub on the list and probably cut down a lot of client loading as well as clear up the reading experience. The repo previews are really not required.
Illustration of the concept...
I think a subtle approach is best. Loading previews while you type could be a very janky visual experience and cause all kinds of client side performance issues. I think the feature would also be only wanted by more advanced users, so it's best to let it surface with some lower priority than the main interfaces, to not overwhelm the basics.
On messages with 2 or more URLs, are we going to close all previews or have an X on each oembed to close specific ones?
It would be nice to close each independently, but it might not be feasible - e.g. if there's a single message property to toggle display of previews, it would be easier to work with in templates etc than something like an array of link ids with their own unique toggles.
A blacklist for which domains shouldn't be previewed would be really great.
I think it would be best if the user can simply wrap the link in some characters (e.g. <https://google.com>
) to indicate it should not be embedded. This allows the user to easily control which links are embedded and which aren't. This can be done in addition to a "remove link preview" option.
@matortheeternal If you add a comma just after the link, the preview is not shown, e.g. https://gitbug.com,
When you click the link you are directed to the URL without the comma. I am just not sure if it's a feature or a bug :-)
I am just not sure if it's a feature or a bug :-)
Probably classed as a parsing error.. I think there are others around on the subject of parsing links / URLs. Have a search - it isn't relevant to this issue
Adding comma does not work for all urls, only for some.
More reliable workaround seems to delete the leading http://
like
This shows no preview: www.google.com but is shown as a link in RocketChat
Any news on this issue? The only PR that I could find that had an implementation for this issue was closed =/ https://github.com/RocketChat/Rocket.Chat/pull/10755
@williamjamir I'm also curious what happened with that PR. My work uses RC and this issue is a little annoying, I'd be down to try contributing a fix to allow toggling previews at the user/channel level.
Sorry guys, I just realized I'd always postpone "the day where I'll finish it" and thought it was best to just close.
I'd be happy if it was implemented too!
I have a simple PR with this working, with a simple "Remove Link Preview" message action.
Demo: https://streamable.com/p0cxfj
Things to improve:
Do you have any more suggestions?
Any update on this? As a user, I would love to have the option to manually remove links per message.
Just wanted to refresh this topic. I have been hosting a server since 2017 with 3 to 10 users regularly interacting and sharing a lot of links and this would really be a life improvement.
The <https://example.com>
would be a really good way of allowing us to not trash a channel with dozens of embeds when we don't want to. This could be added in the little toolbar of shortcuts under the message box input to help users know it's possible.
What is blocking the other proposed solution at the moment?
The proposed hacks are not satisfying solutions :
https://
by @geekq : you can't use this trick with markdown links because markdown renderer needs https:// or http:// to know it's a link and output it like one.Can you check my PR and demo and see if this a desired behaviour? @Julianoe @timoaudi If so, I can finish the PR, improve the details and submit it
PR: https://github.com/RocketChat/Rocket.Chat/pull/21065 Demo: https://streamable.com/p0cxfj
For me that's one good UX take on that issue 👍
@knokio Sorry for the late reply, I missed your post. I'm not familiar with RC source code. From what I understand, your PR would add a new button to remove the link.
Question: Would this be a button for those people who read/receive a message or would this button be for the person who creates/writes a message which would remove the link preview for the receiver as well when clicked?
creates/writes IMHO
Question: Would this be a button for those people who read/receive a message or would this button be for the person who creates/writes a message which would remove the link preview for the receiver as well when clicked?
I like the button approach very much, so that an author can decide.
Even better would be to control that per link, if there are multiple links in a message. However, because this would be much more difficult (I suppose), it would IMO not be neccessary in a first approach.
More important for me would be to have an option to prevent previews in messages coming from an integration. We have external systems sending lists of URLs to Rocket.Chat and get previews for each, which is most painful to read. In previous versions, there were only the first link resulting in a preview image, which was acceptable. But since (I think) 6.0 this is not the case any more.
We have a lot of links to our CRM or Gitlab where the preview is without anything usefull as RocketChat is not logged in. I would love to just disallow preview for this domains.
@timoaudi @Avalarion @jschirrmacher @kolesar-andras @Julianoe I can get back to work on this, but I did not receive any feedback from the RC Team, how can I get feedback from them?
What I want is a simple personal preference setting; when set, I don't want to ever see link previews in messages I write or view.
In case it helps anyone, setting "parseUrls": false
when using the /api/v1/chat.postMessage
API disables the link preview.
Would it be possible to delete / close a link preview?
I think I'm not the only one who does not want a link preview for every link posted. So deleting it after the post was made would be nice. Even better would be seeing the preview right while typing the message and being able to close it then. So it would not be appended to the message. (like it is known from Facebook)