perf(ui): stream the findings page and load the Finding Group filter on open (#12891)

This commit is contained in:
Alejandro Bailo
2026-09-28 12:21:13 +02:00
committed by GitHub
parent 453c953f37
commit d5136f364c
18 changed files with 911 additions and 111 deletions
@@ -14,6 +14,7 @@ import {
includesMutedFindings,
splitCsvFilterValues,
} from "@/lib";
import { getFindingGroupFilterOptions } from "@/lib/finding-group-filter-options";
import { appendSanitizedProviderFilters } from "@/lib/provider-filters";
import { handleApiResponse } from "@/lib/server-actions-helper";
@@ -151,6 +152,25 @@ export const getLatestFindingGroups = async (
params: FetchFindingGroupsParams = {},
) => fetchFindingGroupsEndpoint("finding-groups/latest", params);
/**
* Options for the "Finding Group" filter. Walks every finding-group page on the
* server, so the browser issues a single request instead of one per page
* (client-side Server Action calls are dispatched sequentially).
*/
export const getFindingGroupCheckOptions = async ({
filters,
hasHistoricalData,
}: {
filters: Record<string, string>;
hasHistoricalData: boolean;
}) =>
getFindingGroupFilterOptions({
fetchFindingGroups: hasHistoricalData
? getFindingGroups
: getLatestFindingGroups,
filters,
});
interface FetchFindingGroupResourcesParams {
checkId: string;
page?: number;