fix(ui): hide log service chips on single-service stacks (#1689)

Service chips only differentiate multi-service or multi-container log streams. Gate rendering with the same layout criterion already used in stack details, while keeping parsed prefixes and download attribution intact.
This commit is contained in:
Anso
2026-07-23 20:22:57 -04:00
committed by GitHub
parent 85842cc547
commit a89498ae5b
14 changed files with 359 additions and 92 deletions
@@ -181,8 +181,8 @@ export interface EditorViewProps {
action: 'start' | 'stop' | 'restart',
serviceName: string,
) => Promise<void>;
// Declared-service facts for the multi-service header split (§12). Empty
// on single-service stacks and older remotes (capability-gated fetch), so
// Declared-service facts for the multi-service header layout. Empty on
// single-service stacks and older remotes (capability-gated fetch), so
// ContainersHealth falls back to the flat single-service layout. Optional
// so callers/tests that never deal in services can omit them.
effectiveServices?: EffectiveServiceSpec[];
@@ -388,9 +388,8 @@ export function EditorView(props: EditorViewProps) {
});
};
// Declared-service headers (§12) need the same expandable, scroll-wrapped
// layout as a multi-container stack even when only one container of a
// multi-service stack is currently running.
// Multi-service stacks need the same expandable, scroll-wrapped layout as a
// multi-container stack even when only one container is currently running.
const isMultiContainerLayout = safeContainers.length > 1 || effectiveServices.length > 1;
// Below md, render the segmented full-screen mobile detail instead of the
@@ -401,6 +400,17 @@ export function EditorView(props: EditorViewProps) {
return <MobileStackDetail {...props} />;
}
const stackLogsSection = (
<StackLogsSection
stackName={stackName}
logsMode={logsMode}
setLogsMode={setLogsMode}
showServiceChips={isMultiContainerLayout}
logsExpanded={logsExpanded}
onToggleLogsExpand={toggleLogsExpand}
/>
);
return (
<ErrorBoundary>
<div className={`grid gap-6 ${filesFullscreen ? 'grid-cols-1' : 'grid-cols-1 lg:grid-cols-2'} min-h-[600px] h-[calc(100vh-160px)] max-h-[1040px]`}>
@@ -518,23 +528,9 @@ export function EditorView(props: EditorViewProps) {
Hidden when containers are expanded to fill the column. */}
{!containersExpanded && (isMultiContainerLayout ? (
<div className="flex-1 min-h-[180px] flex flex-col">
<StackLogsSection
stackName={stackName}
logsMode={logsMode}
setLogsMode={setLogsMode}
logsExpanded={logsExpanded}
onToggleLogsExpand={toggleLogsExpand}
/>
{stackLogsSection}
</div>
) : (
<StackLogsSection
stackName={stackName}
logsMode={logsMode}
setLogsMode={setLogsMode}
logsExpanded={logsExpanded}
onToggleLogsExpand={toggleLogsExpand}
/>
))}
) : stackLogsSection)}
</div>
)}