Closed Bug 1358383 Opened 7 years ago Closed 3 years ago

Add a command history list

Categories

(DevTools :: Console, enhancement, P3)

enhancement

Tracking

(firefox93 fixed)

RESOLVED FIXED
93 Branch
Tracking Status
firefox93 --- fixed

People

(Reporter: sebo, Assigned: claubatista)

References

(Blocks 2 open bugs)

Details

Attachments

(1 file)

There should be the possibility to show all commands and expressions previously executed within the command line and allow to select one of them to add it to the command line again.

Firebug showed the command history by clicking a button on the left side of its command line or by pressing Ctrl+H.[1]

Sebastian

[1] https://getfirebug.com/wiki/index.php/Command_Line#Command_History
Priority: -- → P3
Product: Firefox → DevTools

Partially solved in bug 1024913, but having a visual history would still be nice.

Claudia, would you be interested working on this? It's about a new :history command to add in the console.
I thought it might be a nice fit for you since you were working in this area lately.
Let me know if you'd rather work on something else if this doesn't look appealing / wants to work on a different area/panel :)

Flags: needinfo?(contatodaclau)

(In reply to Nicolas Chevobbe [:nchevobbe] from comment #2)

Claudia, would you be interested working on this? It's about a new :history command to add in the console.
I thought it might be a nice fit for you since you were working in this area lately.
Let me know if you'd rather work on something else if this doesn't look appealing / wants to work on a different area/panel :)

Thank you, Nicolas, it's perfect for me. :)

Flags: needinfo?(contatodaclau)

Nice :) I'm assigning the bug to you then

The command needs to be registered in https://searchfox.org/mozilla-central/rev/cfc40681e13089f92fb3f5f67d5d527fb04d9505/devtools/server/actors/webconsole/commands.js#7
Then I think everything will be handled in the client, so we can take inspiration from the screenshot command for what's needed on the server https://searchfox.org/mozilla-central/rev/cfc40681e13089f92fb3f5f67d5d527fb04d9505/devtools/server/actors/webconsole/utils.js#567-577 (i.e. not much)
We can then handle the server response on the client side, adding a case in this switch https://searchfox.org/mozilla-central/rev/cfc40681e13089f92fb3f5f67d5d527fb04d9505/devtools/client/webconsole/actions/input.js#184
We can see here how we can retrieve the history https://searchfox.org/mozilla-central/rev/cfc40681e13089f92fb3f5f67d5d527fb04d9505/devtools/client/webconsole/middleware/history-persistence.js#23
Then, when we have all the data, we want to display them in a message.

As the history can have many items (that can be quite long), we we can try to render it the same way we render console.table calls, where the first column would be an index, and the second one the expression.

Let me know if you have any question!

Assignee: nobody → contatodaclau
Status: NEW → ASSIGNED
Version: 55 Branch → Trunk

As phabricator says it won't send notification as the patch is a draft, I'm letting you know that I did added some comments on it :)

Flags: needinfo?(contatodaclau)
Attachment #9235640 - Attachment description: WIP: Bug 1358383 - [devtools] Adds a command history list. r=nchevobbe → Bug 1358383 - [devtools] Adds a command history list. r=nchevobbe

Thanks! I updated the patch :)

Flags: needinfo?(contatodaclau)
Attachment #9235640 - Attachment description: Bug 1358383 - [devtools] Adds a command history list. r=nchevobbe → Bug 1358383 - [devtools] Adds a command history list. r=bomsy
Pushed by hmanilla@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/5efed90d556a
[devtools] Adds a command history list. r=bomsy
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 93 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: