Closed
Bug 1311591
Opened 9 years ago
Closed 9 years ago
Implement clear button for Net Panel Toolbar
Categories
(DevTools :: Netmonitor, defect, P1)
DevTools
Netmonitor
Tracking
(firefox52 verified)
| Tracking | Status | |
|---|---|---|
| firefox52 | --- | verified |
People
(Reporter: rickychien, Assigned: gasolin)
References
(Blocks 1 open bug)
Details
(Whiteboard: [netmonitor])
Attachments
(1 file, 1 obsolete file)
Follow-up for bug 1309191 to focus on implementing clear button.
Updated•9 years ago
|
Flags: qe-verify?
Whiteboard: [netmonitor] → [netmonitor] [triage]
Updated•9 years ago
|
Flags: qe-verify? → qe-verify+
Priority: -- → P2
QA Contact: ciprian.georgiu
Whiteboard: [netmonitor] [triage] → [netmonitor]
Updated•9 years ago
|
Summary: Implement clear buttons for Net Panel Toolbar → Implement clear button for Net Panel Toolbar
| Assignee | ||
Updated•9 years ago
|
Assignee: nobody → gasolin
Status: NEW → ASSIGNED
| Comment hidden (mozreview-request) |
Updated•9 years ago
|
Iteration: --- → 52.3 - Nov 7
Priority: P2 → P1
| Comment hidden (mozreview-request) |
| Assignee | ||
Comment 3•9 years ago
|
||
The WIP converted clear button to react, the next patch will use `CLEAR_REQUESTS` action and the `requests` reducer to replace the requestsMenu.clear method.
| Comment hidden (mozreview-request) |
| Comment hidden (mozreview-request) |
| Comment hidden (mozreview-request) |
| Comment hidden (mozreview-request) |
Comment 8•9 years ago
|
||
| mozreview-review | ||
Comment on attachment 8803772 [details]
Bug 1311591 - Implement clear button for Net Panel Toolbar;
https://reviewboard.mozilla.org/r/87918/#review86924
::: devtools/client/netmonitor/toolbar-view.js:33
(Diff revision 3)
>
> + this._clearContainerNode = $("#react-clear-button-hook");
> this._filterContainerNode = $("#react-filter-buttons-hook");
>
> + // clear button
> + ReactDOM.render(button({
Unmount this component in destroy().
::: devtools/client/netmonitor/toolbar-view.js:39
(Diff revision 3)
> + ref: (node) => {
> + node && node.setAttribute("tooltiptext",
> + L10N.getStr("netmonitor.toolbar.clear"));
> + }
Replace this with a simple "title" attribute for the <button> element.
::: devtools/client/themes/toolbars.css:55
(Diff revision 3)
> padding: 0;
> border-width: 0;
> border-bottom-width: 1px;
> border-style: solid;
> height: 24px;
> - line-height: 24px;
> + line-height: -moz-block-height;
What does this style change do? It's a global CSS rule that affects all devtools-toolbar/devtools-sidebar-tabs components, so it can potentially break things outside Netmonitor.
Attachment #8803772 -
Flags: review?(jsnajdr) → review-
Comment 9•9 years ago
|
||
| mozreview-review | ||
Comment on attachment 8803779 [details]
Bug 1311591 - Convert RequestsMenu.clear to redux action/reducer;
https://reviewboard.mozilla.org/r/87936/#review86928
::: devtools/client/netmonitor/reducers/requests.js:14
(Diff revision 3)
> +/**
> + * Removes all network requests and closes the sidebar if open.
> + */
> +function clearRequests() {
> + NetMonitorController.NetworkEventsHandler.clearMarkers();
> + NetMonitorView.Sidebar.toggle(false);
> +
> + $("#details-pane-toggle").disabled = true;
> + $("#requests-menu-empty-notice").hidden = false;
> +
> + NetMonitorView.RequestsMenu.empty();
> + NetMonitorView.RequestsMenu.refreshSummary();
> + return new Requests();
> +}
No, this is wrong. Reducer must be a pure function without side effects. It's only allowed to transform the state and return a new one.
Side effects like toggling a sidebar or emptying the request list must be handled by subscribing to the store updates.
I think that introducing a redux action in this bug is not a good idea - it just introduces a lot of boilerplate code that doesn't do anything. There is no state to store - the "Requests" field is a dummy noop - and therefore no state changes to react to.
Let's postpone implementing the "clear" action to bug 1309866. That bug introduces a real requests list into the Redux store.
Attachment #8803779 -
Flags: review?(jsnajdr) → review-
| Assignee | ||
Comment 10•9 years ago
|
||
| mozreview-review-reply | ||
Comment on attachment 8803772 [details]
Bug 1311591 - Implement clear button for Net Panel Toolbar;
https://reviewboard.mozilla.org/r/87918/#review86924
> Unmount this component in destroy().
nice catch!
> Replace this with a simple "title" attribute for the <button> element.
good to know that
> What does this style change do? It's a global CSS rule that affects all devtools-toolbar/devtools-sidebar-tabs components, so it can potentially break things outside Netmonitor.
I'll replace this fix to a separate #react-clear-button-hook style in netmonitor.css
| Comment hidden (mozreview-request) |
| Assignee | ||
Updated•9 years ago
|
Attachment #8803779 -
Attachment is obsolete: true
Comment 12•9 years ago
|
||
| mozreview-review | ||
Comment on attachment 8803772 [details]
Bug 1311591 - Implement clear button for Net Panel Toolbar;
https://reviewboard.mozilla.org/r/87918/#review87046
::: devtools/client/themes/netmonitor.css:10
(Diff revision 4)
> +#react-clear-button-hook {
> + line-height: -moz-block-height;
> +}
Looks good, but this style change is still worth explaining.
Comment 13•9 years ago
|
||
(In reply to Jarda Snajdr [:jsnajdr] from comment #12)
> > +#react-clear-button-hook {
> > + line-height: -moz-block-height;
> > +}
>
> Looks good, but this style change is still worth explaining.
Hmmm, there is a mysterious 3px whitespace above the clear button, I have no idea where it comes from.
Setting display:flex on the #react-clear-button-hook element is a better fix than line-height - the clear button is vertically centered then.
| Assignee | ||
Comment 14•9 years ago
|
||
| mozreview-review-reply | ||
Comment on attachment 8803772 [details]
Bug 1311591 - Implement clear button for Net Panel Toolbar;
https://reviewboard.mozilla.org/r/87918/#review87046
> Looks good, but this style change is still worth explaining.
The style change is to fix the extra hight when we add extra html:div as react component's hook point
Comment 15•9 years ago
|
||
| mozreview-review | ||
Comment on attachment 8803772 [details]
Bug 1311591 - Implement clear button for Net Panel Toolbar;
https://reviewboard.mozilla.org/r/87918/#review87278
r+ if the CSS rule for centering the clear button gets fixed and if try is green.
Attachment #8803772 -
Flags: review?(jsnajdr) → review+
| Comment hidden (mozreview-request) |
| Assignee | ||
Comment 17•9 years ago
|
||
`display:flex` works well, thanks for suggestion!
try is green
Keywords: checkin-needed
Comment 18•9 years ago
|
||
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/fc6654e17667
Implement clear button for Net Panel Toolbar;r=jsnajdr
Keywords: checkin-needed
Comment 19•9 years ago
|
||
| bugherder | ||
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
status-firefox52:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 52
Comment 20•9 years ago
|
||
I can confirm the clear button works accordingly. I verified using Fx 52.0a1 (20161108030212).
Updated•7 years ago
|
Product: Firefox → DevTools
You need to log in
before you can comment on or make changes to this bug.
Description
•