fix(web): normalize dropdown option-filter input and option values - #2874
Open
yyqdbngt wants to merge 1 commit into
Open
fix(web): normalize dropdown option-filter input and option values#2874yyqdbngt wants to merge 1 commit into
yyqdbngt wants to merge 1 commit into
Conversation
RockteMQ-AI
reviewed
Aug 31, 2026
RockteMQ-AI
left a comment
There was a problem hiding this comment.
Summary
This PR contains moderate changes (182 lines). I have performed an initial structural review.
Observations
- Changes appear well-scoped
- CLA status: unknown
Maintainers: please verify the implementation details match the intended behavior.
Automated review by github-manager-bot
RockteMQ-AI
approved these changes
Sep 1, 2026
RockteMQ-AI
left a comment
There was a problem hiding this comment.
Summary
Defensive fix that improves input validation and error handling. Code looks clean and follows existing patterns.
LGTM
Automated review by "github-manager-bot"
RockteMQ-AI
approved these changes
Sep 1, 2026
RockteMQ-AI
left a comment
There was a problem hiding this comment.
LGTM — defensive fix improving input validation and error handling.
Automated review by "github-manager-bot"
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
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.
Summary
components/InstanceSelect.tsx: extract the instance-selectorfilterOptioninto an exportedmatchesInstanceOptionhelper that coerces both the search string and the option label withString(...) ?? ''before lower-casing.pages/settings/AiAssistantTab.tsx: extract the two AutoCompletefilterOptions (model selector + API-base preset selector) into one exportedmatchesAiOptionhelper with the same double-sided coercion; the old API-base filter additionally called.toLowerCase()onoption.valuewithout anyString()guard, and all three old expressions calledinput.toLowerCase()unguarded.Why
These dropdown filters compared user input against option fields without normalizing either side: a missing search string (
input.toLowerCase()onundefined) or a non-string option value ((option?.value ?? '').toLowerCase()on a number/null payload) would throw inside antd's filter path and break the whole dropdown. This is the same class of gap already fixed for the studio producer-group selector (matchesProducerGroupOption) and the component already used the one-sidedString(option?.label ?? '')pattern while leavinginputunguarded.Testing
cd web && ./node_modules/.bin/vitest run src/pages/settings/__tests__/aiAssistantOptionFilter.test.ts src/components/__tests__/instanceSelectFilter.test.ts— 2 files, 10 new tests passed.cd web && ./node_modules/.bin/vitest run src/pages/settings/__tests__/AiAssistantTab.test.tsx— 5 pre-existing tests still pass.cd web && ./node_modules/.bin/vitest run src/components— 8 files, 58 tests passed (no regressions in the shared component domain).cd web && ./node_modules/.bin/tsc --noEmit— clean.cd web && ./node_modules/.bin/eslint src/pages/settings/AiAssistantTab.tsx src/components/InstanceSelect.tsx src/pages/settings/__tests__/aiAssistantOptionFilter.test.ts src/components/__tests__/instanceSelectFilter.test.ts— 0 errors (2 react-refresh warnings for the exported helpers, same precedent as other helper exports).