Closed Bug 974550 Opened 11 years ago Closed 10 years ago

Add a preference to optionally persist split console state

Categories

(DevTools :: Console, defect, P3)

defect

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 34

People

(Reporter: canuckistani, Assigned: bgrins)

References

Details

Attachments

(1 file, 3 obsolete files)

I noticed in Canary that the split console will reappear on toolbox open if it was previously open. This state is persisted across tabs. I suspect this is something I got from tweaking about:flags I noticed myself missing this recently ( our split console state is not persisted ). What I propose is to expose a new preference: * if the preference is on, every time the user closes or opens the split console this state is stored, and used the next time the toolbox is opened * the preference should be off by default
OS: Mac OS X → All
Priority: -- → P3
Hardware: x86 → All
Version: 26 Branch → Trunk
Also please remember the height of the split console panel after you changed it. Right now the height is reset every time you open devtools to around half of the page height, which is quite big.
(In reply to markus.priewasser from comment #1) > Also please remember the height of the split console panel after you changed > it. Right now the height is reset every time you open devtools to around > half of the page height, which is quite big. You are right, it doesn't remember the height but I think it should. Of course it should still be constrained to the current toolbox size so as to prevent weirdness from: 1) Make devtools really tall (600px) 2) Make split console really tall (500px) 2) Close split console 3) Make devtools short (200px) 4) Open split console (max should still be constrained within 50px or so of the current toolbox height)
See Also: → 1037145
Bug 996778 is opened to remember the height
See Also: → 996778
Attached patch split-console-persist.patch (obsolete) — Splinter Review
Persists the split console state in the toolbox and adds a test for it. Had to change the behavior of toggleSplitConsole a bit to allow changing while console panel is opened to make sure that the state is consistently applied (even if console is the first selected panel). The difference now is if you open the console panel then click the split console button / press escape then the split console state will be updated. We may consider stopping any escape keypress from doing this when the jsterm input is focused (although it will already not do this when closing an autocomplete popup or variables view).
Assignee: nobody → bgrinstead
Status: NEW → ASSIGNED
Attachment #8461054 - Flags: review?(mihai.sucan)
Comment on attachment 8461054 [details] [diff] [review] split-console-persist.patch Review of attachment 8461054 [details] [diff] [review]: ----------------------------------------------------------------- Patch looks good to me. Thanks a lot for your patch! I think that we should avoid allowing the state change while the console tab is active, but I wont block the patch for this change. r+
Attachment #8461054 - Flags: review?(mihai.sucan) → review+
Attached patch split-console-persist.patch (obsolete) — Splinter Review
Thought of a better way to handle this that prevents state change when console is active
Attachment #8461054 - Attachment is obsolete: true
Attachment #8461593 - Flags: review?(mihai.sucan)
Comment on attachment 8461593 [details] [diff] [review] split-console-persist.patch Review of attachment 8461593 [details] [diff] [review]: ----------------------------------------------------------------- Thanks for the update.
Attachment #8461593 - Flags: review?(mihai.sucan) → review+
Attached patch split-console-persist.patch (obsolete) — Splinter Review
I had to make a couple of changes to fix some issues with tests (like https://tbpl.mozilla.org/?tree=Try&rev=69c68ec2baba). The primary change had to do with a leak that was happening in browser_toolbox_sidebar.js. What was happening was that the split console was left opened in a previous test, so it was being opened on startup in toolbox.js. There were two issues factoring into the leak (that I'd like Joe to take a look at): 1) Toolbox.open() was not waiting for toggleSplitConsole to finish (specifically for the webconsole panel to be opened) before resolving. This left a possibility for a leak if the toolbox was quickly closed before the tool had finished loading. 2) gDevTools.showToolbox() was not waiting for toolbox.open() to finish *if* a toolId was passed in. I looked further into this logic and realized that by the time open finishes, the event that it was waiting for (toolId + "-selected") would have already fired anyway - open waits for this event as well. So I simplified this method to always wait for open to finish. Anyway, I went ahead and cleaned up the split console state in the offending test, but I think we should still go with these changes because it is a leak waiting to happen.
Attachment #8461593 - Attachment is obsolete: true
Attachment #8462616 - Flags: review?(jwalker)
Joe, in case I wasn't clear enough - I just need a review on the changes to gDevTools.jsm and the promise changes in toolbox.open / toolbox.toggleSplitConsole
Pretty much the same patch, but with a few changes so that all tests are passing: https://tbpl.mozilla.org/?tree=Try&rev=c9d1f36ce764
Attachment #8462616 - Attachment is obsolete: true
Attachment #8462616 - Flags: review?(jwalker)
Attachment #8463343 - Flags: review?(jwalker)
Comment on attachment 8463343 [details] [diff] [review] split-console-persist.patch Review of attachment 8463343 [details] [diff] [review]: ----------------------------------------------------------------- ::: browser/devtools/framework/toolbox.js @@ +983,2 @@ > */ > + toggleSplitConsole: function(forceToggle = false) { I'm not a huge fan of this function name; wouldn't openSplitConsole be a better name. Maybe this isn't the place to change it though.
Attachment #8463343 - Flags: review?(jwalker) → review+
(In reply to Joe Walker [:jwalker] from comment #11) > Comment on attachment 8463343 [details] [diff] [review] > split-console-persist.patch > > Review of attachment 8463343 [details] [diff] [review]: > ----------------------------------------------------------------- > > ::: browser/devtools/framework/toolbox.js > @@ +983,2 @@ > > */ > > + toggleSplitConsole: function(forceToggle = false) { > > I'm not a huge fan of this function name; wouldn't openSplitConsole be a > better name. Maybe this isn't the place to change it though. It does toggle the console state (which is convenient for a few places, like ESC key and the command button). We could refactor such that there is a closeSplitConsole / openSplitConsole / toggleSplitConsole, where toggleSplitConsole that just does a check on the current state and calls one or the other. Then in the toolbox.open function we could call openSplitConsole instead of toggleSplitConsole with a bool parameter. I can tackle this in 996778 or a separate follow up.
Keywords: checkin-needed
(In reply to Brian Grinstead [:bgrins] from comment #12) > (In reply to Joe Walker [:jwalker] from comment #11) > > Comment on attachment 8463343 [details] [diff] [review] > > split-console-persist.patch > > > > Review of attachment 8463343 [details] [diff] [review]: > > ----------------------------------------------------------------- > > > > ::: browser/devtools/framework/toolbox.js > > @@ +983,2 @@ > > > */ > > > + toggleSplitConsole: function(forceToggle = false) { > > > > I'm not a huge fan of this function name; wouldn't openSplitConsole be a > > better name. Maybe this isn't the place to change it though. > > It does toggle the console state (which is convenient for a few places, like > ESC key and the command button). We could refactor such that there is a > closeSplitConsole / openSplitConsole / toggleSplitConsole, where > toggleSplitConsole that just does a check on the current state and calls one > or the other. Then in the toolbox.open function we could call > openSplitConsole instead of toggleSplitConsole with a bool parameter. I can > tackle this in 996778 or a separate follow up. Ug yes. _refreshConsoleDisplay() applies the state that is setup elsewhere. I'll leave it up to you when you do this.
Blocks: 1045333
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → Firefox 34
Blocks: 996778
Blocks: 1050442
QA Whiteboard: [qa-]
Blocks: 1058167
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: