fix: Stop Legacy chart oscllation in Board Components#4672
Draft
NathanZlion wants to merge 1 commit into
Draft
Conversation
… oscillation PR #3018 (AWSUI-54814) introduced a flex column layout on .content-fit-height with a flex:1 inner wrapper to fix the table sticky scrollbar floating above the table content. Flex's sub-pixel space distribution makes the inner wrapper's content-box width oscillate by fractions of a pixel under certain conditions, which feeds back into LabelsMeasure's ResizeObserver and causes 'Maximum update depth exceeded' in legacy charts (BarChart, MixedLineBarChart, PieChart) inside fit-height containers — most visibly inside board-components BoardItem. CSS Grid with grid-template-rows: 1fr uses an integer-pixel track sizing algorithm, so the inner wrapper gets a stable integer width and the ResizeObserver feedback loop terminates after one cycle. The structural change (outer scrolling wrapper, inner padding wrapper) is preserved, so the original AWSUI-54814 sticky scrollbar fix continues to work. Bisect notes (board-components content-permutations dev page): components 3.0.836 -> CLEAN components 3.0.837 -> BROKEN (PR #3018 lands) components HEAD with Option D (CSS Grid) -> CLEAN components HEAD with min-block-size: 100% (no flex) -> STILL OSCILLATES components HEAD with flex: 1 1 auto -> STILL OSCILLATES Rel: AWSUI-62091 Rel: AWSUI-54814 (regression guard)
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4672 +/- ##
=======================================
Coverage 97.57% 97.57%
=======================================
Files 948 948
Lines 30489 30489
Branches 11148 11149 +1
=======================================
Hits 29749 29749
+ Misses 733 693 -40
- Partials 7 47 +40 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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 "Maximum update depth exceeded" oscillation in legacy charts
Issue:
Caused since PR #3018 added an inner wrapper inside
.content-fit-heightto fix the table sticky scrollbar floating above content (AWSUI-54814). (Had to do a binary search to find the exact place since issue existed). Verified this is the cause by undoing this cmmit and checking if it fixed the issue and it did.The wrapper uses
display: flex; flex-direction: columnon the outer withflex: 1on the inner. This allocates widths to the inner wrapper, which feeds back intoLabelsMeasure'sResizeObserverand prevents the chart's auto-width measurement from stabilizing.So with this change the original issue for which the PR was a fix for is still addressed without it causing issue with the Board Component.
Related links, issue AWSUI-62091,
How has this been tested?
Before:
Screen.Recording.2026-06-16.at.7.40.01.PM.mov
After:
Screen.Recording.2026-06-28.at.12.49.16.AM.mov
BarChartorMixedLineBarChartinside<BoardItem>. The page used during video:widget-container/content-permutations.Warning: Maximum update depth exceededrepeatedly.Review checklist
The following items are to be evaluated by the author(s) and the reviewer(s).
Correctness
CONTRIBUTING.md.CONTRIBUTING.md.Security
checkSafeUrlfunction.Testing
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.