Skip to content

Trigger re-layout when resizing CPU flame chart - #9915

Merged
srawlins merged 4 commits into
flutter:masterfrom
srawlins:flame
Jul 27, 2026
Merged

Trigger re-layout when resizing CPU flame chart#9915
srawlins merged 4 commits into
flutter:masterfrom
srawlins:flame

Conversation

@srawlins

Copy link
Copy Markdown
Contributor

Fixes #7022

When resizing the window, the flame chart's layout width (widget.containerWidth) changes. However, the custom paint widgets like TimelineGridPainter are repainted with the new width, while the chart elements are still positioned using the old cached width because initFlameChartElements() is only triggered when the data itself changes.

@srawlins
srawlins requested a review from a team as a code owner July 27, 2026 16:55
@srawlins
srawlins requested review from bkonyi and removed request for a team July 27, 2026 16:55

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request addresses an issue where resizing the CPU flame chart changes timing values by triggering a re-layout of flame chart elements when the container dimensions change, and adds a corresponding widget test. Feedback on the changes suggests optimizing performance by only re-initializing elements when the container width changes (and not the height), and reminds the author to update the placeholder PR link in the release notes.

Comment thread packages/devtools_app/lib/src/shared/charts/flame_chart.dart Outdated
Comment thread packages/devtools_app/release_notes/NEXT_RELEASE_NOTES.md Outdated

@bkonyi bkonyi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM overall, with one comment.

Comment thread packages/devtools_app/lib/src/shared/charts/flame_chart.dart Outdated
@srawlins
srawlins merged commit 26fbb75 into flutter:master Jul 27, 2026
51 checks passed
@srawlins
srawlins deleted the flame branch July 27, 2026 22:08
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.

Resizing the CPU flame chart changes the timing values across the top of the chart

2 participants