Repository navigation
fix(virtual-list): render and measure the new range before the first frame paints - #281
Merged
Merged
Conversation
…ures, so its first painted frame shows them measured Agent: DEV1 (developer) Agent-Model: Anthropic Opus 5.5, Medium
Agent: DEV1 (developer) Agent-Model: Anthropic Opus 5.5, Medium
…next render Agent: DEV1 (developer) Agent-Model: Anthropic Opus 5.5, Medium
…t the viewport until the next render Agent: DEV1 (developer) Agent-Model: Anthropic Opus 5.5, Medium
…ader may load more when it opens near an edge Agent: DEV1 (developer) Agent-Model: Anthropic Opus 5.5, Medium
… release the clamp checker's view after an in-frame render Agent: DEV1 (developer) Agent-Model: Anthropic Opus 5.5, Medium
… work doesn't resize them in the observer's callback Agent: DEV1 (developer) Agent-Model: Anthropic Opus 5.5, Medium
…osition Agent: DEV1 (developer) Agent-Model: Anthropic Opus 5.5, Medium
…ast it Agent: DEV1 (developer) Agent-Model: Anthropic Opus 5.5, Medium
rostislavrotaru
commented
Nov 30, 2026
… report at open A clamp in any pass and the open's moved scroll now make one report after the last pass. The first-frame spec reads the reports, declares its fields, keeps its helpers in classes, and stops reading frames even when an open fails. Agent: DEV1 (developer) Agent-Model: Anthropic Opus 5.5, Medium
…les, when items come after their rows A row drawn before its item came holds the estimate's height; measuring it there took the estimate for the row and spent the open report, and the browser's scroll as the row bound reported a passing place. Such a row is no measure now, and a scroll the browser makes before the rows' first measure joins the open report. Agent: DEV1 (developer) Agent-Model: Anthropic Opus 5.5, Medium
…red rows' mean height Rows far below the estimate reached only a few rows further each pass, so 1000 rows of 2 px took 14 frames of growing work to settle and ran out the settle limit on CI. The range the list renders and reads now counts an unmeasured row at the mean measured height, and settles in a frame or two. The bound test settles those rows and counts its frames; rows that change at every check reach the bound instead. Agent: DEV1 (developer) Agent-Model: Anthropic Opus 5.5, Medium
Agent: DEV1 (developer) Agent-Model: Anthropic Opus 5.5, Medium
rostislavrotaru
commented
Nov 30, 2026
rostislavrotaru
left a comment
Contributor
Author
There was a problem hiding this comment.
Reviewed: #281 at 7182604
Verdict: Approve
Findings: 0 Should fix, 0 Low, as line comments
Why it's right: the open reports once, after the first measure of a row with its item (placeholder slots no longer count), and the render range counts unmeasured rows at the measured mean, so a list of tiny rows settles in one frame; specs cover one report at open, none when unmoved, the gated double report, and the ledger's range. CI is green; macOS x64's rise is a slow runner (its build step rose as much), well under the limit.
Agent: LEAD (lead)
Agent-Model: Anthropic Opus 5.5, High
rostislavrotaru
added a commit
that referenced
this pull request
Nov 30, 2026
Closes #280 Built on #281, now merged; the branch merged main after it, so it holds only this change. ## Change `VirtualListComponent.focusRow(index)` scrolls the list the least that shows the row at that position, renders it if it isn't rendered, and focuses it once it is drawn, as the arrow keys do. It's for an app that keeps its own cursor in a list and today has to reach into the list's markup to focus a row. - `virtual-list.component.ts`: `focusRow` clamps the position to the list, so a position before the start focuses the first row and one past the end the last; an empty list does nothing. It moves the focus the way the keys do (`moveTo`). - `virtual-list.component.ts`, `virtual-list.resources.ts`: a feed's row takes a pending focus only once it has its `tabindex`, which it gets when its item binds, a render after the row is drawn; before, the pending focus was dropped on that first render and the row never took it. - `api/index.d.ts`: the method, with a file-panel example; the docs site's component page shows it from the d.ts. `documents/kit/virtual-list.md`: a line on it. Limit: a row whose item is still loading takes the focus when it is drawn only if the focus was in the list, as with the keys. ## Tests `virtual-list.component.spec.ts`: - a rendered row: focused in place, no scroll, and the list's Tab stop moves to it; - a row outside the rendered range (500 of 1000): rendered, scrolled into view and focused, its box 270px to 296px from the view's top; - positions out of range: -5 focuses the first row, 5000 the last; an empty list leaves the focus where it was; - a feed's row: focused once its item binds. Agent: DEV1 (developer) Agent-Model: Anthropic Opus 5.5, Medium
Merged
rostislavrotaru
added a commit
that referenced
this pull request
Dec 1, 2026
Closes #286 Moves the kit to 0.0.48, with what has merged since 0.0.47, so apps can take the binary file note and the path tooltip from #282, and the tab marker's tone, close place and dot from #299. ## What changes - `version.json` is at 0.0.48. - `CHANGELOG.md` has the 0.0.48 section, one entry per change a consumer or docs-site reader sees, from #303 (#299), #291 (#280), #281 (#275), #285 (#282), #263 (#151), #250 (#245), #262 (#138, #223), #260 (#16), #248 (#233), #258 (#18), #268 (#28), #255 (#234), #254 (#239), #256 (#236), #253 (#238), #252 (#160), #249 (#244), #242 (#231), #269 (#261) and #259 (#26). - Left out, as changing nothing the package or the docs site shows: #251 (the header's phone-bar rules written once, the same look), #247 (workflow pins), #264 and #277 (build scripts), #266 (example names and their check), #267, #271, #272, #273, #274, #276, #289 and #290 (tests and their tools), #279 and #295 (workflow pins). ## Checks No test covers these two files. The product names check reads the new section in CI; it names no product. Agent: DEV2 (developer) Agent-Model: Anthropic Opus 5.5, Medium
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue: #275
Part of #275: the virtual list's first painted frame now shows its rows measured, at the right scroll. The issue's TeamRun check on macOS comes after this change.
Cause
measure(), the list's ResizeObserver callback, runs after layout and before paint. It set the padding and the scroll at once, but the rows the new range holds come from signals Angular renders on its next tick, so the painted frame showed the old range at the measured offsets. Read last before each paint, on Linux, macOS and Windows alike, with a 160 px estimate in a 600 px view:Change
src/app/components/virtual-list/virtual-list.component.ts:measure()applies the measures; when they change which rows the range holds, it renders the list (detectChanges), sets the padding for the new range, measures every rendered row, and applies those, until no measure moves a row. A pass whose rows are already on the page, in order, with the range's space below them, doesn't render. A render also checks the rows' contents, so a row's pending work, such as a message revealing its text, would otherwise grow it within the callback.VirtualListResources.virtualListMeasurePasses) with a console warning (formatVirtualListMeasurePassesWarning). Rows that change height at every check reach it.src/app/models/height-ledger.ts:renderRangeForgives the rows to render and read:rangeFor's, reaching further where rows aren't measured yet, counting each at the mean height of the rows measured so far rather than the estimate. The list's rendered range and its read-ahead use it; the visible range and the offsets don't change. This is in this PR because its CI needs it: with rows at a quarter of the estimate or less, each pass reached only a few rows further, so 1000 rows of 2 px took 14 frames of growing work (600 rows rendered and measured up to 16 times a frame, up to 700 ms a frame on macOS) and ran past the 15 s settle limit on CI's macOS x64. They now settle a frame after the first frame that shows rows.src/app/interfaces/i-measured-box.ts: a measured box, a ResizeObserver entry's or a row's the list measures itself.documents/kit/virtual-list.md: the first painted frame, the bound and its warning, and the position at open.Consumers of the open position
With the render in the callback, the list no longer moved its scroll after the first paint, so it reported no position at open, which main did through the scroll event. A search of ui-components, teamrun and git for
positionChangefound two consumers, both in teamrun:Tests
tests/app/components/virtual-list/virtual-list-first-frame.spec.ts:height-ledger.spec.ts:renderRangeForreaches over unmeasured rows at the measured mean, and givesrangeFor's range while nothing is measured.The checks:
virtual-list.component.tsand.resources.ts, on Linux, the 55 px, 60 px and 75 px cases fail and the 40–400 px one passes. The bound's test names the new resources, so that run left it out.virtual-list.component.spec.ts's test that lays out none of its settling after a render elsewhere, which reads the last position, passes unchanged.Agent: DEV1 (developer)
Agent-Model: Anthropic Opus 5.5, Medium