New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add debug disable layer toggles to the Performance page #3441
Conversation
One idea is to leave |
packages/devtools_app/lib/src/performance/performance_screen.dart
Outdated
Show resolved
Hide resolved
This is what that would look like. I worry that the controls section is looking pretty busy. |
|
Could you please help me clarify the copy used here?
The language used in the mock doesn't seem to be consistent with flutter.dev/docs. I would suggest to keep them aligned so the users can have clear references. Thanks. |
I am not completely opposed to changing these to "enable", though I will push back a bit with some thoughts from the developer perspective. The user action here is truly to disable a layer for debugging purposes only, which I think may be better communicated by having "disable" in the action title. If "enable" is in the title, we need to make sure we are communicating that each of these rendering layers are enabled by default with flutter, and that they are not settings that DevTools is manually enabling, or that a user can expect to turn off to improve performance in a release build. We do have some other areas in DevTools where the setting action is phrased in the negative, like "hiding" certain classes or code in memory snapshots and CPU profiles, so this is not completely inconsistent with other DevTools settings. @ayanogawa Looping in someone from the framework to fact check me on these answers: @goderbauer
From my understanding, no. The layer tree is generated during paint.
Yes. Anything that uses a ClipRectLayer, ClipRRectLayer, or a ClipPathLayer.
This applies to anything with an OpacityLayer. The Opacity widget is one widget that uses an OpacityLayer for rendering, but there are also others. A list could be put together by tracing the code references in the framework, but there are several places where OpacityLayer is used.
Yes. This applies to anything that uses a PhysicalModelLayer, which include RenderPhysicalModel and RenderPhysicalShape. I do have a concern with using the terminology "filter" as these options will not filter data that is currently visible in the performance page, but rather will affect how Flutter is rendering your app. To see a difference after turning on one of these debug toggles, the user will have to interact with their app again to reproduce the activity they want to profile. Communicating this required "reproducing" behavior has been a sticking point with Track Widget Builds as well, since users do not know that they have to reproduce activity in their app to get widget build trace events to show up. |
In general UX principles, checkbox should be used with positive phrasing. For example, use do instead of do not, and notify instead of do not notify: The reason is that a checked checkbox means "Yes", and users would need to wrap their head around the negative phrase "Disabled" to decide if the actual state is "on" or "off". I guess that's why I got confused the first time I saw the design. |
@kenzieschmoll What about "Trace events" at header? |
The problem with linking to Layers is that users typically don't interact with the layer tree. The user will understand the context of the widget tree, but not necessarily all the layers flutter uses behind the scenes during paint. I don't think "Trace Events" is the right title here, as these debugging options don't all affect trace events directly. "Debugging options" is probably a more accurate title. Here's a summary of what each option does: Performance Overlay: overlays a performance chart on your app (docs) The effects for the last three debugging options (the new ones added by this PR) will likely show up to the user as faster frame times (smaller bars in top chart on performance page) or fewer or shorter raster thread timeline events for a flutter frame. |
The answers to those questions LGTM. |
@@ -1510,6 +1510,7 @@ class CheckboxSetting extends StatelessWidget { | |||
if (tooltip != null) { | |||
return DevToolsTooltip( | |||
tooltip: tooltip, | |||
padding: const EdgeInsets.all(denseSpacing), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: should this be the default everywhere? Seems a little odd to have some of our tooltips have different padding.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default padding is only a problem when the tooltip breaks to two lines. Gave DevToolsTooltip the same default padding as Tooltip to ensure the vertical padding is set as it should be.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixes #2778, in combination with flutter/flutter#91499
In this PR, I also consolidated all the debugging options into a dialog that is launched by clicking a button "Debugging Options". Looking for some feedback on this layout. Optionally, we can use switches instead of checkboxes.