Copilot commented on code in PR #327:
URL: 
https://github.com/apache/kvrocks-controller/pull/327#discussion_r2228374125


##########
webui/src/app/namespaces/[namespace]/clusters/[cluster]/shards/[shard]/page.tsx:
##########
@@ -94,104 +119,515 @@ export default function Shard({
         };
     };
 
+    // Filtering and sorting logic for nodes
+    const filteredAndSortedNodes = (nodesData?.nodes || [])
+        .filter((node: any, idx: number) => {
+            if (!`node ${idx + 
1}`.toLowerCase().includes(searchTerm.toLowerCase())) {
+                return false;
+            }

Review Comment:
   The search logic uses a hardcoded string 'node ${idx + 1}' which creates a 
coupling between the search functionality and the display label. Consider 
extracting this to a utility function or using actual node properties for 
searching.
   ```suggestion
               const displayLabel = generateNodeLabel(idx);
               if 
(!displayLabel.toLowerCase().includes(searchTerm.toLowerCase())) {
                   return false;
   ```



-- 
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