From 201de14a9d549f7f5179925c6da988d274945cef Mon Sep 17 00:00:00 2001 From: Max Schwenk Date: Thu, 30 Apr 2026 13:43:42 -0400 Subject: [PATCH] fix(site): hide hidden apps in Tasks tabs (#24823) ## Summary - Exclude `hidden` workspace apps from the Tasks page app tabs. - Keep terminal link agent selection based on the full app list so hidden apps do not affect terminal routing. - Add a focused unit test covering hidden app filtering in `TaskApps`. ## Test plan - `pnpm --dir site test TaskApps.test.tsx` - `pnpm -C site exec biome check src/pages/TaskPage/TaskApps.tsx src/pages/TaskPage/TaskApps.test.tsx` Made with [Cursor](https://cursor.com) --- site/src/pages/TaskPage/TaskApps.stories.tsx | 13 +++++++++++++ site/src/pages/TaskPage/TaskApps.tsx | 7 ++++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/site/src/pages/TaskPage/TaskApps.stories.tsx b/site/src/pages/TaskPage/TaskApps.stories.tsx index 2d4f29c63c..e80cd1cbe2 100644 --- a/site/src/pages/TaskPage/TaskApps.stories.tsx +++ b/site/src/pages/TaskPage/TaskApps.stories.tsx @@ -65,6 +65,19 @@ export const WithMixedApps: Story = { }, }; +export const WithHiddenApps: Story = { + args: { + task: mockTask, + workspace: mockWorkspaceWithApps([ + mockEmbeddedApp("Visible App"), + { + ...mockEmbeddedApp("Hidden App"), + hidden: true, + }, + ]), + }, +}; + export const WithWildcardWarning: Story = { decorators: [ withAuthProvider, diff --git a/site/src/pages/TaskPage/TaskApps.tsx b/site/src/pages/TaskPage/TaskApps.tsx index 8dd41bb0e3..b195c5c395 100644 --- a/site/src/pages/TaskPage/TaskApps.tsx +++ b/site/src/pages/TaskPage/TaskApps.tsx @@ -31,16 +31,17 @@ type TaskAppsProps = { const TERMINAL_TAB_ID = "terminal"; export const TaskApps: FC = ({ task, workspace }) => { - const apps = getAllAppsWithAgent(workspace).filter( + const allApps = getAllAppsWithAgent(workspace); + const apps = allApps.filter( // The Chat UI app will be displayed in the sidebar, so we don't want to // show it as a web app. - (app) => app.id !== task.workspace_app_id, + (app) => app.id !== task.workspace_app_id && !app.hidden, ); const [embeddedApps, externalApps] = splitEmbeddedAndExternalApps(apps); const [activeAppId, setActiveAppId] = useState(embeddedApps.at(0)?.id); const hasAvailableAppsToDisplay = embeddedApps.length > 0 || externalApps.length > 0; - const taskAgent = apps.at(0)?.agent; + const taskAgent = allApps.at(0)?.agent; const terminalHref = getTerminalHref({ username: task.owner_name, workspace: task.workspace_name,