Closed Bug 1519103 Opened 11 months ago Closed 2 months ago

Remove Scratchpad panel

Categories

(DevTools Graveyard :: Scratchpad, task, P3)

65 Branch

Tracking

(firefox72 fixed)

RESOLVED FIXED
Firefox 72
Tracking Status
firefox72 --- fixed

People

(Reporter: nchevobbe, Assigned: nchevobbe, NeedInfo)

References

(Depends on 2 open bugs, Blocks 1 open bug)

Details

(Keywords: dev-doc-needed)

Attachments

(1 file)

Bug 1133849 will add a multiline editor mode to the console, which covers the majority of the needs of the scratchpad.
Let's use this bug to remove scratchpad from the codebase.

Quick note that once Scratchpad is removed, we should also be able to remove this sidebar component. I think only Scratchpad uses it now:

/devtools/client/framework/sidebar.js

(and also update this comment https://searchfox.org/mozilla-central/rev/7c20ad925005fbad7b8e08813115f1ec7fa1c248/devtools/client/inspector/toolsidebar.js#12-21

Type: enhancement → task
Priority: -- → P3

Harald, as this is getting closer to be doable, should we have a notification message saying the tool will be removed soon?
I know we did that for the other deleted tools (webaudio, …), so maybe we want to have a similar approach here.

Flags: needinfo?(hkirschner)
Depends on: 1565380

Great point Nicolas, doing it early will allow us to consider more feedback and validate some of the ideas mentioned in f2f discussions. Filed 1565380 for discussing details.

Flags: needinfo?(hkirschner)
Depends on: 1584259
Depends on: 1584262

According to MDN ( https://developer.mozilla.org/en-US/docs/Tools/Deprecated_tools#Scratchpad ), the scratchpad will be removed from 71.

With soft freeze and a version bump around the corner, is this milestone still accurate? If not, please update the deadline on MDN (maybe with a reference to the bug that is responsible for the ultimate removal of the code).

Updated the MDN page and added a reference to this bug. Thanks Rob!

No longer depends on: 1584262
Blocks: 1591360
Assignee: nobody → nchevobbe
Status: NEW → ASSIGNED
Blocks: 1591404

Hi!
I don't know if this is the right place for this, but you've asked for feedback, so here's mine.
As I understand the console does not allow such things as "focus" or "click" which I use for testing my webpage and which is possible in Scratchpad. How can I do this in future?

Pushed by nchevobbe@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/5e129785c966
Remove Scratchpad panel. r=bgrins.

(In reply to Samuel from comment #7)

Hi!
I don't know if this is the right place for this, but you've asked for feedback, so here's mine.
As I understand the console does not allow such things as "focus" or "click" which I use for testing my webpage and which is possible in Scratchpad. How can I do this in future?

Hello Samuel,

I'm not sure I understand?

If I go to data:text/html,<meta charset=utf8><button onclick="alert('click')">Click</button>, open the console, and execute document.querySelector("button").click(), I will trigger the onclick function.
Are you talking about something different?

Also if you're looking in automated testing, you might want to have a look at https://firefox-puppeteer.readthedocs.io/en/master/ :)

Flags: needinfo?(samuelf)
Blocks: 1591874
Status: ASSIGNED → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 72

In documentation on Alternatives for deprecated Scratchpad there is a screenshot showing Run pane in Web Console to the left of REPL.

https://developer.mozilla.org/en-US/docs/Tools/Deprecated_tools#Scratchpad

Editing multiline code does not bring this Run pane on Firefox 70. Where to find it?

(In reply to Anatoli Babenia from comment #11)

In documentation on Alternatives for deprecated Scratchpad there is a screenshot showing Run pane in Web Console to the left of REPL.

https://developer.mozilla.org/en-US/docs/Tools/Deprecated_tools#Scratchpad

Editing multiline code does not bring this Run pane on Firefox 70. Where to find it?

Hello Anatoli, the editor mode wil lbe enabled in 71. You can try it right now on Firefox Beta or Firefox DevEdition :)
I'll mention that on the MDN page to make it clearer.

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

(In reply to Anatoli Babenia from comment #11)

In documentation on Alternatives for deprecated Scratchpad there is a screenshot showing Run pane in Web Console to the left of REPL.

https://developer.mozilla.org/en-US/docs/Tools/Deprecated_tools#Scratchpad

Editing multiline code does not bring this Run pane on Firefox 70. Where to find it?

Hello Anatoli, the editor mode wil lbe enabled in 71. You can try it right now on Firefox Beta or Firefox DevEdition :)
I'll mention that on the MDN page to make it clearer.

That description wasn't clear to me even when applied to newer Firefox versions. It says:

If the JavaScript code you enter in the Console can be interpreted as the beginning of a multi-line statement, the Enter key adds a new line in the input, and you can evaluate the expression using Ctrl + Enter (Cmd + Enter on macOS).

but this doesn't work that way for me on macOS. I need to explicitly enable the multi-line editor by clicking on its button in the console, just entering code that "can be interpreted as the beginning of a multi-line statement" only makes Enter not evaluate the code immediately but it doesn't open the dedicated multi-line editor. The description suggests this works differently.

Hello Michał, I updated the MDN page to make it clearer.

Why is Scratchpad being removed? --I didn't see a reason.
This tool is very useful when I want to test a full script because of the space I have available and being able to see the page and the full console and/or any other panel.

The proposed alternative would force me to have the Dev Tools in a separate window and would
a) prevent me from seeing another panel, and
b) significantly reduce the workspace / console output.

Ralph, I understand that we'll never cover 100% of use cases Scratchpad supported.

In your case, would split console with multi-line input in a undocked devtools tab support a) and b)?

