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

Better images preview behaviour #505

Closed
mingming-ma opened this issue Mar 15, 2024 · 6 comments · Fixed by #533
Closed

Better images preview behaviour #505

mingming-ma opened this issue Mar 15, 2024 · 6 comments · Fixed by #533
Assignees
Milestone

Comments

@mingming-ma
Copy link
Collaborator

mingming-ma commented Mar 15, 2024

As discussed in #493 (comment), we could use better lib such as react-medium-image-zoom to get enhanced images preview vs the image modal popup.

@Amnish04
Copy link
Collaborator

I was actually thinking of having the click and zoom feature inside the modal instead of completely removing the modal.
Reason being, the modal allows the user to look at the entire image in a single frame. My proposal is to extend that behaviour so users have more flexibility in preview

@mingming-ma
Copy link
Collaborator Author

@Amnish04 My bad, just saw the transparent background and images zoom from it's original size is great!
if we keep using the modal, do you mean we implement similar behaviour, e.g. the modal zoomed ? (I know we should change the cursor at the first step)

@Amnish04
Copy link
Collaborator

Amnish04 commented Mar 15, 2024

@mingming-ma I was thinking of allowing the user to zoom in and zoom out the image in the image preview modal itself.

I am not sure if what I've shared is the best library for our purpose, so I am looking for more.

Right now I am looking at this one
https://bettertyped.github.io/react-zoom-pan-pinch/?path=/story/docs-introduction--page

@Amnish04
Copy link
Collaborator

@mingming-ma I was experimenting with react-zoom-pan-pinch and it gives me this for starters.

ZoomPinchPanDemo

I think this one should be good for our needs as it supports mobile gestures as well.

My proposal:

  1. Let's have a zoom-in cursor on an unzoomed image when the modal opens.
  2. When a user clicks on the image, we should zoom it to a certain scale and allows the user to reposition the image center with drag/swipe like in my gif.
  3. When in zoomed state, the image should have a cursor of zoom-out.
  4. If the user clicks it again (in zoomed state), we should unzoom it, i.e. scale = 1

@mingming-ma
Copy link
Collaborator Author

@Amnish04 I think it's great to ship this! Can you make a PR when you're satisfied ?

@Amnish04 Amnish04 self-assigned this Mar 19, 2024
@Amnish04 Amnish04 added this to the Release 1.7 milestone Mar 20, 2024
@Amnish04
Copy link
Collaborator

@humphd suggested in today's triage that we can rather open the image in a new tab rather than implementing zoom and pulling a new library

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

Successfully merging a pull request may close this issue.

2 participants