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

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

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 351b7e9
🔍 Latest deploy log https://app.netlify.com/sites/heartex-docs/deploys/679394f6dff2bb0008dd4306

Copy link

netlify bot commented Jan 21, 2025

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

Name Link
🔨 Latest commit 351b7e9
🔍 Latest deploy log https://app.netlify.com/sites/label-studio-docs-new-theme/deploys/679394f6c0cf5500085e3b9e

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant