agent: fix — infinite reactivity loop in TaskSidebar froze entire app

prevTaskIds was declared as $state, causing the $effect that writes to
it to re-trigger itself infinitely (effect_update_depth_exceeded). The
variable is just a comparison reference — doesn't need to be reactive.
Changed to a plain let.

Also removed debug event loggers and reverted grain z-index.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-03 18:56:54 +01:00
parent 1a8f3c7582
commit fdc4a3cba5
2 changed files with 9 additions and 8 deletions

View File

@@ -20,7 +20,9 @@
}
// Track recently added tasks for highlight animation
let prevTaskIds = $state(new Set(tasks.map((t) => t.id)));
// Use a plain variable (not $state) for previous IDs to avoid
// read-write loop inside the $effect.
let prevTaskIds = new Set(tasks.map((t) => t.id));
$effect(() => {
const currentIds = new Set(tasks.map((t) => t.id));
for (const id of currentIds) {