From 0ff202c257a8d00ccfa44853285f1fcb92c13309 Mon Sep 17 00:00:00 2001 From: Kelvin Amoaba <97001695+AmoabaKelvin@users.noreply.github.com> Date: Sat, 14 Nov 2026 02:28:22 +0000 Subject: [PATCH] fix(settings): drop cleanup activity toggle state for runs that left history --- .../workspace-cleanup-activity-list.tsx | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/renderer/src/components/settings/workspace-cleanup/workspace-cleanup-activity-list.tsx b/src/renderer/src/components/settings/workspace-cleanup/workspace-cleanup-activity-list.tsx index d7a1a895df2..53f028c7cc5 100644 --- a/src/renderer/src/components/settings/workspace-cleanup/workspace-cleanup-activity-list.tsx +++ b/src/renderer/src/components/settings/workspace-cleanup/workspace-cleanup-activity-list.tsx @@ -72,9 +72,17 @@ export function WorkspaceCleanupActivityList({ run={run} open={toggled.get(run.id) ?? index === 0} onToggle={() => - setToggled((previous) => - new Map(previous).set(run.id, !(previous.get(run.id) ?? index === 0)) - ) + setToggled((previous) => { + // Carry only shown runs so ids that left the capped history drop out. + const next = new Map() + for (const { id } of runs) { + const value = previous.get(id) + if (value !== undefined) { + next.set(id, value) + } + } + return next.set(run.id, !(previous.get(run.id) ?? index === 0)) + }) } /> ))}