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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to