@@ -329,30 +329,32 @@ const TasksTable: FC<TasksTableProps> = ({ templates, filter }) => {
329
329
tasks . map ( ( { workspace, prompt } ) => {
330
330
const templateDisplayName =
331
331
workspace . template_display_name ?? workspace . template_name ;
332
-
332
+
333
333
// Get all apps from all agents, excluding the chat UI app
334
334
const allApps = workspace . latest_build . resources
335
335
. flatMap ( ( r ) => r . agents )
336
336
. filter ( ( a ) => ! ! a )
337
337
. flatMap ( ( a ) => a . apps )
338
338
. filter ( ( app ) => app . slug !== AI_APP_CHAT_SLUG ) ;
339
-
339
+
340
340
// Use the first app in order instead of the most recently active app
341
341
const focusedApp = allApps [ 0 ] ;
342
-
342
+
343
343
// Find the agent that contains the focused app
344
344
const agent = workspace . latest_build . resources
345
345
. flatMap ( ( r ) => r . agents )
346
346
. filter ( ( a ) => ! ! a )
347
347
. find ( ( a ) => a . apps . some ( ( app ) => app . id === focusedApp ?. id ) ) ;
348
-
348
+
349
349
// Create a status object for the focused app, or fall back to latest_app_status
350
- const status = focusedApp ? {
351
- ...workspace . latest_app_status ,
352
- app_id : focusedApp . id ,
353
- agent_id : agent ?. id || workspace . latest_app_status ?. agent_id ,
354
- } : workspace . latest_app_status ;
355
-
350
+ const status = focusedApp
351
+ ? {
352
+ ...workspace . latest_app_status ,
353
+ app_id : focusedApp . id ,
354
+ agent_id : agent ?. id || workspace . latest_app_status ?. agent_id ,
355
+ }
356
+ : workspace . latest_app_status ;
357
+
356
358
const app = focusedApp ;
357
359
358
360
return (
0 commit comments