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

fix: LEAP-1731: Bulk annotation follow-ups #6867

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

hlomzik
Copy link
Collaborator

@hlomzik hlomzik commented Jan 8, 2025

UX fixes:

  • continue to pan when cursor is out of the image
  • don't close modal if user released cursor out of the image
  • user-select: none to always prevent from selection
  • info about zoom and pan to tooltip

Image Preview is rewritten to be a class component, it's more readable and fixes some issues.

All modals in DM now fixes the window to be non-scrollable — that's usual behaviour for modals and we just missed this.

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

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)

All modals in DM are affected, but the fix is very expected.

What level of testing was included in the change?

  • e2e
  • integration
  • unit

Image preview modal pulled a screen a little when user is zooming the image.
Aparently that's the problem of all the modals - they don't block body.
Fixed here.
- continue to pan when cursor is out of the image
- don't close modal if user released cursor out of the image
- user-select: none to always prevent from selection
- class component is just more readable
@github-actions github-actions bot added the fix label Jan 8, 2025
Copy link

netlify bot commented Jan 8, 2025

Deploy Preview for label-studio-docs-new-theme canceled.

Name Link
🔨 Latest commit 1ce5230
🔍 Latest deploy log https://app.netlify.com/sites/label-studio-docs-new-theme/deploys/677e9d61baafa100088781af

Copy link

netlify bot commented Jan 8, 2025

Deploy Preview for heartex-docs canceled.

Name Link
🔨 Latest commit 1ce5230
🔍 Latest deploy log https://app.netlify.com/sites/heartex-docs/deploys/677e9d61bbe9880008f76726

@bmartel
Copy link
Contributor

bmartel commented Jan 9, 2025

it's more readable and fixes some issues.

Could you elaborate more about what issues it fixed?

The problem I have with introducing class components is that React going forward is moving further and further from this, and the mindshare is already entirely shifted into hooks being the canonical way to develop with React. As a result this means all main libraries are hooks only, including state management approaches. I would not want to have to be maintaining 2 methods of developing components, so it would have to be a definitive reason to consciously move towards.

As for the more readable, that is a subjective take, as I actually see the opposite. What I do agree with is that there are far too many cases of components which happened to use hooks incorrectly which clouds things quite a bit. That is why I framed it more of the mindset that we need to tighten the belt on component best practices, including (must include this) guidance on state management from top to bottom so we don't continue to perpetuate what I consider useEffect / useState hell. No one can reason about that type of state mismanagement, but I don't see that as a React hooks problem, more just a miss entirely on needed refactors when components graduate from a couple pieces of state with a simple interaction, to something greater.

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.

2 participants