Repository navigation
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
kianbazza
force-pushed
the
ui-643-batch-sticky-row-width-reads-and-writes
branch
from
October 10, 2026 23:33
17f4437 to
7efc2c8
Compare
This branch was successfully deployed
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.
Summary
Row width measurement wrote the measuring styles to a row and then read its width, one row at a time. Each read after a write forces a synchronous layout, so opening a menu cost one layout per row. Each batch now writes, reads and restores in three passes.
Debug logging in the hook now takes its details as a function, so with the debug flag off none of it is computed. That includes the per-row
getComputedStylecall, the zero-width diagnostics and the payload objects. Per-row debug output inside a batch is logged once per batch.Evidence
use-sticky-row-width.test.tsx› "applies measuring styles to every row before reading any width": five items with known widths. It logs, in order, each width read and each measuring write to a row (style.width,style.maxWidth,data-measuring). One row starts with its own inlinewidthandmax-width.AssertionError: expected 5 to be 1After: passes. Every row ends with its original inline sizes and no
data-measuring.The test also fails for a version that batches the attribute but still writes
widthandmax-widthper row between reads (5 forced layouts), and for one that clears inline sizes instead of restoring them.The existing subpage
--row-widthtest passes unchanged.Merge Danger
Door: two-way
Blast Radius: small
Every row in a batch is in measuring mode at the same time. Each one has an explicit
width: max-content, so its width doesn't depend on its siblings, but unusual custom CSS on[data-measuring]could see a different--row-width.Closes UI-643