Skip to content

Commit d0e7bde

Browse files
committed
tasks: improve sidebar chat loading
1 parent 2f8b056 commit d0e7bde

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

site/src/pages/TaskPage/TaskSidebar.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import {
2323
} from "lucide-react";
2424
import { AppStatusStateIcon } from "modules/apps/AppStatusStateIcon";
2525
import type { Task } from "modules/tasks/tasks";
26-
import type { FC } from "react";
26+
import { type FC } from "react";
2727
import { Link as RouterLink } from "react-router-dom";
2828
import { cn } from "utils/cn";
2929
import { timeFrom } from "utils/time";
@@ -40,6 +40,7 @@ export const TaskSidebar: FC<TaskSidebarProps> = ({ task }) => {
4040
.flatMap((r) => r.agents)
4141
.flatMap((a) => a?.apps)
4242
.find((a) => a?.slug === AI_APP_CHAT_SLUG);
43+
const showChatApp = chatApp && (chatApp.health === "disabled" || chatApp.health === "healthy");
4344

4445
return (
4546
<aside
@@ -49,7 +50,7 @@ export const TaskSidebar: FC<TaskSidebarProps> = ({ task }) => {
4950
"border-0 border-r border-solid border-border",
5051
],
5152
// We want to make the sidebar wider for chat apps
52-
chatApp ? "w-[520px]" : "w-[320px]",
53+
showChatApp ? "w-[520px]" : "w-[320px]",
5354
])}
5455
>
5556
<header className="border-0 border-b border-solid border-border p-4 pt-0">
@@ -104,7 +105,7 @@ export const TaskSidebar: FC<TaskSidebarProps> = ({ task }) => {
104105
)}
105106
</header>
106107

107-
{chatApp ? (
108+
{showChatApp ? (
108109
<TaskAppIFrame
109110
active
110111
key={chatApp.id}

0 commit comments

Comments
 (0)