Skip to content

Commit f54ec87

Browse files
committed
Auto-collapse logs for succesful/timedout/queued deployments
1 parent 42b942b commit f54ec87

File tree

1 file changed

+12
-1
lines changed
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.deployments.$deploymentParam

1 file changed

+12
-1
lines changed

apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.deployments.$deploymentParam/route.tsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,14 @@ export default function Page() {
245245
</Property.Item>
246246
<Property.Item>
247247
<Property.Label>Logs</Property.Label>
248-
<LogsDisplay logs={logs} isStreaming={isStreaming} streamError={streamError} />
248+
<LogsDisplay
249+
logs={logs}
250+
isStreaming={isStreaming}
251+
streamError={streamError}
252+
initialCollapsed={(
253+
["PENDING", "DEPLOYED", "TIMED_OUT"] satisfies (typeof deployment.status)[]
254+
).includes(deployment.status)}
255+
/>
249256
</Property.Item>
250257
{deployment.canceledAt && (
251258
<Property.Item>
@@ -426,6 +433,10 @@ function LogsDisplay({
426433
const [collapsed, setCollapsed] = useState(initialCollapsed);
427434
const logsContainerRef = useRef<HTMLDivElement>(null);
428435

436+
useEffect(() => {
437+
setCollapsed(initialCollapsed);
438+
}, [initialCollapsed]);
439+
429440
// auto-scroll log container to bottom when new logs arrive
430441
useEffect(() => {
431442
if (logsContainerRef.current) {

0 commit comments

Comments
 (0)