Repository navigation
refactor: improve menu-bar overflow detection performance - #12802
Merged
Merged
Conversation
web-padawan
force-pushed
the
refactor/menu-bar-overflow-detection
branch
2 times, most recently
from
September 22, 2026 11:24
cc2e42d to
c6f9145
Compare
web-padawan
marked this pull request as draft
September 22, 2026 11:52
The collapse loop read `offsetLeft` after every `style` write, and each read forced a full-document layout. Read every position first, decide by arithmetic, then write all hides in one pass. Part of #12783 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
web-padawan
force-pushed
the
refactor/menu-bar-overflow-detection
branch
from
September 22, 2026 13:30
c6f9145 to
66a2983
Compare
web-padawan
marked this pull request as ready for review
September 22, 2026 13:36
vaadin-review-bot
left a comment
Collaborator
There was a problem hiding this comment.
✅ Nothing to flag — the changes look good.
…itions The read order test only asserted that no position is read after a button is hidden, which also holds when no detection runs at all. Count the reads on both sides of the first hide and require the earlier ones. Move the `_hasOverflow` spy into the test that uses it and explain the 177px width. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
vursen
reviewed
Sep 22, 2026
web-padawan
force-pushed
the
refactor/menu-bar-overflow-detection
branch
from
September 22, 2026 14:27
ee1ff12 to
11531d7
Compare
vursen
reviewed
Sep 22, 2026
The overflow button position is read once while the layout is measured, and once per iteration by a loop that hides buttons as it goes. Counting those reads with a spy replaces the hand written wrapper around `getBoundingClientRect`. Narrowing the menu bar from a width where nothing collapses makes the collapse itself prove that a detection ran. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
web-padawan
force-pushed
the
refactor/menu-bar-overflow-detection
branch
from
September 22, 2026 14:53
49d0835 to
134581d
Compare
|
vursen
approved these changes
Sep 22, 2026
DiegoCardoso
approved these changes
Sep 22, 2026
web-padawan
added a commit
that referenced
this pull request
Sep 22, 2026
web-padawan
added a commit
that referenced
this pull request
Sep 22, 2026
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.



Description
Fixes #12783
The collapse loop wrote
styleon a button and then read its position on the next iteration, and each read forced a full-document layout. The loop now reads every position once, decides by arithmetic which buttons to collapse, and writes all hides in one pass.__setOverflowItemsinto__measureButtonsand__getCollapsedButtonsreverseCollapseType of change
Note
Collapse results are unchanged: 86 integer widths, 1563 fractional widths, 2892 widths across gap,
reverseCollapseand direction, and 804 zoom levels under Aura all give the same result asmain, in Chromium, Firefox and WebKit on base, Lumo and Aura styles.🤖 Generated with Claude Code