File tree 1 file changed +8
-9
lines changed
site/src/pages/WorkspacePage
1 file changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -269,13 +269,13 @@ export const Workspace: FC<WorkspaceProps> = ({
269
269
minWidth : 0 /* Prevent overflow */ ,
270
270
} }
271
271
>
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 ) => (
279
279
< AgentRow
280
280
key = { agent . id }
281
281
agent = { agent }
@@ -290,8 +290,7 @@ export const Workspace: FC<WorkspaceProps> = ({
290
290
serverAPIVersion = { buildInfo ?. agent_api_version || "" }
291
291
onUpdateAgent = { handleUpdate } // On updating the workspace the agent version is also updated
292
292
/>
293
- ) ;
294
- } ) }
293
+ ) ) }
295
294
296
295
{ ( ! selectedResource . agents ||
297
296
selectedResource . agents ?. length === 0 ) && (
You can’t perform that action at this time.
0 commit comments