Repository navigation
core: virtual-list - #894
fizzy-macos[bot] wants to merge 4 commits into
Conversation
HeightIndex is the std-only bookkeeping: estimated/measured row heights, a Fenwick tree for O(log n) offsets, key-based reconcile, width invalidation and an anchor (row key + offset). widgets.VirtualList draws only the rows in view over it, with follow_end, nearStart and scrollTo(key). Part of fizzyedit/work#415 Agent-Team: macos Worker: claude Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
PM note: how this PR will be handledWhat it is for: core: virtual-list Rules that apply: touches build scripts; changes agent rules or guides. Things to watch (checked by rule):
What happens next:
A living status comment below is kept current. Nothing here is a merge decision. |
Where this PR standsStage: Author's turn What the PM needs before approving (ticks as it is met; the full CI runs only at the end, after the reviews are clean):
Rules that apply: touches build scripts; changes agent rules or guides. Reviews at the current commit (
6 earlier reviews are for older commits and will be redone. Latest fixes comment: https://github.com/fizzyedit/work/issues/430#issuecomment-6438520128 (9 findings answered) Updated 2026-10-27 14:19 UTC by the PM. This comment is edited in place. |
reconcile compares every key, not the endpoints, so a replaced or reordered interior row is noticed; an empty list returns without allocating. A width change runs after reconcile, and a second one keeps earlier measurements as stale guesses instead of re-estimating them. scrollTo moves to State, which the caller owns between frames. Agent-Team: macos Worker: claude Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
reconcile takes the width, so rows are estimated at the width they are laid out at, only for rows the caller still has, and invalidateForWidth is gone. An optional revision skips the per-frame key scan. State.scrollTo has a test; the 0.001 threshold and the id_extra fold are named. Agent-Team: macos Worker: claude Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Carry any scroll over to the anchor, not only steps past half a pixel, so slow coasting accumulates; test drives a 0.2 px nudge per frame. Drop the section banners before the tests. Agent-Team: macos Worker: claude Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Part of fizzyedit/work#415
Rework: work#442
Goal
A variable-height virtual list (HeightIndex + VirtualList) for core, part of fizzyedit/work#415.
What changed and why
HeightIndex (Fenwick-backed heights, anchors, width-aware reconcile with an optional revision) and the VirtualList widget that draws only the rows in view. Latest round: the reader's scroll is carried over at any size, so a fraction of a pixel a frame (slow coasting, fine wheel steps) accumulates instead of being put back; the two
// ---- testsbanners are removed.How it was verified
check-fmt ok;
zb build test183/183;zb build test-integration83/83. New test "a scroll of a fraction of a pixel accumulates instead of being put back" fails with the old 0.5 px threshold (5780.2 vs 5782) and passes now. Earlier rounds: anchor, measurement, follow_end, width and 20,000-row bounded-draw tests.Not done / follow-ups
The 20,000-row scrolling tape with a frame-time readout needs a window, which this worker may not open; left to the QA loop.
Changes (41 files, +1075/-900)
Gates: 6 of 6 passed
scripts/check-fmt.sh(exit 0)scripts/zb build --summary all(exit 0)scripts/zb build test --summary all(exit 0)scripts/zb build test-integration --summary all(exit 0)scripts/zb build check-web --summary all(exit 0)scripts/zb build test-sdk-version --summary all(exit 0)