Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Conversation

SimonBrandner
Copy link
Contributor

@SimonBrandner SimonBrandner commented Dec 21, 2020

This PR improves the image view according to the design. For more details try out the live preview.

Features:

  • Bunch of useful buttons
  • Zooming
  • Rotating
  • Panning

Screenshot_20210225_115448
Screenshot_20210225_124743

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
@turt2live turt2live requested review from a team December 22, 2020 15:45
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
@turt2live turt2live requested a review from a team April 5, 2021 16:55
Copy link
Member

@turt2live turt2live left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking pretty great - thank you for working on it! It's a big PR, so might need a couple rounds of review before we iron out all the pieces.

I noticed a couple bugs while giving this a quick test:

  1. Redacting the image from context menu just leaves a broken image tag in the middle of the screen. @niquewoodhouse is there some sort of "you deleted this image" state we can show instead? (noting that the user won't ever be able to get to it without that context menu)
  2. Clicking the rotate icons to go a full 360 causes the 4th click to spin wildly in the opposite direction. As a user, I'd expect that it smoothly rotates like it did for the other 3 clicks.
// height: 20px;
.mx_ImageView_button_close {
border-radius: 100%;
background: #21262c;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we're hardcoding it then it's not worth it, just add a comment like // same on all themes to the end

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
@SimonBrandner
Copy link
Contributor Author

Thanks for the review!

  1. The ImageView should now close itself when the image gets redacted, but @niquewoodhouse might have some better ideas
  2. Fixed
@niquewoodhouse
Copy link
Contributor

The ImageView should now close itself when the image gets redacted, but @niquewoodhouse might have some better ideas

Sounds great to me, will see how it feels in reality a few times and raise a follow up issue if amends needed. @turt2live thank you for testing and noting that

@SimonBrandner SimonBrandner requested a review from turt2live April 9, 2021 10:58
Copy link
Member

@turt2live turt2live left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is getting there 😃 The code is looking fine, now it's just functional bits.

New round of bugs:

  1. Removing the image briefly causes a flash of the image UI after the viewer goes away. This is quite distracting - it would be good to go from the delete dialog straight to the timeline without a flash of the viewer.
  2. The download button on unencrypted images opens in the same tab when it should be a new tab (target="_blank").

Visually, it'd be good to have the image viewer stay underneath the dialogs a user can spawn, I think. In practice I think this means making the image viewer a static dialog so the other dialogs show up on top, but I'm not sure how the backdrops will interact. This could also fix issue 1 in this comment because it wouldn't be flashing around. @niquewoodhouse does that suggestion work for you? (and @SimonBrandner if it ends up being too difficult, feel free to punt it and we'll take a look elsewhere)

This avoids some delay in the dialog disappearing Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
@SimonBrandner
Copy link
Contributor Author

SimonBrandner commented Apr 13, 2021

This is how it looks with the dialog static (personally, I like it much better than the previous solution):

Screenshot_20210413_080304

I've fixed the delay when deleting by moving some stuff around

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
The button is useless and doesn't work if we're viewing an avatar Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
@SimonBrandner SimonBrandner requested a review from turt2live April 13, 2021 06:18
@niquewoodhouse
Copy link
Contributor

niquewoodhouse commented Apr 13, 2021

Visually, it'd be good to have the image viewer stay underneath the dialogs a user can spawn, I think.

That's how it currently is in the netlify, right? That's how I think it worked when I previously reviewed* Dialogs appear on top of the image. Or am I misunderstanding - because I think the suggestion is already there, and I think it works better than current, where image the vanishes. @turt2live please let me know if I've not understood but I'm happy with how it works now, eg #5521 (comment))

*Turns out it didn't, I'm just an idiot. I agree with the suggestion, 100%

@SimonBrandner
Copy link
Contributor Author

@niquewoodhouse, it wasn't there but it is there now. I've added it this morning :D

@niquewoodhouse
Copy link
Contributor

@niquewoodhouse, it wasn't there but it is there now. I've added it this morning :D

Oh really, wow, I'm a moron. Thanks @turt2live for the suggestion, very pleased with it

Copy link
Member

@turt2live turt2live left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's see what happens :D

@turt2live turt2live merged commit ac00c80 into matrix-org:develop Apr 14, 2021
@SimonBrandner SimonBrandner deleted the improve-image-view branch April 14, 2021 05:33
@jackkinsey
Copy link

It looks like right clicking also triggers zoom, which was surprising to me.

@SimonBrandner
Copy link
Contributor Author

@jackkinsey, I've created #16961

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

6 participants