Skip to content

Fix Flutter frames chart freeze after switching screens - #9960

Open
khanak0509 wants to merge 3 commits into
flutter:masterfrom
khanak0509:fix-frames-timeline-freeze-9525
Open

Fix Flutter frames chart freeze after switching screens#9960
khanak0509 wants to merge 3 commits into
flutter:masterfrom
khanak0509:fix-frames-timeline-freeze-9525

Conversation

@khanak0509

Copy link
Copy Markdown
Contributor

issue #9525
This PR fixes issue #9525 where the Flutter frames timeline occasionally looked frozen after switching to another screen and coming back. Frames were still being recorded in the background, but the chart remounted at the oldest frames and only auto-scrolled if it was already at the bottom — so the live ones were off to the right and it felt stuck until a full DevTools reload.

How I fixed it:
Basically, when the chart remounts with no frame selected, it now docks to the live edge instead of starting at offset 0, and snaps after the first layout so live follow keeps working.

before ->

before.mov

after ->

after.mov

Pre-launch Checklist

General checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read the Flutter Style Guide recently, and have followed its advice.
  • I signed the CLA.
  • I updated/added relevant documentation (doc comments with ///).

Issues checklist

Tests checklist

  • I added new tests to check the change I am making...
  • OR there is a reason for not adding tests, which I explained in the PR description.

AI-tooling checklist

  • I did not use any AI tooling in creating this PR.
  • OR I did use AI tooling, and...
    • I read the AI contributions guidelines and agree to follow them.
    • I reviewed all AI-generated code before opening this PR.
    • I understand and am able to discuss the code in this PR.
    • I have verifed the accuracy of any AI-generated text included in the PR description.
    • I commit to verifying the accuracy of any AI-generated code or text that I upload in response to review comments.

Feature-change checklist

  • This PR does not change the DevTools UI or behavior and...
    • I added the release-notes-not-required label or left a comment requesting the label be added.
  • OR this PR does change the DevTools UI or behavior and...
    • I added an entry to packages/devtools_app/release_notes/NEXT_RELEASE_NOTES.md.
    • I included before/after screenshots and/or a GIF demo of the new UI to my PR description.
    • I ran the DevTools app locally to manually verify my changes.

build.yaml badge

If you need help, consider asking for help on Discord.

@khanak0509
khanak0509 requested a review from a team as a code owner August 12, 2026 21:16
@khanak0509
khanak0509 requested review from bkonyi and removed request for a team August 12, 2026 21:16

@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 implements auto-scrolling to the live edge of the Flutter frames chart when there is no selected frame, ensuring the chart docks correctly on initial layout and when remounting the performance pane. It also adds comprehensive widget tests to verify this behavior. The reviewer identified a potential edge case where a narrow layout or initial layout pass could result in a negative chart width, leading to an incorrect scroll offset, and suggested clamping the calculated width to a minimum of 0.0.

…r_frames/flutter_frames_chart.dart

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
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