Closed Bug 1519103 Opened 6 years ago Closed 5 years 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)

References

(Depends on 1 open bug)

Details

(Keywords: dev-doc-complete)

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?

(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: 5 years 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

I lament the loss of Scratchpad. Any way we could decouple the new mutli-line editor from the window? I also loved having it in a completely separate window as Chris above - it just makes things so much easier. Why remove functionality? Does this also change Firefox Browser Developer Edition?

Hi!

As a developer of userscripts (scripts working with Greasemonkey, Violentmonkey, etc. add-ons) and sometimes a webdeveloper I wanted to enumerate things I miss from Scratchpad and write few other comments:

  • I'd like to be able to use console (in multiline mode) while viewing webpage in an Inspector or while watching it's Storage.
  • ALT + TAB was more convenient for switching beetween Scratchpad and and content window. Now I need to detach tools first. However when I use Inspector, it is more convenient to have it attached, so it won't block view of a webpage. At least I found that there is CTRL+SHIFT+D shortcut which can be used to attach/detach (as it toggles between two recently used docking modes) - and which I try to use in combination with CTRL+SHIFT+I, CTRL+SHIFT+C, CTRL+SHIFT+K, CTRL+B (in devtools panel) and up/down arrows.
  • Accidental closing (for example by using CTRL+SHIFT+I or F12 key (which can happen if you work on 2 or 3 displays connected to a computer and detached devtools) leads to loosing contents of editor if it wasn't saved or executed :-( Scratchpad would warn/ask if I want to save before closing and reopened editor windows after restarting browser.
  • I miss hints about parameters of functions (in particular their order)
  • ...and ability to run only selected part of code - especially with results returned as a comment (CTRL+L in Scratchpad).
  • Running same code in multiple tabs was easier - now, console seems to keep separate history for each tab (at least to the moment of closing and reopening it) - so now I need to do more ALT+TABs and CTRL+A, CTRL+C and CTRL+V or CTRL+W, CTRL+SHIFT+K, CTRL+B, up arrow, CTRL+B to perform same tasks
  • Working with multiple Scratchpad windows over one tab (or Scrachpad + console for testing simpler/shorter snippets) is also something I miss.
  • The icon on button to switch from multiline to single line mode (X), doesn't seem to be consistent with icon to make an opposite switch.

Maybe there are some solutions to those problems - I will be grateful for pointing them out to me :-)

I think, that detaching just console in multiline mode, independently to the rest of devtools, and ability to have multiple instances of console for one browser's tab, would solve some of my problems.

Some thoughts that I hope help:

I'd like to be able to use console (in multiline mode) while viewing webpage in an Inspector or while watching it's Storage.

Not perfect, but split console covers most of that.

I miss hints about parameters of functions (in particular their order)

We are working on that one, as part of our eager evaluation work.

...and ability to run only selected part of code - especially with results returned as a comment (CTRL+L in Scratchpad).

We started on some UX for that but didn't have a bug, so I filed bug 1611315.

Accidental closing (for example by using CTRL+SHIFT+I or F12 key (which can happen if you work on 2 or 3 displays connected to a computer and detached devtools) leads to loosing contents of editor if it wasn't saved or executed :-( Scratchpad would warn/ask if I want to save before closing and reopened editor windows after restarting browser.

Would be a good quality of life improvement to keep the content of the editor alive between openings.

Thanks for comment and advices.

Split console - I forgot about it (I think that there was icon/button for that, which disappeared from my devtools toolbar, so I thought that whole feature was removed) - but it is still there - accessible with "Esc" key and appropriate item in "..." menu. Not so convenient as a separate window, but better than none.
Running only selected lines of code - works indeed (with Ctrl+Enter), so this one is solved for me.

Looking forward to introducing the rest of Scratchpad's functionalities and features in console :-)

Flags: needinfo?(samuelf)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: