-
Notifications
You must be signed in to change notification settings - Fork 2.9k
fix: LEAP-1815: Fix initial image tool selection logic #7023
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Adjusted the return statement placement within the tool selection logic to ensure proper flow and avoid unintended behavior.
…ntation Introduces tests covering scenarios for default tool selection, preserved tool state, and invalid tool cases during initialization.
✅ Deploy Preview for label-studio-docs-new-theme canceled.
|
✅ Deploy Preview for heartex-docs canceled.
|
hlomzik
approved these changes
Feb 5, 2025
bmartel
reviewed
Feb 5, 2025
bmartel
approved these changes
Feb 5, 2025
/git merge
|
MihajloHoma
approved these changes
Feb 6, 2025
Add an `isInitial` flag to differentiate between initial and user-triggered tool selection. This prevents unnecessary actions during default tool assignment or preserved tool restoration. Updates ensure proper handling of state transitions with minimal side effects.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR fulfills these requirements
[fix|feat|ci|chore|doc]: TICKET-ID: Short description of change made
ex.fix: DEV-XXXX: Removed inconsistent code usage causing intermittent errors
Change has impacts in these area(s)
Describe the reason for change
There was a conflict between two features:
default tool
andpreserved tool
. Due to logic inconsistency, the second one annulated the first one even where there is no resolution about the selected tool yet.isInitial
flag is added to prevent a situation when the default tool sets a new preserved tool state to local storage before it was handled at all.What does this fix?
It allows the default tool to be selected in case if the preserved tool was not found in the config.
Does this PR introduce a breaking change?
(check only one)
What level of testing was included in the change?
(check all that apply)
Which logical domain(s) does this change affect?
Image Tools