You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "Wang1rrr (via GitHub)" <gi...@apache.org> on 2026/09/22 15:50:14 UTC

[PR] fix(web): trim the topic search keyword in the client-side filter like the server does [rocketmq-dashboard]

Wang1rrr opened a new pull request, #4985:
URL: https://github.com/apache/rocketmq-dashboard/pull/4985

   ## What is the purpose of the change
   
   Fixes an empty topic table shown under a non-empty pager: a search keyword with surrounding
   whitespace makes the server return matches while the client-side filter drops every row.
   
   ## Root cause
   
   The server request trims the keyword, the client-side filter does not:
   
   ```ts
   // request
   search: searchText.trim() || undefined,
   
   // client-side filter (visibleTopics)
   if (searchText && !topic.name.toLowerCase().includes(searchText.toLowerCase())) return false;
   ```
   
   Typing `order ` (a trailing space — e.g. after pasting a topic name, or on a mobile keyboard that
   appends one) makes the server match and return rows with `total > 0`, while `visibleTopics`
   compares against the untrimmed string and removes every row. The result is an empty table whose
   pager and header count still report "N topics", which reads like a broken backend rather than a
   whitespace artefact.
   
   ## What is fixed
   
   The client-side filter now trims (and lower-cases once per call instead of once per row) the
   keyword, so it matches the server's own matching rule:
   
   ```ts
   const keyword = searchText.trim().toLowerCase();
   // ...
   if (keyword && !topic.name.toLowerCase().includes(keyword)) return false;
   ```
   
   ## Verification
   
   `npm test` passes: 139 files / 1285 tests on the `rocketmq-studio` trunk, plus `vite build`
   (`tsc -b` + `vite build`) and `eslint src --quiet` with no errors.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix(web): trim the topic search keyword in the client-side filter like the server does [rocketmq-dashboard]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed pull request #4985: fix(web): trim the topic search keyword in the client-side filter like the server does
URL: https://github.com/apache/rocketmq-dashboard/pull/4985


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix(web): trim the topic search keyword in the client-side filter like the server does [rocketmq-dashboard]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #4985:
URL: https://github.com/apache/rocketmq-dashboard/pull/4985#issuecomment-5943188595

   This pull request has been automatically closed because there has been no activity for 7 days. If you would like to continue working on this, please reopen the PR with updated changes.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org