From 3d748df79f53f54d8d5559a6215f05c88d3c7c88 Mon Sep 17 00:00:00 2001 From: Asher Date: Thu, 5 Jun 2025 11:29:56 -0800 Subject: [PATCH] chore: select the first embedded app on tasks page The first app might be an external app (shown in the dropdown), and we actually want to select the first embedded app (which are in tabs). --- site/src/pages/TaskPage/TaskApps.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/site/src/pages/TaskPage/TaskApps.tsx b/site/src/pages/TaskPage/TaskApps.tsx index 9cb49946c7618..316d7b91dd633 100644 --- a/site/src/pages/TaskPage/TaskApps.tsx +++ b/site/src/pages/TaskPage/TaskApps.tsx @@ -32,8 +32,11 @@ export const TaskApps: FC = ({ task }) => { .flatMap((a) => a?.apps) .filter((a) => !!a && a.slug !== AI_APP_CHAT_SLUG); + const embeddedApps = apps.filter((app) => !app.external); + const externalApps = apps.filter((app) => app.external); + const [activeAppId, setActiveAppId] = useState(() => { - const appId = apps[0]?.id; + const appId = embeddedApps[0]?.id; if (!appId) { throw new Error("No apps found in task"); } @@ -52,9 +55,6 @@ export const TaskApps: FC = ({ task }) => { throw new Error(`Agent for app ${activeAppId} not found in task workspace`); } - const embeddedApps = apps.filter((app) => !app.external); - const externalApps = apps.filter((app) => app.external); - return (