RockteMQ-AI commented on code in PR #2862:
URL: 
https://github.com/apache/rocketmq-dashboard/pull/2862#discussion_r3896854941


##########
web/src/pages/cluster/clients.tsx:
##########
@@ -97,6 +97,31 @@ const countBy = (values: string[]) =>
     .map(([label, count]) => ({ label, count }))
     .sort((a, b) => b.count - a.count || a.label.localeCompare(b.label));
 
+/**
+ * Connection fields matched by the client search box. Typed as nullable to
+ * mirror what the backend may actually return for legacy payloads.
+ */
+export type ClientSearchFields = {
+  clientId?: string | null;
+  address?: string | null;
+};
+
+/**
+ * Case- and whitespace-insensitive client search match that tolerates
+ * missing clientId/address fields and whitespace-only search input.
+ */
+export const matchesClientSearch = (
+  connection: ClientSearchFields,

Review Comment:
   Minor: `(connection.clientId ?? '').toLowerCase()` allocates a new empty 
string on every call when `clientId` is null. For a UI filter this is fine, but 
if the connection list grows large you could hoist the empty-string fallback 
outside the hot path. Not a blocker.



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