Skip to content

Commit e6f295e

Browse files
wesmclaude
andcommitted
fix: skip overscanned items when computing firstVisibleTimestamp
getVirtualItems() includes overscan rows above the viewport. Filter by scrollOffset so the minimap indicator tracks the first actually visible item, not an overscanned one above the fold. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent ae6af4f commit e6f295e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

frontend/src/lib/components/content/MessageList.svelte

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,13 @@
128128
}
129129
130130
function publishVisibleTimestamp() {
131-
const items =
132-
virtualizer.instance?.getVirtualItems() ?? [];
131+
const v = virtualizer.instance;
132+
if (!v) return;
133+
const items = v.getVirtualItems();
134+
// Skip overscanned items above the viewport.
135+
const scrollTop = v.scrollOffset ?? 0;
133136
for (const vi of items) {
137+
if (vi.start < scrollTop) continue;
134138
const item =
135139
displayItemsAsc[
136140
ui.sortNewestFirst

0 commit comments

Comments
 (0)