From 3d22e27f4e695c01b6bd3e3d85ab7c42811b1eee Mon Sep 17 00:00:00 2001 From: Hugo Dutka Date: Tue, 1 Jul 2025 12:01:17 +0200 Subject: [PATCH] fix: handle task sidebar app health check disabled correctly (#18687) Previously, by mistake, the task sidebar would not display workspace apps that don't have a health check configured. --- site/src/pages/TaskPage/TaskPage.stories.tsx | 2 +- site/src/pages/TaskPage/TaskSidebar.tsx | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/site/src/pages/TaskPage/TaskPage.stories.tsx b/site/src/pages/TaskPage/TaskPage.stories.tsx index b025c9994f..0799f4625c 100644 --- a/site/src/pages/TaskPage/TaskPage.stories.tsx +++ b/site/src/pages/TaskPage/TaskPage.stories.tsx @@ -113,7 +113,7 @@ export const TerminatedBuildWithStatus: Story = { }, }; -export const SidebarAppDisabled: Story = { +export const SidebarAppHealthDisabled: Story = { beforeEach: () => { spyOn(data, "fetchTask").mockResolvedValue({ prompt: "Create competitors page", diff --git a/site/src/pages/TaskPage/TaskSidebar.tsx b/site/src/pages/TaskPage/TaskSidebar.tsx index e90261eb79..ca691bea08 100644 --- a/site/src/pages/TaskPage/TaskSidebar.tsx +++ b/site/src/pages/TaskPage/TaskSidebar.tsx @@ -54,8 +54,10 @@ const getSidebarApp = (task: Task): [WorkspaceApp | null, SidebarAppStatus] => { // indefinitely if there's a genuine issue, but this is preferable to false error alerts. return [null, "loading"]; } + // "disabled" means that the health check is disabled, so we assume + // that the app is healthy if (sidebarApp.health === "disabled") { - return [sidebarApp, "error"]; + return [sidebarApp, "healthy"]; } if (sidebarApp.health === "healthy") { return [sidebarApp, "healthy"];