fix: OPTIC-2153: UI Bug: Screen Goes Blank When Filtering by Predicted Model Version in Label Studio Projects #7477
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.
This pull request introduces improvements to the
FilterDropdownandVariantSelectcomponents in theweb/libs/datamanagerlibrary. The changes enhance rendering flexibility, optimize performance usinguseMemo, and include a debugging log statement.Enhancements to
FilterDropdown:optionRenderfallback logic to provide a default rendering function for items whenoptionRenderis not supplied. This ensures graceful handling of undefined or missing renderers. ([web/libs/datamanager/src/components/Filters/FilterDropdown.jsxL22-R24](https://github.com/HumanSignal/label-studio/pull/7477/files#diff-a4ff42c4402833e0664a026f4723495c29586c13b13260007626af77b054f4b6L22-R24))console.logstatement to log the computedoptionsfor debugging purposes. ([web/libs/datamanager/src/components/Filters/FilterDropdown.jsxR44](https://github.com/HumanSignal/label-studio/pull/7477/files#diff-a4ff42c4402833e0664a026f4723495c29586c13b13260007626af77b054f4b6R44))Optimizations in
VariantSelect:selectedValuewith auseMemohook to improve performance by memoizing the computed value based on dependencies. ([web/libs/datamanager/src/components/Filters/types/List.jsxL13-R19](https://github.com/HumanSignal/label-studio/pull/7477/files#diff-a0ca81dca8c1f711a923db92ff91f83a7a6ddf736feeeaa5eaac67b2c651e9f8L13-R19))Other changes:
useMemoinList.jsxto support the new memoization logic. ([web/libs/datamanager/src/components/Filters/types/List.jsxR3](https://github.com/HumanSignal/label-studio/pull/7477/files#diff-a0ca81dca8c1f711a923db92ff91f83a7a6ddf736feeeaa5eaac67b2c651e9f8R3))