Description
Describe the bug
It happens when annotating an image, for example with rectangles.
When a rectangle is hidden while the mouse is moving over it, the screen freezes for a few seconds. It can only happen when using the shortcut (to have the mouse moving over the region while hiding it)
To Reproduce
Steps to reproduce the behavior:
- Open a task with an image to label
- add a region, for example a rectangle. Select that region
- use the shortcut alt+h to make the region appear and disappear. Don't move the mouse. It should work as intended
- keep doing 3 while moving the mouse over the region. The screen will freeze and hiding the rectangle will take a few seconds. The freeze stops when the rectangle is finally hidden. The freeze doesn't happen when the mouse is not moving or when the mouse is moving anywhere other than over the selected region.
Expected behavior
Screen should not freeze when moving over a region that is being hidden.
Screenshots
In this video, I'm hitting alt+h non stop, at constant pace, from 0:13 to 0:28
https://github.com/user-attachments/assets/97cef024-b6cb-43f1-a01b-045a418cee07
Environment (please complete the following information):
- OS: observed on Mac and Ubuntu
- Label Studio Version: 1.12.X and develop branch
Additional context
This happens to me all the time when I'm adding missing element(s) to a pre-annotated image.