Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,12 @@ export default function ReleaseTargetsPage() {
jobStatus == null || camelCase(rt.latestJob?.status ?? "") === jobStatus;
const isMatchingVersion =
version === "all" || rt.currentVersion?.id === version;
return isMatchingJobStatus && isMatchingVersion;
const q = searchDebounced.toLowerCase();
const isMatchingSearch =
Comment on lines +169 to +170
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

searchDebounced.toLowerCase() is computed inside the .filter() callback, so it gets recomputed once per release target. Since q is constant for the whole filter operation, compute/normalize it once outside the callback (and optionally trim() it) to avoid unnecessary work and make the filtering logic clearer.

Copilot uses AI. Check for mistakes.
q === "" ||
rt.resource.name.toLowerCase().includes(q) ||
rt.resource.identifier.toLowerCase().includes(q);
return isMatchingJobStatus && isMatchingVersion && isMatchingSearch;
Comment on lines +169 to +174
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

q is derived from searchDebounced, but useResource() initializes its state from searchParams.get("resource") while updating the URL param named query. This means a shared/refreshed URL like ?query=foo will not restore the filter, and the UI can get out of sync with the URL. Consider using a single consistent search param key (read + write the same key).

Copilot uses AI. Check for mistakes.
});

const groupByEnvironmentId = _.groupBy(
Expand Down
Loading