For what it's worth I've got to admit this won't suite my use case very well. But I'm unsure how you could unless I could spawn a console in a detached window that's separate from the console in the main devtools. I tend to use scratchpad as an actual (code) scratchpad. I realise this might not be what it was designed for but it's very handy for that use. I've tried getting used to using it within devtools but I find it much more awkward and it gets in the way of actually using the devtools for their main purpose.

Sorry to hear, Chris. I see how split console isn't as clean as its own window, but could you explain a bit how devtools gets in the way, please?

Flags: needinfo?(christophersdenton)

To explain what I mean, I think I need to recap how I use scratchpad. Scratchpad opens in a separate window. It's not dependent on any particular tab but can run in the context of the selected tab. You can have multiple windows open and they will behave the same way. This is great for two things:

  1. Playing around with code independent of any particular web page or tab. Like a true Javascript scratchpad.
  2. Longer lived ideas that are connected to page/site but that I either want to persist between tabs or I simply want to keep around for later use.

The devtools console I use for:

  1. Shorter lived ideas focusing on an immediate task in a particular tab. I usually don't mind if it disappears when I close the tab because my task's done.

So when I say the devtools console "gets in the way" I mean that if I try using it as a substitute for task 1 or 2 (long lived tasks) it gets in the way of using it for 3 (short lived tasks). The best I can do at the moment is manually open a new tab (remembering to keep it open) then detach a devtools console window, switch to multiline mode and expand the editor area. Then if I do want to run in the context of a tab, I can copy/paste between the two editors. This isn't ideal but it's the closest I can manage to emulate scratchpad.

As I said, I'm not sure how my use case could be supported other than allowing consoles that are detached from any tab. And I'm not claiming this use case deserves any special attention, maybe I'm an extreme outlier. And perhaps task 1 would be better served by another application, not Firefox.

In short, my one line summary would be that, for me, devtools console is for temporary tab-dependent tasks whereas scratchpad is for more persistent and tab-independent tasks.

Flags: needinfo?(christophersdenton)

I'm not sure how my use case could be supported

Having said that, after searching it seems something similar to Chrome's Snippets would partially cover my use case, even though it's not a full replacement. I've not used it though.

Bug 1592308 added save/load for files, which gets you halfway there maybe. Having in-browser persistence is on the map as well, but initial surveys showed that devs prefer to have files on their drives and use existing services like Dropbox & co to manage their snippets.

Product: DevTools → DevTools Graveyard
You need to log in before you can comment on or make changes to this bug.