Closed Bug 996778 Opened 10 years ago Closed 10 years ago

Remember split console height

Categories

(DevTools :: Framework, defect, P3)

30 Branch
x86
macOS
defect

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 34

People

(Reporter: jonathan, Assigned: bgrins)

References

Details

Attachments

(1 file, 2 obsolete files)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:30.0) Gecko/20100101 Firefox/30.0 (Beta/Release)
Build ID: 20140411004002

Steps to reproduce:

Open dev tools in inspector in a page, and open split console. Notice the split is too large, reduce the size.

Open another tab and inspector, open split console.


Actual results:

Split console is a default height


Expected results:

Preferred height is recalled
Component: Untriaged → Developer Tools: Framework
Status: UNCONFIRMED → NEW
Ever confirmed: true
Priority: -- → P3
See Also: → 974550
Depends on: 974550
Depends on: 1045333
Assignee: nobody → bgrinstead
Status: NEW → ASSIGNED
Attached patch split-console-height.patch (obsolete) — Splinter Review
This patch remembers the split console height while resizing (so it will be set when opening toolbox in a new tab), and when destroying the toolbox.
Attachment #8464698 - Flags: review?(mihai.sucan)
Attached patch split-console-height.patch (obsolete) — Splinter Review
Same patch, but with a Math.round() call in the test.  Pushed to try: https://tbpl.mozilla.org/?tree=Try&rev=01e3bc6c4ca3
Attachment #8464698 - Attachment is obsolete: true
Attachment #8464698 - Flags: review?(mihai.sucan)
Attachment #8464822 - Flags: review?(mihai.sucan)
Comment on attachment 8464822 [details] [diff] [review]
split-console-height.patch

Review of attachment 8464822 [details] [diff] [review]:
-----------------------------------------------------------------

This is looking good. Thanks. Just some minor comments:

::: browser/devtools/framework/toolbox.js
@@ +257,5 @@
>          this._loadInitialZoom();
>  
> +        this.webconsolePanel = this.doc.getElementById("toolbox-panel-webconsole");
> +        this.webconsolePanel.height =
> +          Services.prefs.getIntPref("devtools.toolbox.splitconsoleHeight");

Might want to add a PREF_... constant for the pref name.

@@ +355,5 @@
>    },
>  
> +  _saveSplitConsoleHeight: function() {
> +    Services.prefs.setIntPref("devtools.toolbox.splitconsoleHeight",
> +      this.doc.getElementById("toolbox-panel-webconsole").height);

Why not use this.webconsolePanel directly?

::: browser/devtools/webconsole/test/browser_webconsole_split_persist.js
@@ +21,5 @@
>      yield toggleSplitConsoleWithEscape();
>      ok(toolbox.splitConsole, "Split console is now visible.");
> +    ok(getVisiblePrefValue(), "Visibility pref is true");
> +
> +    let splitConsolePanel = toolbox.doc.getElementById("toolbox-panel-webconsole");

Why not use toolbox.webconsolePanel?

@@ +35,5 @@
>  
>      ok(toolbox.splitConsole, "Split console is visible by default.");
> +    is(getHeightPrefValue(), 200, "Height is set based on panel height after closing");
> +
> +    let splitConsolePanel = toolbox.doc.getElementById("toolbox-panel-webconsole");

Same here. Also the variable is already defined - you might want to remove |let| here.
Attachment #8464822 - Flags: review?(mihai.sucan) → review+
Thanks for the feedback - this patch addresses your comments.  Try push: https://tbpl.mozilla.org/?tree=Try&rev=7f73dea49e37
Attachment #8464822 - Attachment is obsolete: true
Attachment #8465497 - Flags: review+
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/071ac392b4fb
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → Firefox 34
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: