fix(flame_devtools): Fix component tree growing list and stale snapshot#3911
Open
Barba2k2 wants to merge 2 commits intoflame-engine:mainfrom
Open
fix(flame_devtools): Fix component tree growing list and stale snapshot#3911Barba2k2 wants to merge 2 commits intoflame-engine:mainfrom
Barba2k2 wants to merge 2 commits intoflame-engine:mainfrom
Conversation
Two unrelated UI bugs in the DevTools extension surfaced by issue flame-engine#3289 when running against games with constant animations: 1. The component tree was wrapped in a SingleChildScrollView with shrinkWrap: true on the inner TreeView. The tree therefore sized itself to its content and grew on every frame, never filling the Expanded slot above it. Drop the redundant outer scroll view and let TreeView own its scrolling and use the available height. 2. Base64Image fed the snapshot bytes through Flame.images.fromBase64 keyed by component id, so re-selecting the same component (or re-requesting a snapshot for it after the game state changed) hit the global cache and rendered a stale frame — the gray image reported in the issue. Decode the bytes directly inside the widget and dispose the ui.Image when the data or widget changes. Fixes flame-engine#3289
spydon
reviewed
May 3, 2026
Member
spydon
left a comment
There was a problem hiding this comment.
The PR description needs to follow the PR template.
Author
|
@spydon updated the description to follow the PR template — thanks for the heads up. |
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
Two unrelated UI bugs in the DevTools extension surfaced by #3289 (running the extension against a game with constant animations).
1. Component tree never fills the panel
ComponentTreeSectionwrappedTreeView.simple(shrinkWrap: true)inside aSingleChildScrollView. WithshrinkWrap: truethe tree sized itself to its content and let the outer scroll view be unbounded; it therefore grew on every animation frame and never filled theExpandedslot above it — that's the "constantly growing list that does not take up the entire vertical space" in the report.Dropped the outer
SingleChildScrollViewand theshrinkWrap: trueflag.TreeView.simplenow owns its scrolling and fills the available height the parent gives it.2. Selected-component snapshot is stale ("gray image")
Base64Imagefed snapshot bytes throughFlame.images.fromBase64(imageId, base64), keyed by component id only. Re-requesting a snapshot for the same component after its game state changed hit the global cache and got the previous decoded frame back — that's the gray/stale image in the report.Converted
Base64Imageto aStatefulWidgetthat decodes the base64 directly viadecodeImageFromList, owns the resultingui.Image, and disposes it on widget removal or whenbase64/imageIdchanges. Bypasses the global cache entirely, which is the right call for these short-lived debug snapshots.How to verify
melos devtools-buildexamples/and open the Rogue Shooter game.Checklist
flame_devtoolshas no test suite; manual verification steps above)docsand added dartdoc comments with///.examplesordocs.Breaking Change?
Related Issues
Fixes #3289