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-1615: LEAP-456: Fix tool unselect #6630

Merged
merged 8 commits into from
Nov 19, 2024
Merged

Conversation

hlomzik
Copy link
Collaborator

@hlomzik hlomzik commented Nov 11, 2024

Pan was blocking the app upon unselection, because there were no tools selected after this. When drawing tools are not displayed (like in usual RectangleLabels case) then it's hard to start drawing again.
Also Selection tool (aka Move tool) was switched to the same behavior, allowing users to unselect it. The default tool will be selected then.
Also Smart tools selection is fixed — when you click on exact tool it's selected without weird jumps and rotation through other tools.

tools-improved.mov

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

Users can be stuck after using Pan tool and unselecting it. Also that's inconsistent with Move tool.

Does this change affect performance?

nope

Does this change affect security?

nope

What alternative approaches were there?

Make Pan tool also not unselectable like Move tool. But for cases without drawing tools visible that would make it worse.

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)

Pan was blocking the app upon unselection, because there were no tools selected after this.
When drawing tools are not displayed (like in usual RectangleLabels case) then it's hard to start drawing again.
@github-actions github-actions bot added the fix label Nov 11, 2024
Copy link

netlify bot commented Nov 11, 2024

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

Name Link
🔨 Latest commit e04178e
🔍 Latest deploy log https://app.netlify.com/sites/label-studio-docs-new-theme/deploys/673bf588d74af1000826bb77

Copy link

netlify bot commented Nov 11, 2024

Deploy Preview for heartex-docs canceled.

Name Link
🔨 Latest commit e04178e
🔍 Latest deploy log https://app.netlify.com/sites/heartex-docs/deploys/673bf5887b8ebc0008e18b97

The same way as Pan tool: default tool will be selected.
If user clicks on exact icon in popup panel the next tool is actually selected,
because there are two handlers active at this moment.
Fix this by blocking the more general one, used to rotate through all smart tools.
@hlomzik hlomzik changed the title fix: LEAP-1615: Fix tool unselect fix: LEAP-1615: LEAP-456: Fix tool unselect Nov 11, 2024
Copy link
Contributor

@yyassi-heartex yyassi-heartex left a comment

Choose a reason for hiding this comment

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

approved! one point - isSeparated and iconComponent are both removed - are they no longer used anywhere?

as an aside, its been a long time since i touched anything editor and I dont remember off hand if we have tests specifically for the different tools and tags - if not would be great to see more tests for that in a seperate ticket

@MihajloHoma
Copy link
Contributor

MihajloHoma commented Nov 13, 2024

/git merge

Workflow run
Successfully merged: create mode 100644 label_studio/tests/data_manager/actions/test_cache_labels.py

It's used in tests and they are failing now, because naming was changed
@hlomzik
Copy link
Collaborator Author

hlomzik commented Nov 14, 2024

isSeparated and iconComponent are both removed - are they no longer used anywhere?

@yyassi-heartex they are used when we render base tool via ToolView in tools/Base.jsx. and I switched Move tool to render its custom tag like we do in some other tools, so we don't need these params

@hlomzik hlomzik enabled auto-merge (squash) November 14, 2024 12:56
@hlomzik hlomzik merged commit 7a1ea23 into develop Nov 19, 2024
33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants