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

feat: LEAP-1709: Add region index displaying to relations list #6941

Merged
merged 24 commits into from
Feb 4, 2025

Conversation

Gondragos
Copy link
Collaborator

@Gondragos Gondragos commented Jan 21, 2025

PR fulfills these requirements

  • Commit message(s) and PR title follow the format [fix|feat|ci|chore|doc]: TICKET-ID: Short description of change made ex. fix: DEV-XXXX: Removed inconsistent code usage causing intermittent errors
  • Tests for the changes have been added/updated (for bug fixes/features)
  • Docs have been added/updated (for bug fixes/features)
  • The 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)

(check all that apply)

  • Product design
  • Backend (Database)
  • Backend (API)
  • Frontend

Describe the reason for change

image
  1. There is no region indexes indication for the relations panel at all.
  2. There is an issue with setting region indexes when the region tab is not active.

What is the new behavior?

image
  1. Indexes are set every time when a region is created or deleted.
  2. Indexes are updated on sort / filter state changes.
  3. There is an indication of region index in the relations panel.
  4. Styles are slightly adjusted.

Does this PR introduce a breaking change?

(check only one)

  • Yes, and covered entirely by feature flag(s)
  • Yes, and covered partially by feature flag(s)
  • No
  • Not sure (briefly explain the situation below)

What level of testing was included in the change?

(check all that apply)

  • e2e
  • integration
  • unit

Which logical domain(s) does this change affect?

Relations Panel, region_index

Added a new region index element in the details panel with corresponding styles for alignment and visibility. Updated margin and layout adjustments for consistent design across elements. Introduced gap styling in relations panel for better spacing of node elements.
Region indices are now set consistently during sorting and creation. Removed redundant region index assignment in OutlinerTree to avoid discrepancies.
Copy link

netlify bot commented Jan 21, 2025

Deploy Preview for heartex-docs canceled.

Name Link
🔨 Latest commit 7cb6b56
🔍 Latest deploy log https://app.netlify.com/sites/heartex-docs/deploys/67a1c2c619027400083297db

Copy link

netlify bot commented Jan 21, 2025

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

Name Link
🔨 Latest commit 7cb6b56
🔍 Latest deploy log https://app.netlify.com/sites/label-studio-docs-new-theme/deploys/67a1c2c617ca7e00084e7f55

Refactored region index updates to a dedicated method `updateIndexes` for better consistency and maintainability. This ensures indexes are recalculated correctly after sorting, creation, or deletion of regions.

Resolved a problem causing crashes due to observer side effects.
@Gondragos Gondragos changed the title LEAP-1709: Add region index displaying to relations list feat: LEAP-1709: Add region index displaying to relations list Jan 23, 2025
@Gondragos Gondragos force-pushed the fb-leap-1709/region-index-in-relations branch from e73d107 to 66e8b69 Compare January 23, 2025 07:10
Added new utility methods for handling regions, labels, and localStorage in LSF helpers. Introduced customizable callbacks for `init` and improved functionality for ordering and deleting regions in the Sidebar.
Replaced `setRegionIndex` logic with a computed `region_index` derived from a new `regionIndexMap`. Add some new triggers for updateAppearenceFromState.
@Gondragos Gondragos force-pushed the fb-leap-1709/region-index-in-relations branch from 66e8b69 to 1a87c42 Compare January 23, 2025 16:28
Removed redundant updateIndexes calls and adjusted region_index getter to handle non-real regions properly. This improves performance and prevents errors related to invalid indexing.
Ensure localStorage values are correctly serialized only when necessary. This prevents potential issues when dealing with string data types.
Add integration test to verify region list consistency when regions are deleted or created. This includes handling changes affecting the entire list and ensuring correct relabeling and ordering.
@Gondragos
Copy link
Collaborator Author

Gondragos commented Jan 24, 2025

/git merge develop

Workflow run
Successfully merged: create mode 100644 web/tsconfig.json

Co-authored-by: bmartel <brandonmartel@gmail.com>
@Gondragos
Copy link
Collaborator Author

Gondragos commented Jan 28, 2025

/git merge develop

Workflow run
Successfully merged: delete mode 100644 docs/themes/v2/source/images/prompts/example_subset2.png

Gondragos and others added 4 commits January 28, 2025 04:43
Previously, annotation appearance updates were missing during certain interactions. This fix ensures `updateAppearenceFromState` is called after sorting or grouping regions. Added an integration test to verify label consistency when changing order.
….com/heartexlabs/label-studio into fb-leap-1709/region-index-in-relations
Ensure `updateAppearenceFromState` is called only if `annotation` is defined. This prevents runtime errors during the destruction phase.
@Gondragos
Copy link
Collaborator Author

Gondragos commented Jan 29, 2025

/git merge develop

Workflow run
Successfully merged: delete mode 100644 web/tsconfig.json

@Gondragos
Copy link
Collaborator Author

Gondragos commented Jan 29, 2025

/git merge develop

Workflow run
Successfully merged: Already up to date.

@Gondragos
Copy link
Collaborator Author

Gondragos commented Feb 3, 2025

/git merge develop

Workflow run
Successfully merged: create mode 100644 label_studio/tests/sdk/test_export.py

@Gondragos
Copy link
Collaborator Author

Gondragos commented Feb 3, 2025

/git merge develop

Workflow run
Successfully merged: 5 files changed, 47 insertions(+), 8 deletions(-)

@MihajloHoma
Copy link
Contributor

MihajloHoma commented Feb 4, 2025

/git merge develop

Workflow run
Successfully merged: 1 file changed, 27 insertions(+)

@Gondragos Gondragos merged commit ab3f405 into develop Feb 4, 2025
34 checks passed
@Gondragos Gondragos deleted the fb-leap-1709/region-index-in-relations branch February 4, 2025 14:06
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