diff --git a/site/src/modules/resources/AgentRow.tsx b/site/src/modules/resources/AgentRow.tsx index 46c306613e..f1c44ef1e8 100644 --- a/site/src/modules/resources/AgentRow.tsx +++ b/site/src/modules/resources/AgentRow.tsx @@ -305,7 +305,9 @@ export const AgentRow: FC = ({ ...sortedSourceLogTabs, ]; const hasAnyLogs = agentLogs.length > 0; - const logTabsMeasureEnabled = hasStartupFeatures && hasAnyLogs && showLogs; + const shouldExpandLogs = showLogs || (!hasStartupFeatures && hasAgentIssues); + const shouldShowLogsTabs = hasStartupFeatures && hasAnyLogs; + const logTabsMeasureEnabled = shouldShowLogsTabs && showLogs; const { containerRef: logTabsListContainerRef, visibleTabs: visibleLogTabs, @@ -529,7 +531,7 @@ export const AgentRow: FC = ({ {runningScriptsCount} )} - {healthIssues.length > 0 && ( + {hasAgentIssues && ( = ({ )} - +
- {healthIssues.length > 0 && ( + {/* + Collapse's `in` condition is needed here, + or else the Spinner will also show as Collapse is closing + */} + {shouldExpandLogs && !(hasAgentIssues || shouldShowLogsTabs) && ( + + )} + {hasAgentIssues && (
{healthIssues.map((issue) => ( = ({ ))}
)} - {hasStartupFeatures && hasAnyLogs && ( + {shouldShowLogsTabs && (