fix(electrobun): replace tick() with requestAnimationFrame in AgentPane

tick() inside $effect triggers effect re-entry: flush_effects → tick →
flushSync → flush_effects → infinite loop (effect_update_depth_exceeded).
requestAnimationFrame defers DOM scroll to next frame outside the effect.
This commit is contained in:
Hibryda 2026-03-23 21:46:16 +01:00
parent 4a5e4d9733
commit de59f0e4d0

View file

@ -40,7 +40,8 @@
$effect(() => {
void messages.length;
tick().then(() => {
// Use requestAnimationFrame instead of tick() to avoid effect re-entry cycle
requestAnimationFrame(() => {
if (scrollEl) scrollEl.scrollTop = scrollEl.scrollHeight;
});
});