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

feat: LEAP-1424: LEAP-1370: Allow to zoom and pan the image in preview modal #6781

Merged
merged 26 commits into from
Dec 18, 2024

Conversation

hlomzik
Copy link
Collaborator

@hlomzik hlomzik commented Dec 12, 2024

Allow users to zoom in and pan images in preview modal, which you can open from Grid View.

Interactions are intuitive — scroll zooms and drag pans. This is also described in a tooltip.

Screenshot 2024-12-17 at 20 49 57

This PR also includes #6748 for LEAP-1424:

Open a simple modal with image from the data of clicked task. Allow to navigate between tasks visible in Grid view by Prev/Next buttons. Only one image is displayed right now.

Simple common hotkeys are available:

  • <Arrows left/right> to switch between tasks
  • <Space> to select/unselect task
  • <Escape> to close the modal
Screenshot 2024-12-07 at 19 02 19

PR fulfills these requirements

  • Tests for the changes have been added/updated (for bug fixes/features)
  • Docs have been added/updated (for bug fixes/features)
  • Best efforts were made to ensure docs/code are concise and coherent (checked for spelling/grammatical errors, commented out code, debug logs etc.)
  • Self-reviewed and ran all changes on a local instance (for bug fixes/features)

Change has impacts in these area(s)

  • Product design
  • Backend (Database)
  • Backend (API)
  • Frontend

Describe the reason for change

It's hard to quickly preview task and select it depending on a content in current state — if you open task it's another view and it takes time to load it. Here is the new view for quick preview.
In order to quickly examine images it also would be very helpful to easily zoom in and check details.

Does this change affect performance?

Not anymore!

Does this change affect security?

Nope

What alternative approaches were there?

Embed LSF into this modal, but that would be harder, heavier and current image interactions in Image tag are far from perfect.

What feature flags were used to cover this change?

fflag_feat_front_leap_1424_grid_preview_short

Does this PR introduce a breaking change?

  • Yes, and covered entirely by feature flag(s)
  • Yes, and covered partially by feature flag(s)
  • No
  • Not sure (briefly explain the situation below)

Click on task in Grid view now has a different action, but task selection is still possible if you click on task id with checkbox.

What level of testing was included in the change?

  • e2e
  • integration
  • unit

hlomzik and others added 12 commits December 3, 2024 13:21
Open a simple modal with image from the data of clicked task.
Allow to navigate between tasks visible in Grid view by Prev/Next buttons.
Only one image is displayed right now.
Modal is `bare` now to allow to make better styles for it.
UI is more dense and different elements are aligned.
Check fields for "Image" type and show modal only if it exists.
This modal can be invoked in Grid view of Data Manager to quickly preview and select tasks.
Now image is interactive and you can zoom in by scroll and pan by drag.
@github-actions github-actions bot added the feat label Dec 12, 2024
Copy link

netlify bot commented Dec 12, 2024

Deploy Preview for label-studio-docs-new-theme ready!

Name Link
🔨 Latest commit 1b3a3b1
🔍 Latest deploy log https://app.netlify.com/sites/label-studio-docs-new-theme/deploys/6762c40af038f60008e6da50
😎 Deploy Preview https://deploy-preview-6781--label-studio-docs-new-theme.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Dec 12, 2024

Deploy Preview for heartex-docs ready!

Name Link
🔨 Latest commit 1b3a3b1
🔍 Latest deploy log https://app.netlify.com/sites/heartex-docs/deploys/6762c40a3051130008e8bd6a
😎 Deploy Preview https://deploy-preview-6781--heartex-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@hlomzik hlomzik changed the title feat: LEAP-1424: Open preview window for images in Grid view feat: LEAP-1370: Allow to zoom and pan the image in preview modal Dec 12, 2024
MihajloHoma and others added 7 commits December 13, 2024 07:23
When we leave the Grid View by browser controls or by hotkeys we need to close the modal.
That also means that we don't need to intercept Quick View hotkey.
And `capture` was a huge hit for performance, because keydown handler was called million times
during handling the same event, leading to browser freeze.
When we leave the Grid View by browser controls or by hotkeys we need to close the modal.
That also means that we don't need to intercept Quick View hotkey.
And `capture` was a huge hit for performance, because keydown handler was called million times
during handling the same event, leading to browser freeze.
useEffect closing the modal should be global one-time one
@hlomzik
Copy link
Collaborator Author

hlomzik commented Dec 17, 2024

/git merge

Workflow run
Successfully merged: 28 files changed, 843 insertions(+), 58 deletions(-)

Copy link
Contributor

@bmartel bmartel left a comment

Choose a reason for hiding this comment

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

Looks good, the e2e tests are failing not sure that is related.

@hlomzik hlomzik changed the title feat: LEAP-1370: Allow to zoom and pan the image in preview modal feat: LEAP-1424: LEAP-1370: Allow to zoom and pan the image in preview modal Dec 18, 2024
@hlomzik hlomzik merged commit e5d54c7 into develop Dec 18, 2024
44 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants