From 70ccc7ac80644c95212d71728d9813994c35e285 Mon Sep 17 00:00:00 2001 From: hechang27-sprt Date: Fri, 3 Apr 2026 19:05:51 +0800 Subject: [PATCH] chore: record journal --- .../VIRTUAL-SCROLLING-DEBUG.md | 95 +++++++++++++++++++ .trellis/workspace/hechang27-sprt/index.md | 5 +- .../workspace/hechang27-sprt/journal-1.md | 30 ++++++ 3 files changed, 128 insertions(+), 2 deletions(-) create mode 100644 .trellis/tasks/04-03-list-table-v2-tanstack-pretext/VIRTUAL-SCROLLING-DEBUG.md diff --git a/.trellis/tasks/04-03-list-table-v2-tanstack-pretext/VIRTUAL-SCROLLING-DEBUG.md b/.trellis/tasks/04-03-list-table-v2-tanstack-pretext/VIRTUAL-SCROLLING-DEBUG.md new file mode 100644 index 0000000..4950ded --- /dev/null +++ b/.trellis/tasks/04-03-list-table-v2-tanstack-pretext/VIRTUAL-SCROLLING-DEBUG.md @@ -0,0 +1,95 @@ +# Virtual Scrolling Debug Notes + +## Date: 2026-04-03 + +## Issue: Virtual Scrolling Not Updating on Scroll + +### Symptoms +- Rows weren't shifting when scrolling programmatically +- Debug info showed correct scrollTop but rows stayed the same +- Force re-render (classList toggle) fixed it momentarily + +### Root Causes Found + +#### 1. Vue Template Ref Auto-Unwrapping +**Problem**: `virtualizer.visibleRows` is a `ComputedRef` inside an object. Vue 3 auto-unwraps top-level refs in templates, but NOT refs nested inside objects. + +**Evidence**: +``` +TypeScript error: Property 'index' does not exist on type 'true | ComputedRefImpl | VirtualRow[]' +``` + +**Fix**: Destructure the needed values from `virtualizer`: +```typescript +const { visibleRows, totalHeight: virtualTotalHeight, onScroll } = virtualizer; +``` + +#### 2. Vue 3 Template `.value` Usage +**Problem**: In Vue 3 `