From 6c35a6ea7fb8f88b2fa89811a92335e47e076d2c Mon Sep 17 00:00:00 2001 From: David Montero Date: Mon, 1 Jun 2026 20:20:54 +0200 Subject: [PATCH] fix(editor): reset compilation console filter on each new compile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The console auto-switched to the 'errors' filter when a compile produced an error, but never reset it. After one failing compile, every later SUCCESSFUL compile (info/success lines only) was hidden by the sticky filter — the console looked empty while the simulation started, 'unless there was an error'. Now reset the filter to 'all' whenever the log shrinks (a fresh compile cleared it) so the next batch is always visible. Co-Authored-By: Claude Opus 4.8 --- .../src/components/editor/CompilationConsole.tsx | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/editor/CompilationConsole.tsx b/frontend/src/components/editor/CompilationConsole.tsx index 18a2f14f..f1d915ed 100644 --- a/frontend/src/components/editor/CompilationConsole.tsx +++ b/frontend/src/components/editor/CompilationConsole.tsx @@ -32,8 +32,21 @@ export const CompilationConsole: React.FC = ({ } }, [logs, autoscroll]); - // Auto-switch to "Errors" filter when a new batch of logs arrives with errors + // Auto-switch to "Errors" filter when a new batch of logs arrives with + // errors — but reset to "all" the moment a fresh compile clears/shrinks + // the log. Without that reset the 'errors' filter was sticky: after one + // failing compile, every later SUCCESSFUL compile (info/success lines + // only) was filtered out and the console looked empty while the sim + // started. (Reported: "output doesn't refresh after the first compile, + // unless there's an error".) useEffect(() => { + if (logs.length < prevLogsLenRef.current) { + // A clear() or reset shrank the list — treat it as a brand-new + // compile and drop any sticky filter so the next batch is visible. + prevLogsLenRef.current = logs.length; + setFilter('all'); + return; + } if (logs.length === prevLogsLenRef.current) return; const newLogs = logs.slice(prevLogsLenRef.current); prevLogsLenRef.current = logs.length;