Skip to content

Commit 20da6e4

Browse files
chore: improve comment
1 parent cb4e5b2 commit 20da6e4

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

site/src/pages/WorkspacePage/Workspace.tsx

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -269,13 +269,13 @@ export const Workspace: FC<WorkspaceProps> = ({
269269
minWidth: 0 /* Prevent overflow */,
270270
}}
271271
>
272-
{selectedResource.agents?.map((agent) => {
273-
// We do not want to display child agents at the top-level.
274-
if (agent.parent_id !== null) {
275-
return;
276-
}
277-
278-
return (
272+
{selectedResource.agents
273+
// If an agent has a `parent_id`, that means it is
274+
// child of another agent. We do not want these agents
275+
// to be displayed at the top-level on this page. We
276+
// want them to display _as children_ of their parents.
277+
?.filter((agent) => agent.parent_id !== null)
278+
.map((agent) => (
279279
<AgentRow
280280
key={agent.id}
281281
agent={agent}
@@ -290,8 +290,7 @@ export const Workspace: FC<WorkspaceProps> = ({
290290
serverAPIVersion={buildInfo?.agent_api_version || ""}
291291
onUpdateAgent={handleUpdate} // On updating the workspace the agent version is also updated
292292
/>
293-
);
294-
})}
293+
))}
295294

296295
{(!selectedResource.agents ||
297296
selectedResource.agents?.length === 0) && (

0 commit comments

Comments
 (0)