Skip to content

Implement container that gives additional information on the profile setting#4222

Merged
julienw merged 7 commits into
firefox-devtools:mainfrom
parttimenerd:parttimenerd_more_info_panel
Oct 11, 2022
Merged

Implement container that gives additional information on the profile setting#4222
julienw merged 7 commits into
firefox-devtools:mainfrom
parttimenerd:parttimenerd_more_info_panel

Conversation

@parttimenerd

@parttimenerd parttimenerd commented Sep 7, 2022

Copy link
Copy Markdown
Contributor

This implements a container giving more information than already provided in the "Profile Info" container (see #4209). This gives us the possibility to add more information that is related to the whole profile without cluttering the "Profile Info" container.

This adds a new "Additional Information" button:
image

When you click on it, you see a floating container with additional information:

image

The information is specified in the new extra field in the meta section of the profile:

export type ExtraProfileInfoSection = {|
  // section label
  label: string,
  entries: {|
    label: string,
    format: MarkerFormatType,
    // any value valid for the formatter
    value: any,
  |}[],
|};
...
  extra?: ExtraProfileInfoSection[],
...

Sample profile

Deployment Preview

@parttimenerd parttimenerd requested a review from a team as a code owner September 7, 2022 10:03
@parttimenerd parttimenerd force-pushed the parttimenerd_more_info_panel branch 2 times, most recently from fa4c413 to 24eb3f5 Compare September 7, 2022 10:09
@codecov

codecov Bot commented Sep 7, 2022

Copy link
Copy Markdown

Codecov Report

Base: 88.44% // Head: 88.48% // Increases project coverage by +0.03% 🎉

Coverage data is based on head (feb442b) compared to base (14d46cc).
Patch coverage: 100.00% of modified lines in pull request are covered.

❗ Current head feb442b differs from pull request most recent head b0211d0. Consider uploading reports for the commit b0211d0 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4222      +/-   ##
==========================================
+ Coverage   88.44%   88.48%   +0.03%     
==========================================
  Files         282      282              
  Lines       24858    24850       -8     
  Branches     6660     6656       -4     
==========================================
+ Hits        21986    21988       +2     
+ Misses       2667     2660       -7     
+ Partials      205      202       -3     
Impacted Files Coverage Δ
src/components/app/MenuButtons/MetaInfo.js 85.41% <100.00%> (+2.70%) ⬆️
src/selectors/profile.js 96.21% <100.00%> (+0.01%) ⬆️
src/profile-logic/symbol-store.js 92.98% <0.00%> (-0.24%) ⬇️
src/components/shared/SourceView-codemirror.js 90.81% <0.00%> (-0.10%) ⬇️
src/profile-logic/symbolication.js 86.91% <0.00%> (-0.09%) ⬇️
src/profile-logic/processed-profile-versioning.js 85.21% <0.00%> (-0.07%) ⬇️
src/profile-logic/merge-compare.js 92.74% <0.00%> (-0.03%) ⬇️
src/test/fixtures/profiles/processed-profile.js 94.48% <0.00%> (-0.01%) ⬇️
src/profile-logic/data-structures.js 95.45% <0.00%> (ø)
src/profile-logic/mozilla-symbolication-api.js 13.09% <0.00%> (+1.39%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

canova
canova previously requested changes Sep 8, 2022

@canova canova left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the profile data format:
I still have doubts about using MarkerFormatType on other places but maybe in the future we can make this more generic across profile. So I'm not opposed to it.

For the UI:
Is there a need for a new overlaying popup exactly? I'm surprised by this because I was always thinking that we can use the same popup and never though of another poup. Adding another popup brings accesibility issues like, how to close, how to go back to previous popup and confusion of opening another overlay from an overlay etc.

I was thinking about expanding the same "profile info" popup with additional information when user clicks on this button. There are <details> and <summary> elements you can use for this as well. This also removes a lot of extra css and code from the PR.
What do you think?

Comment thread src/types/profile.js Outdated
@parttimenerd

Copy link
Copy Markdown
Contributor Author

I'm surprised by this because I was always thinking that we can use the same popup and never though of another poup.

Which popup? The current "Profile info" popup is pretty narrow and small. The popup can be opened and closed the same way as the "Profile info" popup.

I would like to present lots of information in this popup. Like all currently running processes on the host system, all environment variables (might have fairly long names), all used libraries.

The CSS (and code) is mostly copied from the existing "Profile info" popup.

Comment thread locales/en-US/app.ftl Outdated
@canova

canova commented Sep 8, 2022

Copy link
Copy Markdown
Member

Do you have an example where this width is not enough for your use case? Since you are moving the value to a new line, you will have more space horizontally. In your current example, it looks like they would all fit.

The problem with the new popup is that it's not obvious that which element it is tied to. For the profile info popup it's obvious that it's tied to "Profile Info" button:
Screen Shot 2022-09-08 at 3 02 38 PM
As you can see, there is a clear arrow and the button is in selected state.

But opening a popup from another popup doesn't seem right UX wise.
Also your new section seems more like a modal (especially considering that it dims the outside area). A modal should have a proper close buttons and properly handle the keyboard/focus state for accessibility.
We have a modal currently for keyboard shortcuts, you can it if you press ?:
Screen Shot 2022-09-08 at 3 08 51 PM
In this one there is a clear close button, clear title, and the focus state is handled properly.

I also don't think we should use the same modal for this case though.
Lastly I don't think we should add another panel that 99% of our users won't see. This will make future development prone to errors and we'll have to maintain it in the future. I feel like the simplest solution of expanding the current panel is a better compromise for both of us.

@parttimenerd

Copy link
Copy Markdown
Contributor Author

Lastly I don't think we should add another panel that 99% of our users won't see. This will make future development prone to errors and we'll have to maintain it in the future. I feel like the simplest solution of expanding the current panel is a better compromise for both of us.

You're probably right.

I currently don't have a case at hand where expanding the current popup to the bottom, and adding scrollbars would not help.

Another idea: Could we extend the "Profile info" to the right? This would alleviate all my width concerns.

@canova

canova commented Sep 8, 2022

Copy link
Copy Markdown
Member

Another idea: Could we extend the "Profile info" to the right? This would alleviate all my width concerns.

I'm not opposed to it as long as it doesn't make our other side by side key-value items hard to read. Could be good to get feedback from others too.

@parttimenerd

Copy link
Copy Markdown
Contributor Author

image

@parttimenerd parttimenerd force-pushed the parttimenerd_more_info_panel branch from 892759b to da3298e Compare September 15, 2022 15:05
@parttimenerd parttimenerd requested review from canova and flodolo and removed request for canova and flodolo September 21, 2022 08:27

@julienw julienw 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.

Thanks for the patch, and for your patience!
I left a few comments, tell me what you think.

First, an optional quick note: we could use a <details> element, which supports this behavior natively and would make it possible to remove the showsMoreInfo state. I'm not sure about the stylability, but it would be good to try using it.

About the formatting abilities, ideally I'd prefer that we extract the formatting mechanisms to another file before we move forward with this PR (and probably also the other one). But if that's too much work it's also good to me that we move forward with this solution and we clean up later. Please tell me your thoughts!

Also it would be good to have a test that exercize this new code. There's a block about the MetaInfo panel in src/test/components/MenuButtons.test.js that you can insert a test to.

Please squash your 2 existing commits and add your review fixes to an extra commit for an easier second review :-)

Comment thread src/components/app/MenuButtons/MetaInfo.js Outdated
Comment thread src/components/app/MenuButtons/MetaInfo.js Outdated
Comment thread src/components/app/MenuButtons/MetaInfo.js Outdated
Comment thread src/components/app/MenuButtons/index.js
Comment thread src/selectors/profile.js Outdated
Comment thread src/components/app/MenuButtons/MetaInfo.js Outdated
Comment thread src/components/app/MenuButtons/MetaInfo.js
Comment thread src/components/app/MenuButtons/MetaInfo.js
Comment thread src/components/app/MenuButtons/MetaInfo.js Outdated
Comment thread src/components/app/MenuButtons/MetaInfo.js Outdated
@parttimenerd

Copy link
Copy Markdown
Contributor Author

First, an optional quick note: we could use a

Details element, which supports this behavior natively and would make it possible to remove the showsMoreInfo state. I'm not sure about the stylability, but it would be good to try using it.

I want to still change the name of the button. So I'll still want to use the state. I could achieve this by setting CSS attributes to the localized strings, but I think this would be hard to understand.

About the formatting abilities, ideally I'd prefer that we extract the formatting mechanisms to another file before we move forward with this PR (and probably also the other one). But if that's too much work it's also good to me that we move forward with this solution and we clean up later. Please tell me your thoughts!

I'd rather like to have it in a later PR (submitted directly after merging this PR and #4201), as it would require many rebases and refactoring is not really the purpose of this PR.

@parttimenerd parttimenerd force-pushed the parttimenerd_more_info_panel branch from da3298e to 983e8af Compare September 26, 2022 13:21
@julienw

julienw commented Sep 26, 2022

Copy link
Copy Markdown
Contributor

I'd rather like to have it in a later PR (submitted directly after merging this PR and #4201), as it would require many rebases and refactoring is not really the purpose of this PR.

You shouldn't be afraid of rebases :-)

  1. Do the refactoring in another PR.
  2. Rebase this patch on top of the other PR.
  3. Change import and calls to formatters.

My understanding is that this would be about the same amount of work.

That said I'm OK with your approach.

@julienw julienw 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.

I pushed some changes, can you please have a quick look ? :) thanks

Comment thread src/components/app/MenuButtons/MetaInfo.js Outdated
Comment thread src/test/components/MenuButtons.test.js
Comment thread src/components/app/MenuButtons/MetaInfo.css Outdated
Comment thread src/components/app/MenuButtons/MetaInfo.js
@parttimenerd

Copy link
Copy Markdown
Contributor Author

Your changes look good to me.

@parttimenerd

Copy link
Copy Markdown
Contributor Author

Short objection: Why does it show "Hide" and not "Show Less"? I find the latter better.

@julienw julienw force-pushed the parttimenerd_more_info_panel branch from 279cdb5 to 3cc8b5f Compare September 30, 2022 10:09

@julienw julienw 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.

looks good with my changes (that I discussed with Johannes as well)

@julienw julienw merged commit 244f5be into firefox-devtools:main Oct 11, 2022
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.

4 participants