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:
@@ -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) {
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
const prefs = getPreferences();
|
||||
|
||||
|
||||
// Detect secondary windows (float, viewer) — they use +layout@.svelte
|
||||
// but as a fallback, hide chrome if the URL matches
|
||||
let isSecondaryWindow = $derived(
|
||||
@@ -211,13 +212,11 @@
|
||||
<div class="flex-1 overflow-hidden bg-bg">
|
||||
{@render children()}
|
||||
</div>
|
||||
{#if page.taskSidebarOpen && page.current !== "first-run"}
|
||||
<div class="w-[280px] min-w-[280px] shadow-xl">
|
||||
<TaskSidebar />
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Task sidebar — floats over content, no blocking overlay -->
|
||||
{#if page.taskSidebarOpen && page.current !== "first-run" && !isSecondaryWindow}
|
||||
<div class="fixed top-[36px] right-0 bottom-0 w-[280px] z-50 shadow-xl">
|
||||
<TaskSidebar />
|
||||
</div>
|
||||
{/if}
|
||||
{/if}
|
||||
|
||||
Reference in New Issue
Block a user