From f444ef9c97cbc8ea0d23265cc68c39a7179479a0 Mon Sep 17 00:00:00 2001 From: Danielle Maywood Date: Wed, 6 Aug 2025 10:37:33 +0000 Subject: [PATCH 1/4] fix(site): hide "Show parent apps" when no running or starting devcontainers --- site/src/modules/resources/AgentRow.tsx | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/site/src/modules/resources/AgentRow.tsx b/site/src/modules/resources/AgentRow.tsx index ab0e5884c48e9..3ed9af3eb5640 100644 --- a/site/src/modules/resources/AgentRow.tsx +++ b/site/src/modules/resources/AgentRow.tsx @@ -137,17 +137,16 @@ export const AgentRow: FC = ({ // This is used to show the parent apps of the devcontainer. const [showParentApps, setShowParentApps] = useState(false); - let shouldDisplayAppsSection = shouldDisplayAgentApps; - if ( - devcontainers && - devcontainers.find( - // We only want to hide the parent apps by default when there are dev - // containers that are either starting or running. If they are all in - // the stopped state, it doesn't make sense to hide the parent apps. + const anyRunningOrStartingDevcontainers = + devcontainers?.find( (dc) => dc.status === "running" || dc.status === "starting", - ) !== undefined && - !showParentApps - ) { + ) !== undefined; + + // We only want to hide the parent apps by default when there are dev + // containers that are either starting or running. If they are all in + // the stopped state, it doesn't make sense to hide the parent apps. + let shouldDisplayAppsSection = shouldDisplayAgentApps; + if (devcontainers && anyRunningOrStartingDevcontainers && !showParentApps) { shouldDisplayAppsSection = false; } @@ -187,7 +186,7 @@ export const AgentRow: FC = ({
- {devcontainers && devcontainers.length > 0 && ( + {anyRunningOrStartingDevcontainers && (