Add more meta flags to hide features for imported profiles#4189
Conversation
This reverts commit f71d375.
Codecov Report
@@ Coverage Diff @@
## main #4189 +/- ##
==========================================
- Coverage 88.46% 88.44% -0.03%
==========================================
Files 280 280
Lines 24527 24552 +25
Branches 6536 6548 +12
==========================================
+ Hits 21697 21714 +17
- Misses 2628 2636 +8
Partials 202 202
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
mstange
left a comment
There was a problem hiding this comment.
The overall approach seems fine, but I'd like to request some different names.
For the profile.meta flags, I'd prefer names that describe the profile instead of names that tell the UI what to do. Here are some suggestions:
hideNativeFrameSelection+hideStackType->usesOnlyOneStackTypehideImplementationData->doesNotUseFrameImplementationhideSearchFoxInMenu->sourceCodeIsNotOnSearchfox(note the lowercase f in Searchfox)hideCopyScriptURLInMenu-> nothing (see below)
For the selectors, let's use non-negated statements about the profile data.
getHideNativeFrameSelection+getHideStackType->getProfileUsesMultipleStackTypesgetHideImplementationData->getProfileUsesFrameImplementationgetHideSearchFoxInMenu->getShouldDisplaySearchfoxgetHideCopyScriptURLInMenu-> nothing
And for the React component prop names, please use non-negated phrasings that fit from the perspective of the component. Suggestions:
hideNativeFrameSelection->allowSwitchingStackTypehideStackType->displayStackTypehideImplementationData->displayImplementationhideSearchFoxInMenu->displaySearchfoxhideCopyScriptURLInMenu-> nothing (see below)
As for "Copy Script URL", I tried it on your example profiles and it didn't copy anything. My clipboard still contained whatever I had copied before. This indicates to me that the profiler wasn't able to find any script URL - maybe it was null or an empty string? In that case, can we just hide the menu item if that happens? It may make sense to remove the hideCopyScriptURLInMenu part from this PR and take care of that menu item in a new PR.
|
I incorporated all your suggestions.
That's the better option for sure. I included it in this PR, as it is only a single line of added code. |
mstange
left a comment
There was a problem hiding this comment.
This looks good to me. Thanks!
This adds some of the properties which were added in firefox-devtools/profiler#4189 .
I propose with this PR the addition of five flags to hide information and selectors that don't make sense for many imported non-browser profiles:
Sample profile file
Current production
Deploy preview