Closed Bug 1350233 Opened 8 years ago Closed 8 years ago

Add [learn more] MDN link for statistics panel

Categories

(DevTools :: Netmonitor, enhancement, P1)

enhancement

Tracking

(firefox55 verified)

VERIFIED FIXED
Firefox 55
Iteration:
55.3 - Apr 17
Tracking Status
firefox55 --- verified

People

(Reporter: gasolin, Assigned: brennan.brisad, Mentored)

References

Details

(Keywords: dev-doc-needed, good-first-bug, Whiteboard: [netmonitor-reserve])

Attachments

(6 files, 4 obsolete files)

We'd like to have a [Learn More] link to MDN on statistics panel, check https://developer.mozilla.org/docs/Tools/Network_Monitor#Performance_analysis Refer Bug 1323454 - Network panel: integrate HTTP Status code with MDN and Bug 1339686 - Convert MDN [learn more] link as a react component
You need Patch statistics-panel.js http://searchfox.org/mozilla-central/source/devtools/client/netmonitor/components/statistics-panel.js and add an MDNLink component at the end of http://searchfox.org/mozilla-central/source/devtools/client/netmonitor/shared/components/mdn-link.js Before set it as a good-first-bug, we need find a good place to put the Learn More link in statistics panel... Blake, any suggestion?
Flags: needinfo?(bwinton)
Priority: -- → P3
Whiteboard: [netmonitor]
Flags: qe-verify?
Priority: P3 → P2
(In reply to Fred Lin [:gasolin] from comment #0) > We'd like to have a [Learn More] link to MDN on statistics panel, check > https://developer.mozilla.org/docs/Tools/Network_Monitor#Performance_analysis I'm not sure we do. Which MDN url would it lead to?
Flags: needinfo?(bwinton) → needinfo?(gasolin)
The UI has been discussed between developers (Honza, me, and Ricky) last week, the rational is to help user understand what statistics panel does. So we try to do some simple thing to help user know more about the statistics view. The link would lead to https://developer.mozilla.org/docs/Tools/Network_Monitor#Performance_analysis There seems no obvious place in the statistics panel, maybe add the link in the empty list view? ``` • Click on the O button to start performance analysis. [Learn More] ```
Flags: needinfo?(gasolin) → needinfo?(bwinton)
So, with no better place to put it, we might as well stick it at the bottom center until the panel gets redesigned…
Flags: needinfo?(bwinton)
Flags: qe-verify? → qe-verify+
QA Contact: ciprian.georgiu
Assignee: nobody → brennan.brisad
Status: NEW → ASSIGNED
Priority: P2 → P3
Whiteboard: [netmonitor] → [netmonitor-reserve]
Should the link be placed in the empty request list view or in the statistics panel? Or perhaps in both? If a link is placed in the statistics panel at the bottom center it will be right below the vertical splitter, which does not look so nice as the splitter cannot extend all the way to the bottom anymore. I'm attaching a screenshot. Perhaps some clever styling could make that look less bad. What about putting it on the lower right corner instead, stealing some area from the empty cache chart? And probably lower left for RTL locales.
Flags: needinfo?(gasolin)
Attached image statistics-panel.png
This screenshot suffers from the overflow problem described in Bug 1339558
Attached image request-list.png
(In reply to Michael Brennan from comment #5) > Should the link be placed in the empty request list view or in the > statistics panel? Or perhaps in both? Both seem reasonable. People often like to know what they're going to get before they click on it. > What about putting it on the lower right corner instead, stealing some area > from the empty cache chart? And probably lower left for RTL locales. WFM.
Thanks Michael, as Blake said, we can put [Learn More] in both place, and I also prefer put the [Learn More] link on the lower right corner in Statistics View. Please also check if it shows correctly when we put the whole devtools panel in the right-side of the browser.
Flags: needinfo?(gasolin)
While deal with URL in `utils/mdn-utils`, it will be nice to distill all `https://developer.mozilla.org/docs/` as `MDN_URL` and construct links as `${MDN_URL}Tools/Network_Monitor#Performance_analysis${GA_PARAMS}`
Mentor: gasolin
Keywords: good-first-bug
Attached patch bug1350233.patch (obsolete) — Splinter Review
Attaching a patch for feedback. To keep things simple I've just placed the link in the statistics panel with `position: absolute`. This can make the link overlap with other text if the panels are resized to be too small, but I'm thinking it might not be a problem. What do you think? The reason for changing `.notice-perf-message` to use `display: flex` is to make the link appear to the left of the text in RTL locales. Don't know if that's the best way to achieve that, but it did make it work.
Attachment #8855496 - Flags: feedback?(gasolin)
Comment on attachment 8855496 [details] [diff] [review] bug1350233.patch Thanks for the patch! I've talked with Honza and he suggest put the [Learn More] link near the title of each pie chart(after `Primed cache` & `Empty cache`). Then we don't have change pie chart css to find the room for [Learn More]. We can change [Learn More] to different links later when we have better document for each chart. ``` function getNetMonitorTimingsURL() { return NETWORK_MONITOR_TIMINGS_MDN_URL; } ``` We can remove `NETWORK_MONITOR_TIMINGS_MDN_URL` and use the similar pattern to construct the URL.
Attachment #8855496 - Flags: feedback?(gasolin)
Thanks for the feedback! (In reply to Fred Lin [:gasolin] from comment #12) > I've talked with Honza and he suggest put the [Learn More] link near the > title of each pie chart(after `Primed cache` & `Empty cache`). Then we don't > have change pie chart css to find the room for [Learn More]. We can change > [Learn More] to different links later when we have better document for each > chart. Yes, sounds like a good idea. I've implemented it in the patch I'm about to attach. It wasn't that straightforward as Chart isn't a React component. We'll see if my solution is good enough. > > ``` > function getNetMonitorTimingsURL() { > return NETWORK_MONITOR_TIMINGS_MDN_URL; > } > ``` > > We can remove `NETWORK_MONITOR_TIMINGS_MDN_URL` and use the similar pattern > to construct the URL. Thanks! That one appeared after I did a rebase so I missed it.
Attached patch bug1350233.patch (obsolete) — Splinter Review
This also fixes the problem mentioned in https://bugzilla.mozilla.org/show_bug.cgi?id=1324533#c36
Attachment #8855496 - Attachment is obsolete: true
Attachment #8855770 - Flags: feedback?(gasolin)
Comment on attachment 8855770 [details] [diff] [review] bug1350233.patch Review of attachment 8855770 [details] [diff] [review]: ----------------------------------------------------------------- ::: devtools/client/netmonitor/src/assets/styles/netmonitor.css @@ +155,5 @@ > > .notice-perf-message { > margin-top: 2px; > + display: flex; > + align-items: center; Look Nice! @@ +1161,5 @@ > + font-weight: 400; > +} > + > +.statistics-panel .table-chart-title { > + display: flex; It seems works fine without this style, do we really need this? ::: devtools/client/netmonitor/src/components/request-list-empty-notice.js @@ +14,5 @@ > const Actions = require("../actions/index"); > const { ACTIVITY_TYPE } = require("../constants"); > const { L10N } = require("../utils/l10n"); > +const { getPerformanceAnalysisURL } = require("../utils/mdn-utils"); > +const MDNLink = createFactory(require("./mdn-link")); To keep consistency of declaration (ex network-details-panel.js), we can put related declaration like: ``` const { getPerformanceAnalysisURL } = require("../utils/mdn-utils"); // Components const MDNLink = createFactory(require("./mdn-link")); const { button, div, span } = DOM; ``` ::: devtools/client/netmonitor/src/components/statistics-panel.js @@ +25,5 @@ > const { button, div } = DOM; > const MediaQueryList = window.matchMedia("(min-width: 700px)"); > > +const { getPerformanceAnalysisURL } = require("../utils/mdn-utils"); > +const MDNLink = createFactory(require("./mdn-link")); same here, ``` const { L10N } = require("../utils/l10n"); const { getPerformanceAnalysisURL } = require("../utils/mdn-utils"); // Components const MDNLink = createFactory(require("./mdn-link")); const { button, div } = DOM; ```
Attachment #8855770 - Flags: feedback?(gasolin) → feedback+
(In reply to Michael Brennan from comment #14) > Created attachment 8855770 [details] [diff] [review] > bug1350233.patch Since this is user-facing code, you'll also going to need a ui-review from me. Please add that flag to the patch when you feel it's ready for review. Thanks! :)
(In reply to Fred Lin [:gasolin] from comment #16) > @@ +1161,5 @@ > > + font-weight: 400; > > +} > > + > > +.statistics-panel .table-chart-title { > > + display: flex; > > It seems works fine without this style, do we really need this? > It makes the link appear to the left of the title in RTL-locales, at least when I try with force RTL. Please let me know if this is the wrong way to accomplish this.
Attached patch bug1350233.patch (obsolete) — Splinter Review
Attachment #8855770 - Attachment is obsolete: true
Attachment #8856734 - Flags: ui-review?(bwinton)
Attachment #8856734 - Flags: review?(gasolin)
Comment on attachment 8856734 [details] [diff] [review] bug1350233.patch Looks good to me, thanks!
Attachment #8856734 - Flags: review?(gasolin) → review+
Comment on attachment 8856734 [details] [diff] [review] bug1350233.patch It's a little weird to have two links pointing to the same place, but hopefully that'll be resolved sometime soon. :) ui-r=me.
Attachment #8856734 - Flags: ui-review?(bwinton) → ui-review+
Comment on attachment 8857340 [details] Bug 1350233 - Add [learn more] MDN link for statistics panel test green
Attachment #8857340 - Attachment is obsolete: true
thanks!
Needs rebasing
Keywords: checkin-needed
Michael, could you help rebase the patch with the latest branch?
Flags: needinfo?(brennan.brisad)
Attached patch bug1350233.patchSplinter Review
Of course!
Attachment #8856734 - Attachment is obsolete: true
Flags: needinfo?(brennan.brisad)
Keywords: checkin-needed
Pushed by ihsiao@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/f20490ec8afe Add MDN links for netmonitor performance analysis. r=gasolin ui-r=bwinton
Keywords: checkin-needed
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 55
Iteration: --- → 55.3 - Apr 17
Priority: P3 → P1
Reproduced the issue with Nightly from 2017-04-10. This is verified fixed on latest Nightly 55.0a1 (2017-04-18) across platforms: Windows 10 x64, Mac OS X 10.11.6 and Ubuntu 16.04 x64 LTS. The [Learn More] link is now displayed on statistics panel.
Status: RESOLVED → VERIFIED
Flags: qe-verify+
@Michael: please see comment #31. Maybe it's simple to fix this? Honza
Flags: needinfo?(brennan.brisad)
(In reply to Jan Honza Odvarko [:Honza] from comment #32) > @Michael: please see comment #31. Maybe it's simple to fix this? > > Honza Hi, I tried with `align-items: baseline` which moved the line a small amount, but it is still different from its original position. I'm not too good with CSS and I don't know how to ensure that the original position is kept while using `display: flex`. Not changing to flex solves this issue, but then the link will still appear to the right of the text with Force RTL. So I don't know what the best way to solve this is. Is there perhaps a better way to make the link appear correctly in RTL locales without using flexbox?
Flags: needinfo?(brennan.brisad) → needinfo?(odvarko)
@Tim, any tips? (read from comment #31) Honza
Flags: needinfo?(odvarko) → needinfo?(ntim.bugs)
I don't think it's a major issue IMO. The alignment actually looks improved to me.
Flags: needinfo?(ntim.bugs)
(In reply to Tim Nguyen :ntim from comment #35) > I don't think it's a major issue IMO. The alignment actually looks improved > to me. okay, works for me. Honza
Attached image notice-perf-message.png
This is how it currently looks when the Toolbox is docked to the right
This is how it probably should look when the Toolbox is docked to the right
By chance I just noticed that when the Toolbox is docked to the right, things does not look so good. Please see the attached screenshots above. This is because of Flexbox and it's probably best to just get rid of it. Then it will look like in the second screenshot. As for RTL, I don't know how to solve it. I tried to conditionally put the link either before or after the line with javascript, but I still couldn't get it to work as there is some magic happening automatically with the full stop and the bullet point when I use Force RTL. I don't speak any RTL languages and perhaps I'm overthinking this. Should I attach a patch that makes this look fine for English, and then leave the RTL-problem for a new bug where someone who knows this can investigate? If it even is a problem, that is.
Flags: needinfo?(odvarko)
Attached image sidebar.png
(In reply to Michael Brennan from comment #39) > By chance I just noticed that when the Toolbox is docked to the right, > things does not look so good. Please see the attached screenshots above. > This is because of Flexbox and it's probably best to just get rid of it. > Then it will look like in the second screenshot. I can't see this issue on my machine (Win10), see the attached screenshot (btw. the side bar can't be thinner). In any case, please file a new bug report and we can discuss how to fix the problem. This bug is already closed. Thanks! Honza
Flags: needinfo?(odvarko)
(In reply to Jan Honza Odvarko [:Honza] from comment #40) > In any case, please file a new bug report and we can discuss how to fix the > problem. This bug is already closed. Sure! I've filed Bug 1358814
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: