fix(web): trim whitespace in cluster overview search normalization - #2871
Open
yyqdbngt wants to merge 1 commit into
Open
fix(web): trim whitespace in cluster overview search normalization#2871yyqdbngt wants to merge 1 commit into
yyqdbngt wants to merge 1 commit into
Conversation
RockteMQ-AI
approved these changes
Aug 31, 2026
RockteMQ-AI
left a comment
There was a problem hiding this comment.
Summary
Good catch — whitespace-only search silently hid all rows because "".includes(" ") is false. The fix aligns the cluster overview with the certs/clients pages that already trim. Tests cover the regression well.
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.
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
searchTextnormalizer trim user input in addition to being null-safe and lower-casing it (pages/cluster/index.tsx).searchTextfor unit coverage and add regression tests:pages/cluster/clusterSearchText.test.ts(trim / empty / whitespace-only / null / undefined input);ClusterPage.test.tsx: submitting a whitespace-only broker search keeps all broker rows visible.Why
The broker / NameServer / Proxy panels all use
Input.SearchwithonSearch, so a submission of only spaces previously produced a non-empty normalized keyword. Since"".includes(" ")isfalsefor every row, a whitespace-only search silently hid the entire table until the user cleared the box. The certs and clients pages already trim their search input; the overview page was the remaining outlier in the cluster domain.Testing
cd web && ./node_modules/.bin/vitest run src/pages/cluster/clusterSearchText.test.ts src/pages/cluster/__tests__/ClusterPage.test.tsx— 2 files, 24 tests passed (3 new unit tests, 1 new page-level regression test; all pre-existing tests still pass).cd web && ./node_modules/.bin/tsc --noEmit— clean.cd web && ./node_modules/.bin/eslint src/pages/cluster/index.tsx src/pages/cluster/clusterSearchText.test.ts src/pages/cluster/__tests__/ClusterPage.test.tsx— 0 errors (1 react-refresh warning for the exported helper, same precedent as other page-level helper exports).