Bug 1572689 - Properly restore size of the Search panel; r=nchevobbe
authorJan Odvarko <odvarko@gmail.com>
Fri, 16 Aug 2019 06:18:16 +0000
changeset 488469 f96d420517972051aeb08355243e6d7b081c4b94
parent 488468 c670f40348ee7794f031ef7f84019592d56154cd
child 488470 09ce6041df3bc1451e914a84f9b8e742c2f294de
push id92766
push userjodvarko@mozilla.com
push dateFri, 16 Aug 2019 09:15:16 +0000
treeherderautoland@f96d42051797 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnchevobbe
bugs1572689
milestone70.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1572689 - Properly restore size of the Search panel; r=nchevobbe Differential Revision: https://phabricator.services.mozilla.com/D41936
devtools/client/netmonitor/src/components/MonitorPanel.js
--- a/devtools/client/netmonitor/src/components/MonitorPanel.js
+++ b/devtools/client/netmonitor/src/components/MonitorPanel.js
@@ -153,82 +153,79 @@ class MonitorPanel extends Component {
     // while depending on orientation ONLY ONE dimension is managed by it at a time.
     const { isVerticalSpliter } = this.state;
     return this.props.onNetworkDetailsResized(
       isVerticalSpliter ? width : null,
       isVerticalSpliter ? null : height
     );
   }
 
-  renderSearchPanel(connector) {
-    const { isEmpty } = this.props;
+  renderSearchPanel() {
+    const { connector, isEmpty, panelOpen } = this.props;
+
     const initialWidth = Services.prefs.getIntPref(
       "devtools.netmonitor.panes-search-width"
     );
     const initialHeight = Services.prefs.getIntPref(
       "devtools.netmonitor.panes-search-height"
     );
+
     return SplitBox({
       className: "devtools-responsive-container",
       initialWidth,
       initialHeight,
       minSize: "50px",
       maxSize: "80%",
-      splitterSize: 1,
-      startPanel: SearchPanel({
-        ref: "searchPanel",
-        connector,
-      }),
+      splitterSize: panelOpen ? 1 : 0,
+      startPanel:
+        panelOpen &&
+        SearchPanel({
+          ref: "searchPanel",
+          connector,
+        }),
       endPanel: RequestList({ isEmpty, connector }),
       endPanelControl: false,
       vert: true,
-      onControlledPanelResized: () => {},
     });
   }
 
   render() {
     const {
       actions,
       connector,
-      isEmpty,
       networkDetailsOpen,
       openLink,
       openSplitConsole,
       sourceMapService,
-      panelOpen,
     } = this.props;
 
     const initialWidth = Services.prefs.getIntPref(
       "devtools.netmonitor.panes-network-details-width"
     );
 
     const initialHeight = Services.prefs.getIntPref(
       "devtools.netmonitor.panes-network-details-height"
     );
 
-    const startPanel = panelOpen
-      ? this.renderSearchPanel(connector)
-      : RequestList({ isEmpty, connector });
-
     return div(
       { className: "monitor-panel" },
       Toolbar({
         actions,
         connector,
         openSplitConsole,
         singleRow: this.state.isSingleRow,
       }),
       SplitBox({
         className: "devtools-responsive-container",
-        initialWidth: initialWidth,
-        initialHeight: initialHeight,
+        initialWidth,
+        initialHeight,
         minSize: "50px",
         maxSize: "80%",
         splitterSize: networkDetailsOpen ? 1 : 0,
-        startPanel,
+        startPanel: this.renderSearchPanel(),
         endPanel:
           networkDetailsOpen &&
           NetworkDetailsPanel({
             ref: "endPanel",
             connector,
             openLink,
             sourceMapService,
           }),