fix(settings): drop cleanup activity toggle state for runs that left history

This commit is contained in:
Kelvin Amoaba
2026-11-14 02:28:22 +00:00
parent e784f9803d
commit 0ff202c257
@@ -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<string, boolean>()
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))
})
}
/>
))}