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

Remove "Decrypt image.png (123 KB)" text. #16087

Closed
kevincox opened this issue Jan 7, 2021 · 8 comments
Closed

Remove "Decrypt image.png (123 KB)" text. #16087

kevincox opened this issue Jan 7, 2021 · 8 comments

Comments

@kevincox
Copy link

kevincox commented Jan 7, 2021

Description

Right now when you send or receive a message on element-web it shows "Decrypt image.png (123 KB)" if you click this it decrypts the image and you can click again to download/view. In my opinion this is a pointless feature.

  • As a user I don't care that it needs to be decrypted first.
  • I can already right-click the image to save/copy/view like every other site.
  • Most users don't care how big the image is. (I've already downloaded it anyways).
  • Clicking the image shows this information anyways, when the context makes sense.

image

Steps to reproduce

  • Go to an e2e chat room.
  • Send an image.

Version information

  • Platform: web

For the web app:

  • Browser: Firefox
  • OS: NixOS Linux
  • URL: app.element.io
@t3chguy
Copy link
Member

t3chguy commented Jan 7, 2021

This is a technical limitation of the Decryption being done asynchronously (and via a sandbox) and a lot of browsers forbidding downloads from triggering a download after such an event, only allowing it as a result of a direct user interaction, hence the need for a 2nd click. On Chrome I don't tend to need to click twice, clicking Decrypt automatically triggers a download, Firefox tends to be stricter

@kevincox
Copy link
Author

kevincox commented Jan 7, 2021

My point is that this link seems completely unnecessary. Users can already right-click to save like every other image in their browser or they can click the image and use the download button there. To me this link as a whole is just cluttering the chat log, whether you need to click once or twice.

@t3chguy
Copy link
Member

t3chguy commented Jan 7, 2021

Two of your points are misguided, the image shown in the timeline will be just a thumbnail, you clicking decrypt/download is regarding the full-size one.

@kevincox
Copy link
Author

kevincox commented Jan 7, 2021

Hmm, this does seem to be the case for non-encrypted rooms. For encrypted rooms it will be the full image because there is no server to thumbnail it anyways. It could be removed for encrypted rooms, but it would be too confusing if the UI differs.

Another option is that since the full image is available we should be able to generate the link upfront. But that isn't as good as removing it entirely.

@t3chguy
Copy link
Member

t3chguy commented Jan 7, 2021

The client (sender) can generate a thumbnail along with a source file.
Element Web does make use of this.

Example event containing both source image and thumbnail:

{
  "type": "m.room.message",
  "content": {
    "body": "image.png",
    "info": {
      "size": 3444873,
      "mimetype": "image/png",
      "thumbnail_info": {
        "w": 337,
        "h": 600,
        "mimetype": "image/png",
        "size": 413638
      },
      "w": 901,
      "h": 1600,
      "thumbnail_file": {
        "v": "v2",
        "key": {
          "alg": "A256CTR",
          "ext": true,
          "k": "...",
          "key_ops": [
            "encrypt",
            "decrypt"
          ],
          "kty": "oct"
        },
        "iv": "...",
        "hashes": {
          "sha256": "..."
        },
        "url": "mxc://riot.ovh/eeMYMwRWeEDlBXYSqyUyLKGH",
        "mimetype": "image/png"
      }
    },
    "msgtype": "m.image",
    "file": {
      "v": "v2",
      "key": {
        "alg": "A256CTR",
        "ext": true,
        "k": "...",
        "key_ops": [
          "encrypt",
          "decrypt"
        ],
        "kty": "oct"
      },
      "iv": "...",
      "hashes": {
        "sha256": "..."
      },
      "url": "mxc://riot.ovh/jOkMmIeFlQVYAeBuKNFRTJFD",
      "mimetype": "image/png"
    }
  }
}

@t3chguy
Copy link
Member

t3chguy commented Jan 7, 2021

Its also a useful button for Element Desktop which doesn't have a right click save-as

@kevincox
Copy link
Author

kevincox commented Jan 7, 2021

Ok, sounds like there are more use cases for this button than it seems. I think it still may be ideal to make it less obvious (such as relying on the download button after click) but it isn't as clear of an improvement as it seemed. I'll close this for now.

It is worth noting that most other messaging apps make the download option far less obvious I can only assume this is based on use metrics of how often that is used vs the noise on screen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@kevincox @t3chguy and others