From 12bb9584faaf740faf2ff14cd5bac9efd790e7a8 Mon Sep 17 00:00:00 2001 From: AaronPlave Date: Fri, 29 May 2026 15:28:45 -0700 Subject: [PATCH 1/5] feat: virtualize console All Problems list with @tanstack/svelte-virtual MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The All Problems tab (and other ConsoleLogs tabs) previously rendered every BaseError via {#each}, producing ~5 DOM nodes per entry. On a plan with 20k+ activity validation errors that put 100k+ nodes in the layout tree, which made every global style invalidation (e.g. opening any Stellar dropdown's focus trap) run a full recalc and forced 500ms+ UpdateLayoutTree on each click. Virtualize the list with @tanstack/svelte-virtual using a stable `const virtualizer` plus reactive `setOptions`, so the measurement cache and scroll position survive prop updates (every $allProblems emit would otherwise destroy them). Wire the virtualizer's onChange callback into a scrollTick counter that participates as an explicit dep of the totalSize/virtualItems reactives — the wrapper emits same-reference writable updates that don't reliably retrigger Svelte template expressions, and the canonical recreate pattern would lose scroll/ measurement state on every backend update. Render the scroll container unconditionally (toggled via class:invisible when there is nothing to show) so bind:this resolves before onMount, matching the working canonical test setup. Move the empty state to a sibling overlay so it can coexist with the always-mounted virtualized list. Also drop the competing overflow-y-auto on the Console slot wrapper — it was acting as an outer scroll boundary that swallowed scroll events the virtualizer needed to see. --- src/components/console/Console.svelte | 2 +- .../console/views/ConsoleLogs.svelte | 112 ++++++++++++++---- 2 files changed, 89 insertions(+), 25 deletions(-) diff --git a/src/components/console/Console.svelte b/src/components/console/Console.svelte index 3f08c23981..fec940f6d7 100644 --- a/src/components/console/Console.svelte +++ b/src/components/console/Console.svelte @@ -127,7 +127,7 @@ -
+
diff --git a/src/components/console/views/ConsoleLogs.svelte b/src/components/console/views/ConsoleLogs.svelte index 19777dcdab..53618b01a9 100644 --- a/src/components/console/views/ConsoleLogs.svelte +++ b/src/components/console/views/ConsoleLogs.svelte @@ -2,7 +2,8 @@