Skip to content

fix: LEAP-2009: Respect granularity when resizing NER spans #7364

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

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

Conversation

hlomzik
Copy link
Collaborator

@hlomzik hlomzik commented Apr 11, 2025

Fix to reuse the same funtionality we use in captureSelection():

  • trimSelection() (the secret sauce!) to fix selection to point only to text nodes;
  • applyTextGranularity() to the selection expading it if needed

We need trimSelection() so selection.move() will work properly.
With non-text nodes it jumps into inner/outer nodes instead of shifting symbol by symbol.

Also set cursor to "resize" for the whole document during resize.

@github-actions github-actions bot added the fix label Apr 11, 2025
Copy link

netlify bot commented Apr 11, 2025

Deploy Preview for label-studio-storybook ready!

Name Link
🔨 Latest commit e078547
🔍 Latest deploy log https://app.netlify.com/sites/label-studio-storybook/deploys/68065ef88fc601000854a9b3
😎 Deploy Preview https://deploy-preview-7364--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.

Copy link

netlify bot commented Apr 11, 2025

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

Name Link
🔨 Latest commit e078547
🔍 Latest deploy log https://app.netlify.com/sites/label-studio-docs-new-theme/deploys/68065ef86af4700008e1bca6
😎 Deploy Preview https://deploy-preview-7364--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 Apr 11, 2025

Deploy Preview for heartex-docs ready!

Name Link
🔨 Latest commit e078547
🔍 Latest deploy log https://app.netlify.com/sites/heartex-docs/deploys/68065ef8a3b1030008ae7a99
😎 Deploy Preview https://deploy-preview-7364--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 requested review from Gondragos and nass600 April 11, 2025 15:56
Otherwise it would hang the browser because of a very complex inner logic.
@hlomzik hlomzik requested a review from nass600 April 15, 2025 13:12
It fixes selection to point only to text nodes, so selection.move() will work properly.
With non-text nodes it jumps into inner/outer nodes instead of shifting symbol by symbol.
@MihajloHoma
Copy link
Contributor

MihajloHoma commented Apr 17, 2025

/git merge

Workflow run
Successfully merged: create mode 100644 web/libs/ui/src/utils/utils.ts

@MihajloHoma
Copy link
Contributor

MihajloHoma commented Apr 17, 2025

/fm sync

Workflow run

@MihajloHoma
Copy link
Contributor

MihajloHoma commented Apr 18, 2025

/git merge

Workflow run
Successfully merged: 4 files changed, 48 insertions(+), 19 deletions(-)

@MihajloHoma
Copy link
Contributor

MihajloHoma commented Apr 18, 2025

/fm sync

Workflow run

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