Skip to content

Batch ListView horizontal width measurement#326641

Merged
ulugbekna merged 1 commit into
mainfrom
ulugbekna/batch-list-row-widths
Jul 21, 2026
Merged

Batch ListView horizontal width measurement#326641
ulugbekna merged 1 commit into
mainfrom
ulugbekna/batch-list-row-widths

Conversation

@ulugbekna

Copy link
Copy Markdown
Contributor

Summary

  • batch horizontal row width measurement into write, read, and reset phases
  • apply batching to visible-row insertion, range scrolling, and runtime horizontal-scrolling enablement
  • preserve per-row padding calculations, width caching, and deferred scroll-width updates

The dynamic-height probe remains separate; ListView rejects combining dynamic heights with horizontal scrolling.

Verification

  • added a deterministic ListView test proving all five fit-content writes precede all five offsetWidth reads for splice, scroll/reuse, and enablement paths
  • verified per-row padding arithmetic and row-width resets
  • npm run typecheck-client
  • targeted ListView unit suite
  • npm run valid-layers-check
  • staged pre-commit hygiene

Fixes #326639

cc @roblourens

Measure newly rendered horizontal list rows in write, read, and reset phases to avoid forcing layout once per row.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 2c0b92b3-6220-4240-b8ef-c4659821f893
Copilot AI review requested due to automatic review settings July 20, 2026 15:41
@vs-code-engineering

Copy link
Copy Markdown
Contributor

📬 CODENOTIFY

The following users are being notified based on files changed in this PR:

@benibenj

Matched files:

  • src/vs/base/browser/ui/list/listView.ts

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Batches ListView horizontal row-width measurements to reduce repeated browser layouts.

Changes:

  • Separates width writes, reads, and resets into batch phases.
  • Applies batching to insertion, scrolling, and runtime enablement paths.
  • Adds deterministic coverage for ordering, padding, caching, and resets.
Show a summary per file
File Description
src/vs/base/browser/ui/list/listView.ts Implements batched row-width measurement.
src/vs/base/test/browser/ui/list/listView.test.ts Verifies batching and width calculations.

Review details

  • Files reviewed: 2/2 changed files
  • Comments generated: 0
  • Review effort level: Medium

@roblourens

Copy link
Copy Markdown
Member

Not sure why the cc for me, am I supposed to know anything about this? 😅

@ulugbekna

Copy link
Copy Markdown
Contributor Author

@roblourens agent somehow thought you were the owner, but yeah, it's for Ben

@ulugbekna

Copy link
Copy Markdown
Contributor Author

@benibenj I'm going ahead with merging to get more selfhosting time. We can revert if you don't like the change when you're back

@ulugbekna
ulugbekna merged commit 5616258 into main Jul 21, 2026
30 checks passed
@ulugbekna
ulugbekna deleted the ulugbekna/batch-list-row-widths branch July 21, 2026 13:05
@vs-code-engineering vs-code-engineering Bot added this to the 1.131.0 milestone Jul 21, 2026
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.

Batch ListView horizontal width measurement to avoid repeated layout

4 participants