Skip to content

Tags dont display image and link previews #270

Closed

Description

@Zabuzard

Overview

Right now we use embeds for our tag system, but embeds (by default) dont display previews of image links and links in general.

This results in a major UX drawback, compared to the old Dyno system:

Install

/tag install vs ?tag install:

tj-bot install
dyno install

Ask

/tag ask vs ?tag ask

tj-bot ask
dyno ask

Ideas

At the top of my head, I see two possible fixes:

  • the easy fix - we just go back to plain messages instead of embeds
  • the advanced fix - we parse the content, identify all links and attach them as proper image/link to the embed, so that a preview is generated
    • this could be just attached to the very end of the message, like it is right now in the dyno system
    • or, but probably more complex, be added exactly at the point of mentioning in the message. but that likely requires splitting the message in multiple.

Activity

  1. added
    enhance command
    on Nov 19, 2021
  2. java-coding-prodigy commented on Nov 19, 2021

    @java-coding-prodigy
    Contributor

    I am for the advanced fix

  3. github-actions commented on Dec 20, 2021

    @github-actions

    This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

  4. Tais993 commented on Dec 21, 2021

    @Tais993
    Member

    Another possible solution is to allow setting an image for the embed, thus by command.
    This results in a better looking UI most of the times, and the few times multiple links are required we'll have to go with the advanced fix.

  5. github-actions commented on Jan 22, 2022

    @github-actions

    This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

  6. Tais993 commented on Jan 26, 2022

    @Tais993
    Member

    A total of 10 embeds can be send, so excluding the tag 9 more embeds.
    While I doubt we'll ever go over that, it does still require us to talk about it's behavior.

    How can we "escape" links, so they don't get rendered?
    And what to do if 10 or more links (which result in embeds) are found, we'll error or cut off?

    And images, do we want to send them as a file, or add them to the embed?
    If we want to add them to the embed, we'll have less room for links

  7. Zabuzard commented on Jan 26, 2022

    @Zabuzard
    MemberAuthor

    A total of 10 embeds can be send, so excluding the tag 9 more embeds. While I doubt we'll ever go over that, it does still require us to talk about it's behavior.

    Indeed, good point.

    How can we "escape" links, so they don't get rendered?

    I would say, using the same syntax as Discord, namely <http://...> instead of just http://....

    And what to do if 10 or more links (which result in embeds) are found, we'll error or cut off?

    I would just display as much as possible (so 9 previews in most cases) and silently not display the rest (without errors).

    And images, do we want to send them as a file, or add them to the embed? If we want to add them to the embed, we'll have less room for links

    Whatever looks better and more similar to how Discord behaves. In particular for mobile. I think for images it wouldnt matter much, they are probably properly displayed in both cases.

    We have to see how to add Link Previews though, you are right with that.

  8. niklaswimmer commented on Feb 10, 2022

    @niklaswimmer

    And what to do if 10 or more links (which result in embeds) are found, we'll error or cut off?

    I suggest we never let that happen in the first place. The tag-manage command should reject tags with to many unescaped links (or images) and ask the user to explicitly choose which images to send embed.
    If there should ever be the situation where a tag still contains to many links (idk, manual entry in the database?) I would send an error back to encourage people to fix it.

    I would say, using the same syntax as Discord, namely <http://...> instead of just http://....

    I like that, simple and concise.

  9. Tais993 commented on Feb 10, 2022

    @Tais993
    Member

    I suggest we never let that happen in the first place. The tag-manage command should reject tags with to many unescaped links (or images) and ask the user to explicitly choose which images to send embed. If there should ever be the situation where a tag still contains to many links (idk, manual entry in the database?) I would send an error back to encourage people to fix it.

    I rather accept it and send a warning that the user has 1 link too much, if we end up going for the error approach we should send the tag they gave us back. So they can edit it and don't lose all their process.

  10. niklaswimmer commented on Feb 10, 2022

    @niklaswimmer

    I rather accept it and send a warning that the user has 1 link too much, if we end up going for the error approach we should send the tag they gave us back. So they can edit it and don't lose all their process.

    A warning is fine as well, but you are right, we should definitely send the tag's message back. For the warning approach as well, since we want to encourage the user to fix this problem (otherwise it is like saying "there is a problem, but if you want to fix it you need to write everything again"). The returned message should furthermore be in a state where it can be copied directly, therefor all special sequences escaped.

    So to sum it up, either send a warning but accept it, or error out, but in any case send the user their message back for editing.

    That said it would be somewhat cool if that would be the general default for the tag-manage command, to send back the new message, unescaped and escaped (via buttons or something), though this probably is out of scope for this issue.

  11. Zabuzard commented on Feb 16, 2022

    @Zabuzard
    MemberAuthor

    @Tais993 Any hints on how to get such a preview image? Lets say I identified a link in the message. Now I want to add an embed that contains a preview image for the link - does JDA have something for that?

    I guess for actual png files (and similiar) its trivial, since we can just download the data and "attach as file", or is there something better?

  12. Tais993 commented on Feb 16, 2022

    @Tais993
    Member

    I'd just add it as attachment yeah, means we don't share the same limit of 9 for both images/videos and links.

    We find a link
    We check or it's escaped, if not.

    Check or it's a video/image, if it is add as attachment
    If we can't identify the link, put it in the message's content.

    Hopefully that makes sense?

  13. Zabuzard commented on Feb 16, 2022

    @Zabuzard
    MemberAuthor

    Yeah but how do you get Discord to display an image preview of a non-picture-link? Like https://www.google.de/?

    Or is that not possible?

  14. Tais993 commented on Feb 16, 2022

    @Tais993
    Member

    Just by adding it in the message's content.
    If you add the link in a spoiler, it's maybe nicer UX wise, and it still gets rendered.

  15. pinned this issue on Feb 25, 2022
  16. github-actions commented on Mar 19, 2022

    @github-actions

    This issue is stale because it has been open 30 days with no activity. Remove stale label, comment or add the valid label or this will be closed in 5 days.

  17. added
    valid
    on Mar 20, 2022
  18. Taz03 commented on Jul 19, 2022

    @Taz03
    Contributor

    i prefer the easy fix

  19. unpinned this issue on Aug 13, 2022
  20. self-assigned this
    on Oct 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhance commandpriority: majorvalid

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions