From 12fee6852f546b14f34b4c9470e37d6336f4b882 Mon Sep 17 00:00:00 2001 From: Jayden Date: Fri, 24 Jul 2026 16:13:18 -0400 Subject: [PATCH 1/4] Keep container logs visible until a new container starts, not on every status change --- src/components/ContainerCard.tsx | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/components/ContainerCard.tsx b/src/components/ContainerCard.tsx index c5b6a9b..efaf8bc 100644 --- a/src/components/ContainerCard.tsx +++ b/src/components/ContainerCard.tsx @@ -30,12 +30,22 @@ const ContainerCard: React.FC = ({ const socketRef = useRef(null); const logBoxRef = useRef(null); - // Sync status and clear logs/eventMsg when container ID changes (new container after restart) + // Keep local status in sync whenever the parent reports a new one useEffect(() => { setStatusState(option.status); - setLogs([]); + }, [option.status]); + + // Keep the event message in sync independently + useEffect(() => { setEventMsg(externalEventMsg); - }, [option.id, externalEventMsg, option.status]); + }, [externalEventMsg]); + + // Only clear logs when a genuinely NEW container starts (id changes) — + // not on every status change, so stopping a container doesn't wipe its + // logs before it has actually finished shutting down. + useEffect(() => { + setLogs([]); + }, [option.id]); const handleStart = async () => { await onStart(key); @@ -128,7 +138,7 @@ const ContainerCard: React.FC = ({

)} - {statusState !== 'stopped' && ( + {(statusState !== 'stopped' || logs.length > 0) && (
Live Logs:
Date: Thu, 30 Jul 2026 16:10:56 -0400
Subject: [PATCH 2/4] Fix comments

Co-authored-by: Nathaniel 
---
 src/components/ContainerCard.tsx | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/src/components/ContainerCard.tsx b/src/components/ContainerCard.tsx
index efaf8bc..dd4f69b 100644
--- a/src/components/ContainerCard.tsx
+++ b/src/components/ContainerCard.tsx
@@ -35,14 +35,11 @@ const ContainerCard: React.FC = ({
     setStatusState(option.status);
   }, [option.status]);
 
-  // Keep the event message in sync independently
   useEffect(() => {
     setEventMsg(externalEventMsg);
   }, [externalEventMsg]);
 
-  // Only clear logs when a genuinely NEW container starts (id changes) —
-  // not on every status change, so stopping a container doesn't wipe its
-  // logs before it has actually finished shutting down.
+  // Only clear logs when a new container starts (id changes)
   useEffect(() => {
     setLogs([]);
   }, [option.id]);

From 466e852f920f174a7d671167edd9613a84a23152 Mon Sep 17 00:00:00 2001
From: "Software Lead (Base Station)" 
Date: Fri, 31 Jul 2026 21:02:21 -0400
Subject: [PATCH 3/4] Remove logs after fully stopped

---
 src/components/ContainerCard.tsx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/components/ContainerCard.tsx b/src/components/ContainerCard.tsx
index dd4f69b..8cb6cd8 100644
--- a/src/components/ContainerCard.tsx
+++ b/src/components/ContainerCard.tsx
@@ -135,7 +135,7 @@ const ContainerCard: React.FC = ({
         

)} - {(statusState !== 'stopped' || logs.length > 0) && ( + {(statusState !== 'stopped') && (
Live Logs:
Date: Fri, 31 Jul 2026 21:04:00 -0400
Subject: [PATCH 4/4] fix

---
 src/components/ContainerCard.tsx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/components/ContainerCard.tsx b/src/components/ContainerCard.tsx
index 8cb6cd8..5aa8285 100644
--- a/src/components/ContainerCard.tsx
+++ b/src/components/ContainerCard.tsx
@@ -135,7 +135,7 @@ const ContainerCard: React.FC = ({
         

)} - {(statusState !== 'stopped') && ( + {statusState !== 'stopped' && (
Live Logs: