flutter-intellij icon indicating copy to clipboard operation
flutter-intellij copied to clipboard

Show Semantics Tree in Flutter Inspector

Open goderbauer opened this issue 7 years ago • 14 comments

Seeing the Widget and Render Tree Hierarchy in the Flutter Inspector is great. Would love to also see the Semantics Tree there.

goderbauer avatar Jan 22 '18 21:01 goderbauer

@jacob314

devoncarew avatar Jan 22 '18 21:01 devoncarew

While we are adding more trees, would seeing the Layer tree also be useful? Showing these trees will be cheap as they are already ported to use DiagnosticsNode on the Flutter side.

jacob314 avatar Jan 22 '18 21:01 jacob314

I have never used the Layer tree for debugging, so I'll defer to @Hixie to answer that question.

goderbauer avatar Jan 22 '18 22:01 goderbauer

Layer tree isn't going to be that helpful to a lot of people, but certainly it will be helpful to some. Much like the accessibility tree.

Hixie avatar Jan 22 '18 22:01 Hixie

What do you think of having the Semantics and Layer tabs only show up in the inspector if a menu item in the "Additional Actions" in the Flutter Inspector view has been checked? Here are the options on the menu currently:

image

jacob314 avatar Jan 22 '18 23:01 jacob314

Is the Semantics tree something app developers would use? If it's more for framework engineers or someone who has special needs of app accessibility, let's hide it in the menu.

InMatrix avatar Jan 23 '18 00:01 InMatrix

The semantics tree is something you would use when making your app accessible. The layer tree is something you would use when debugging a compositing problem with your app.

In practice there is little difference between a "framework engineer" and an "app developer" once the app developer is advanced enough.

Hixie avatar Jan 23 '18 01:01 Hixie

I agree there is no hard distinction between framework engineers and app developers. I'd like to learn more about the kinds of issues these two trees can help diagnose.

Does a compositing problem usually indicate a bug in the framework or engine, or can it be caused by incorrect use of Flutter APIs?

InMatrix avatar Jan 23 '18 01:01 InMatrix

The Semantics Tree is also useful for app developers that want to make their app accessible. I just used it to figure out why a certain text widget in an app is not focusable. And the Semantics Tree showed me that that text actually got merged into another semantics node.

goderbauer avatar Jan 23 '18 01:01 goderbauer

Does a compositing problem usually indicate a bug in the framework or engine, or can it be caused by incorrect use of Flutter APIs?

There's very little distinction between "framework" code and code that makes "use of Flutter APIs". We expect developers to create their own Layer subclasses, their own RenderObjects, their own Widgets, etc.

You would need the layer tree (or rather, be helped by the layer tree) if you were to try and debug performance issues, logic issues with custom layers, that kind of thing.

Hixie avatar Jan 23 '18 04:01 Hixie

+1 for customer:mulligan

paolosoares avatar Aug 02 '18 20:08 paolosoares

+1 on the layer tree. Large enterprise users would definitely appreciate being able to visualize the layer tree in non-ascii form.

xster avatar Aug 16 '18 05:08 xster

some updates here? Also FocusTree would be helpful.

AlwinBrauns avatar Apr 04 '25 09:04 AlwinBrauns

Hello! bumping this, coming from react testing library it'd be great to take the same approach of writing tests based on accessibility metadata when developing flutter apps. However, right now the only way I've found of getting the current semantic tree is through debugDumpSemanticsTree which is a rather basic dev experience.

ivanpondal avatar May 09 '25 12:05 ivanpondal