From b04a7dd1bd09dfd515e7e50576a626703ac492da Mon Sep 17 00:00:00 2001 From: Curry Yang <163384738+CurryYangxx@users.noreply.github.com> Date: Tue, 5 Aug 2025 14:42:21 +0800 Subject: [PATCH] perf: improve expand all performance (#8935) --- packages/insomnia/src/models/index.ts | 2 +- ...t.$projectId.workspace.$workspaceId.toggle-expand-all.tsx | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/insomnia/src/models/index.ts b/packages/insomnia/src/models/index.ts index 78279bea29..3e76d20b98 100644 --- a/packages/insomnia/src/models/index.ts +++ b/packages/insomnia/src/models/index.ts @@ -274,7 +274,7 @@ export const WORKSPACE_EXPORT_TYPES_DESCENDANT_MAP: Record = { protoDirectory.type, protoFile.type, ], - [requestGroup.type]: [requestGroup.type, request.type, grpcRequest.type, webSocketRequest.type], + [requestGroup.type]: [requestGroup.type, request.type, grpcRequest.type, webSocketRequest.type, socketIORequest.type], [webSocketRequest.type]: [webSocketPayload.type], [mockServer.type]: [mockRoute.type], [environment.type]: [environment.type], diff --git a/packages/insomnia/src/ui/routes/$organizationId.project.$projectId.workspace.$workspaceId.toggle-expand-all.tsx b/packages/insomnia/src/ui/routes/$organizationId.project.$projectId.workspace.$workspaceId.toggle-expand-all.tsx index e89a50faaa..83678974e3 100644 --- a/packages/insomnia/src/ui/routes/$organizationId.project.$projectId.workspace.$workspaceId.toggle-expand-all.tsx +++ b/packages/insomnia/src/ui/routes/$organizationId.project.$projectId.workspace.$workspaceId.toggle-expand-all.tsx @@ -16,7 +16,10 @@ export async function action({ request, params }: ActionFunctionArgs) { }; const isCollapsed = data.toggle === 'collapse-all'; - const descendants = await database.withDescendants(workspace); + const descendants = await database.withDescendants(workspace, null, [], { + [workspace.type]: [models.requestGroup.type], + [models.requestGroup.type]: [models.requestGroup.type, models.requestGroupMeta.type], + }); const requestGroups = descendants.filter(isRequestGroup); const requestGroupMetas = descendants.filter(isRequestGroupMeta); await Promise.all(