chore: select the first embedded app on tasks page (#18260)

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).
This commit is contained in:
Asher
2025-06-05 11:43:23 -08:00
committed by GitHub
parent 0428c5ec1c
commit c339066be3
+4 -4
View File
@@ -32,8 +32,11 @@ export const TaskApps: FC<TaskAppsProps> = ({ 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<string>(() => {
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<TaskAppsProps> = ({ 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 (
<main className="flex-1 flex flex-col">
<div className="border-0 border-b border-border border-solid w-full p-1 flex gap-2">