Skip to content

fix: Stop Legacy chart oscllation in Board Components#4672

Draft
NathanZlion wants to merge 1 commit into
mainfrom
dev-v3-natidere-fix-chart-oscillation
Draft

fix: Stop Legacy chart oscllation in Board Components#4672
NathanZlion wants to merge 1 commit into
mainfrom
dev-v3-natidere-fix-chart-oscillation

Conversation

@NathanZlion

@NathanZlion NathanZlion commented Jun 27, 2026

Copy link
Copy Markdown
Member

Description

Fixes "Maximum update depth exceeded" oscillation in legacy charts

Issue:
Caused since PR #3018 added an inner wrapper inside .content-fit-height to 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: column on the outer with flex: 1 on the inner. This allocates widths to the inner wrapper, which feeds back into LabelsMeasure's ResizeObserver and 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

  1. Run a board-components dev page that renders a legacy BarChart or MixedLineBarChart inside <BoardItem>. The page used during video: widget-container/content-permutations.
  2. Before this change: charts oscillate visibly with react logs Warning: Maximum update depth exceeded repeatedly.
  3. After this change: charts render cleanly, no console warnings.
Review checklist

The following items are to be evaluated by the author(s) and the reviewer(s).

Correctness

  • Changes include appropriate documentation updates.
  • Changes are backward-compatible if not indicated, see CONTRIBUTING.md.
  • Changes do not include unsupported browser features, see CONTRIBUTING.md.
  • Changes were manually tested for accessibility, see accessibility guidelines.

Security

Testing

  • Changes are covered with new/existing unit tests?
  • Changes are covered with new/existing integration tests?

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

… 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

codecov Bot commented Jun 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.57%. Comparing base (902b5ad) to head (078d21a).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

1 participant