viewer icon indicating copy to clipboard operation
viewer copied to clipboard

Fix scroll to zoom, resize small images to fill

Open ktprograms opened this issue 4 years ago • 19 comments

Setting the background to white is removed since it doesn't work well with the zooming (Outside the image boundaries is still transparent).

Transitions are disabled when zooming (or rather only enabled when zooming back to 1x or in to 1.3x) because they don't work well with zooming (feels laggy).

ktprograms avatar Nov 06 '21 07:11 ktprograms

@skjnldsv Can you please take a look at my replies (in particular the one about the hover background)

Also I'm assuming the Node / node test failed because I didn't commit the correct js/viewer-main.js and js/viewer-main.js.map files?

ktprograms avatar Nov 09 '21 06:11 ktprograms

Also I'm assuming the Node / node test failed because I didn't commit the correct js/viewer-main.js and js/viewer-main.js.map files?

Yes :) You can either do it here or ask the bot to do it for you with one of the following comments:

  • /compile /js will create a new commit containing the compiled files
  • /compile amend /js, will amend your previous commit
  • /compile fixup /js will create a fixup based on the previous commit

skjnldsv avatar Nov 09 '21 07:11 skjnldsv

Which issue does this PR close? Please link it. Thanks! :)

szaimen avatar Nov 10 '21 13:11 szaimen

Which issue does this PR close? Please link it. Thanks! :)

I don't think there are any

ktprograms avatar Nov 11 '21 01:11 ktprograms

I don't think there are any

Thanks for the answer! So it doesn't fix https://github.com/nextcloud/viewer/issues/916?

szaimen avatar Nov 11 '21 01:11 szaimen

Thanks for the answer! So it doesn't fix #916?

No, the mobile drag/zoom APIs are quite different.

ktprograms avatar Nov 11 '21 01:11 ktprograms

No, the mobile drag/zoom APIs are quite different.

Thanks for letting me know. The PRs title sounded like it coulld have fixed the mentioned issue.

szaimen avatar Nov 11 '21 01:11 szaimen

The PRs title sounded like it could have fixed the mentioned issue.

What the scroll to zoom meant is that previously, whenever I scroll on an image it just moves in seemingly random directions (the zoom point doesn't stay under the cursor).

ktprograms avatar Nov 11 '21 01:11 ktprograms

@skjnldsv I think I've done all the changes you requested in https://github.com/nextcloud/viewer/pull/1063/commits/aa829e43a0ed62d69a0df95799b7ca53165d2c87

ktprograms avatar Nov 24 '21 04:11 ktprograms

@skjnldsv https://github.com/nextcloud/viewer/pull/1063/commits/70957b6cbbea5e3c524a997e3bbcbb9f5c7991e7 is because I set up YouCompleteMe, so I also fixed a few vls diagnostic warnings (all in the doc comments). If you don't want the jsconfig.json file or these warning fixes, I'll revert the commit.

Edit: https://github.com/nextcloud/viewer/pull/1063/commits/940711625a8c8f5f56cc5402e12021b5499aca03 (turns out I didn't have let g:ycm_max_diagnostics_to_display = 0 in my vimrc, so I wasn't getting all the diagnostic warnings)

ktprograms avatar Dec 08 '21 08:12 ktprograms

Should I squash the handling of transparent images together with the fix zoom commit?

Also, why are the built js files stored in the repo? It makes it so much harder to make git changes like fixups (that I then rebase -i) because I need to also deal with the files in js/.

ktprograms avatar Dec 23 '21 01:12 ktprograms

@skjnldsv The way to fix both the title and arrows being over the image is to put the image in a smaller box that's not overlapping with the title and arrows.

The reason why small images need to be enlarged is because the viewer app shows the thumbnails generated using previewgenerator, and to save space people might store their thumbnails at a resolution lower than their browser window.

ktprograms avatar Dec 27 '21 07:12 ktprograms

The reason why small images need to be enlarged is because the viewer app shows the thumbnails generated using previewgenerator, and to save space people might store their thumbnails at a resolution lower than their browser window.

That's a very specific but interesting use-case. Might be worth showing a warning to the admin if this is the case. :thinking:

skjnldsv avatar Dec 27 '21 07:12 skjnldsv

@skjnldsv Sorry, I don't get why a warning would need to be shown?

ktprograms avatar Dec 27 '21 07:12 ktprograms

Also should I do the fix I suggested and put the image in a smaller box?

ktprograms avatar Dec 27 '21 07:12 ktprograms

@skjnldsv Sorry, I don't get why a warning would need to be shown?

On the overview page, we should warn admins that set a max_preview config to low, that it will impact their experience negatively. This is not for this PR

Also should I do the fix I suggested and put the image in a smaller box?

Not my call, up to the UI/UX team to approve

skjnldsv avatar Dec 27 '21 07:12 skjnldsv

that it will impact their experience negatively.

Especially with this PR, I don't see how it will cause a negative impact on experience?

ktprograms avatar Dec 27 '21 07:12 ktprograms

I don't see how it will cause a negative impact on experience?

  1. have a 20MP image
  2. Open it
  3. See pixelated zoomed image

skjnldsv avatar Dec 27 '21 07:12 skjnldsv

Isn't a 20 MP image quite big? I don't see how it would be a problem.

ktprograms avatar Dec 27 '21 07:12 ktprograms