Skip to content

Conversation

@Gondragos
Copy link
Contributor

Fix generating cursor image for brush.
Unified cursor updating logic across tools and regions by introducing a shared updateCursor method. Refactored brush and erase tools to use the BrushCursorMixin for consistent custom cursor generation. Simplified and removed redundant cursor management code from multiple regions and tools, improving maintainability.


Reason for change

The brush cursor was not updating correctly or consistently across tools and regions. The solution introduces a shared updateCursor method to unify and simplify cursor update logic. The BrushCursorMixin is now leveraged for consistent custom cursor management, improving maintainability and removing redundant code.

Image bigger that 128px can't be displayed as a cursor by most browsers.

Screenshots

Before

image image

After

image image

Testing

This change has been tested locally and manually:

  • Verified that the brush and erase tools display the appropriate updated cursors.
  • Ensured no regression issues in cursor management across all regions and tools.

Risks

No significant risks are identified. Changes simplify the cursor management logic without altering unrelated functionality.

Fix generating cursor image for brush.
Unified cursor update logic across tools and regions by introducing a shared `updateCursor` method. Refactored brush and erase tools to use the `BrushCursorMixin` for consistent custom cursor generation. Simplified and removed redundant cursor management code from multiple regions and tools, improving maintainability.
@netlify
Copy link

netlify bot commented May 7, 2025

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

Name Link
🔨 Latest commit 46e99ed
🔍 Latest deploy log https://app.netlify.com/sites/label-studio-docs-new-theme/deploys/681cdf8571e213000838a04a

@netlify
Copy link

netlify bot commented May 7, 2025

Deploy Preview for label-studio-storybook ready!

Name Link
🔨 Latest commit 46e99ed
🔍 Latest deploy log https://app.netlify.com/sites/label-studio-storybook/deploys/681cdf85c8605d0008d0555f
😎 Deploy Preview https://deploy-preview-7484--label-studio-storybook.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.

@netlify
Copy link

netlify bot commented May 7, 2025

Deploy Preview for heartex-docs canceled.

Name Link
🔨 Latest commit 46e99ed
🔍 Latest deploy log https://app.netlify.com/sites/heartex-docs/deploys/681cdf8524534400086f09b1

@github-actions github-actions bot added the fix label May 7, 2025
@Gondragos Gondragos requested review from hlomzik and nass600 May 7, 2025 14:24
Copy link
Contributor

@nass600 nass600 left a comment

Choose a reason for hiding this comment

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

Nice refactor, pretty neat 👏 . My only comment is, if the cursor will be used at least in Brush and Erase maybe CursorMixin and having its own file could be more semantic but not sure if I might be missing some other context

@Gondragos
Copy link
Contributor Author

fix: LEAP-2028: Fix brush cursor updating and visibility HumanSignal/label-studio-enterprise#7458

I thought about its own file for that, but this mixin is too specific (only Brush tools pack), so I prefer to keep it coupled for now.

@Gondragos
Copy link
Contributor Author

Gondragos commented May 8, 2025

/git merge

Workflow run
Successfully merged: create mode 100644 docs/source/guide/install_prompts.md

Copy link
Collaborator

@hlomzik hlomzik left a comment

Choose a reason for hiding this comment

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

I don't really like the name of the method with this parameter, because then updateCursor(true) looks unclear. One of the ways to go could be to use named param: updateCursor({ hovered: true }).
But that's a very focused feature anyway, so I'm okay with current version.

@Gondragos Gondragos enabled auto-merge (squash) May 8, 2025 16:39
@hlomzik hlomzik disabled auto-merge May 8, 2025 16:42
Co-authored-by: Andrew <[email protected]>
@Gondragos Gondragos enabled auto-merge (squash) May 8, 2025 16:46
@Gondragos Gondragos merged commit a0ca4a2 into develop May 8, 2025
38 checks passed
@robot-ci-heartex robot-ci-heartex deleted the fb-LEAP-2028/brush-cursor-fix branch May 8, 2025 17:16
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