Skip to content

Report virtual-list range after data changes - #894

Merged
Ernxst merged 2 commits into
mainfrom
fix/virtual-list-visible-range
Oct 2, 2026
Merged

Ernxst merged 2 commits into
mainfrom
fix/virtual-list-visible-range

Conversation

@Ernxst

@Ernxst Ernxst commented Oct 2, 2026

Copy link
Copy Markdown
Collaborator

Harness: Codex
Agent: none
Model: gpt-6-astra

Task statements
  1. Fix virtual-list visible-range callbacks after data and layout changes. (Working-directory and workflow instructions omitted.)

What changed

<virtual-list> now reports a changed visible range after list data or layout updates, including when a smaller itemCount clamps the scroll position. Repeated updates that leave the range unchanged do not emit duplicate callbacks. The renderer preserves the last reported range when it replaces list state, then checks the laid-out range after the update. The test renderer delivers native events from a committed render before returning, matching the live renderer.

Closes #882.

Surface audit

  • Covered count shrink below and above the current position, unchanged rerenders, growth, empty and restored lists, windowStart, row-height estimates and viewport height.
  • After a clamp, virtual-list scrollTop and scroll metrics report the clamped position and content extent. GPUI's scrollbar offset and maximum derive from that same list state. <virtual-list> does not expose onScroll; ordinary overflow containers still report onScroll when a content update clamps them.
  • The related virtual-list keyboard-window and ordinary scroll-event paths pass. No screenshot goldens changed.

Validation

  • On the base branch, the reduced windowed consumer stayed on Part 12 after shrinking from 106 rows to 12, and Part 1 was missing. The regression now reports { startIndex: 0, endIndex: 12 } and the windowed consumer returns to Part 1.
  • Satisfactory's copied desktop virtual-list tests pass against packed branch builds of @gpuix/react and @gpuix/native: the bare-list range test and the data-table first-row-after-shrink test both pass.
  • The nine virtual-list and scroll test files pass sequentially (90 tests). The native build and repository typecheck pass.

@Ernxst
Ernxst merged commit 36dd9a7 into main Oct 2, 2026
35 of 36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Virtual list does not report visible range after itemCount changes

1 participant