fix: Stop Legacy chart oscllation in Board Components#4672
Draft
NathanZlion wants to merge 2 commits 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 30491 +2
Branches 11148 11150 +2
=======================================
+ Hits 29749 29751 +2
Misses 733 733
Partials 7 7 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…height inner Follow-up to the CSS Grid switch. Two related sizing issues surfaced in the board-components content-permutations screenshot tests once the inner wrapper became a grid item: 1. Vertical: legacy charts inside fitHeight use a nested <svg height="100%"> and measure its rendered height via useHeightMeasure. With min-block-size: 0 alone on the grid item, the inner wrapper's block-size is indefinite for percentage resolution, so the SVG falls back to its intrinsic viewport height. That produces a plot much larger than the widget and pushes the bars/legend off-screen. Fix: add block-size: 100% so descendants have a definite parent height to resolve against — matches the resolved-size behavior of the original flex: 1 layout without reintroducing flex's sub-pixel width distribution. 2. Horizontal: without an explicit column track, the grid falls back to an implicit auto column that grows to the widest child's max-content, letting wide inner content overflow the container instead of being scrolled by overflow: auto. Fix: grid-template-columns: minmax(0, 1fr) on the outer + min-inline- size: 0 on the inner, which replicates flex's align-items: stretch: the inner is exactly one parent width, wide content overflows the inner, and .content-fit-height's overflow: auto handles scrolling. Verified against board-components content-permutations page (Firefox screenshot test AWS-UI-IntegrationTests board-components-Firefox-local- light-console-comfortable). Rel: AWSUI-62091
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.