Closed Bug 1565380 Opened 5 months ago Closed 4 months ago

Add deprecation warning to Scratchpad

Categories

(DevTools Graveyard :: Scratchpad, task, P3)

Tracking

(firefox70 fixed)

RESOLVED FIXED
Firefox 70
Tracking Status
firefox70 --- fixed

People

(Reporter: Harald, Assigned: nchevobbe)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

As bug 1133849 is in MVP state and enabled in Nightly, we should warn Scratchpad users that Console's new editor mode will replace Scratchpad, to have a chance of capturing feedback. The warning should at be shown for 1-2 releases before removing Scratchpad, so users can migrate to editor mode and provide feedback on critical feature gaps.

With the warning, we should also send out an email to Firefox engineering mailing lists to make the internal audience aware, some of which are Scratchpad enthusiasts.

Priority: -- → P3

I feel like we should do that in the next days. What's the timeline for the removal?

Flags: needinfo?(hkirschner)

I would suggest a preliminary removal in 71, which allows us to bake the Editor mode for 1 release and follow up with any critical patches and minor feature work. The UI could be a combo of the work in bug 1527294 (for the settings page) and bug 1538632 (yellow bar in the panel).

Flags: needinfo?(hkirschner)
Flags: needinfo?(hkirschner)

Harald, would you have good wording for the deprecation warning inside the Scratchpad panel.
I was going with:

Scratchpad will be disabled in release 71. The WebConsole now has a multiline-input mode that should cover most of the use-case you had in Scratchpad.

But not sure it's good enough.

This patch contains 2 parts:

  • First one is adding a label + icon in the settings panel next to
    the Scratchpad tool entry. This is mainly re-adding what was done
    for Bug 1527294.
  • Second is adding a deprecation warning message in the Scratchpad
    panel. This is using the NotificationBox that is already used in
    the panel.

Both have a link to the deprecated tools MDN page, in which we'll add
a Scratchpad section soon.

let's have a simple message in the UI, we'll add more information on the MDN page we link to from the deprecation messages.

Assignee: nobody → nchevobbe
Status: NEW → ASSIGNED
Flags: needinfo?(hkirschner)
Pushed by nchevobbe@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/12326ee40169
Add a deprecation warning message to Scratchpad. r=jdescottes.
Status: ASSIGNED → RESOLVED
Closed: 4 months ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 70

to have a chance of capturing feedback

I’m not sure where you would want this, so this might be the wrong place for it.

However, with the deprecation now being there, I would like to repeat my arguments in favor of Scratchpad that I have previously shared on Twitter:

There are several things that make Scratchpad very valuable to me: Apart from saving and loading from filesystem, I also often execute the selected lines only. The thing most important to me though is that it is separate from a content tab. I often start writing a script while browsing around, looking up things and even testing things in the console of different tabs, to fine tune the script I work on. So it wouldn't be helpful if the script only applied to a single tab or if it would occupy the console itself. And finally, when I have a script, I often want to run this against multiple open tabs. So my workflow usually involves going through tabs and switching to Scratchpad in between, executing the script on each tab – without having to open the dev tools each time.

While the new console editor is nice, it is not able to replace Scratchpad for me personally at all. I use Scratchpad as some kind of REPL to develop scripts and tools that are independent of a single tab or console session. It is very critical to me that I can work on it and execute it easily without having to sacrifice the page-related developer tools at the same time. And I want to easily run the same script on multiple tabs, without having to open the dev tools on each page and paste the code in from another external source.

Also, loading and saving existing scripts is a very important feature that is still completely missing from the console. Without it, I’m not sure how the console editor can even be considered a replacement for the scratchpad.

Btw. I personally use a lot of scratchpad scripts as a kind-of bookmarklet, without it being super crippled from the restrictions that bookmarklets have. There is nothing else that can really replace this right now.

I would really like you to reconsider removing Scratchpad. I understand that keeping features alive that are only used by a smaller number of (power) users is difficult but at the same time these are features that personally make Firefox so much more valuable to me than the competitors.

I appreciate that you re-iterate your case! I understand the frustration, given how tightly your use case integrates with what Scratchpad currently does.

I understand that keeping features alive that are only used by a smaller number of (power) users is difficult but at the same time these are features that personally make Firefox so much more valuable to me than the competitors.

Just to add some background: Scratchpad is the sole user of several legacy components that need to be removed to unblock major refactoring happening in Firefox's frontend. Given the usage numbers we can make a case for investing in rewriting scratchpad. We did interview some Scratchpad fans internal and externally, which has informed the multi-line mode – which was also already in our backlog as often-requested Firebug feature.

Also, loading and saving existing scripts is a very important feature that is still completely missing from the console. Without it, I’m not sure how the console editor can even be considered a replacement for the scratchpad.

Save/Load is one of the next features that we would like to bring back, as it also is covered well by Chrome's snippets. If we design it with your use case in mind, it still would not be a perfect replacement but support your workflow. Another workaround would be creating an extension provides a similar cross-tab REPL flow.

We will keep an eye on our feedback channels to see if other use cases show up as well.

I use Scratchpad as some kind of REPL to develop scripts and tools that are independent of a single tab or console session

Did you try to use the Browser Console (See on MDN )?
It is not tied to a tab, but to the whole Firefox window, so maybe that could help you here.

I wonder if we could somehow override keyboard shortcut Ctrl+S and Ctrl+O as a way to be able to load and save scripts, maybe behind a setting?

Or we could add those in the Editor toolbar (again, behind a setting), with simple icons (I think we have enough room for that? not sure)

This might help until we have a proper snippets manager.

(In reply to :Harald Kirschner :digitarald from comment #9)

Just to add some background: Scratchpad is the sole user of several legacy components that need to be removed to unblock major refactoring happening in Firefox's frontend.

And that’s great! I love that you guys keep working on this and improve so much legacy things. I especially like how the whole Rust development has given Firefox the chance to swap out major components with modern Rust implementations to improve things. So don’t feel discouraged by my feedback at all – I just wish that the development would leave out fewer features :)

Given the usage numbers we can make a case for investing in rewriting scratchpad.

That would be really awesome; I think further empowering the browser console in that direction would be pretty nice already.

Save/Load is one of the next features that we would like to bring back, as it also is covered well by Chrome's snippets. If we design it with your use case in mind, it still would not be a perfect replacement but support your workflow. Another workaround would be creating an extension provides a similar cross-tab REPL flow.

Extensions, at least to my knowledge, have the problem that access to the file system is pretty limited. For example, user script extensions like Greasemonkey all store user scripts within their database, making it really difficult to interact with those scripts externally. That is one thing in particular that I liked about how I could just open and save script files directly in my file system without being limited to the limited locations extensions have access to.

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

Did you try to use the Browser Console?

I used the browser console a lot in the past but seriously didn’t realize that it could access the current tab directly. Apparently it does that, so that would already cover my “external editor window” use case then. Cool!

I wonder if we could somehow override keyboard shortcut Ctrl+S and Ctrl+O as a way to be able to load and save scripts, maybe behind a setting?

Or we could add those in the Editor toolbar (again, behind a setting), with simple icons (I think we have enough room for that? not sure)

Is there a reason why this isn’t being considered as a full and default feature for the console editor? I mean why hide it behind keyboard shortcuts or settings? There’s a lot of room still available next to the “Run” button and having load/save functionality there would further improve the capabilities of the editor.

Looking at Chrome’s snippets tool (I didn’t know that one before), I could also imagine the console editor to have some kind of drop-down button menu (instead of Chrome’s snippet sidebar) to select a stored snippet. And the snippets could then be simple script files at some default location within the profile for example.

That would be really awesome; I think further empowering the browser console in that direction would be pretty nice already.

Yes, the investment would go into general use feature that reach more users, and not into an optional panel where they are not being found when needed.

Is there a reason why this isn’t being considered as a full and default feature for the console editor?

After shipping the first version, we'll try to get more people into it. As soon as devs start writing multiple lines, editor mode should make more sense for them. Data shows though that most evaluate single lines; so we have to see if editor changes that behavior.

Looking at Chrome’s snippets tool (I didn’t know that one before), I could also imagine the console editor to have some kind of drop-down button menu (instead of Chrome’s snippet sidebar) to select a stored snippet.

Yes, that it what we imagined as simple UI solution. The balance would be if those are stored in the browser or a history of last-opened script files – or both. We would also pick one of those solutions to implement first.

Like Patrick Westerhoff, I use Firefox's Scratchpad editor almost every day and the ability to save scripts to filesystem and run them later without going through a lot of hoops is critical for me as a Web Developer. And more importantly the devtools' console just can't fill me use case at all, so if you do wind up removing scratchpad please at least create an addon that provides the same features, because with scratchpad I can save a script on one of my computers and have Dropbox sync that file to another computer and just pick up where I left off earlier with barely any difficulty.

(In reply to Patrick Westerhoff from comment #11)
Is there a reason why this isn’t being considered as a full and default feature for the console editor? I mean why hide it behind keyboard shortcuts or settings? There’s a lot of room still available next to the “Run” button and having load/save functionality there would further improve the capabilities of the editor.

A "lot of room" for one might be limited for other with smaller screens, devtools docked to a side, people with different locales where label are longer, and so on.
We are trying our best to find the right balance between usefulness and simplicity. Adding save/load buttons would impact all users, while we suspect this to be only used by a fraction of people, and only from time to time (I depends a lot on what people are used to, for sure).

I use Firefox's Scratchpad editor almost every day and the ability to save scripts to filesystem and run them later without going through a lot of hoops is critical for me as a Web Developer. And more importantly the devtools' console just can't fill me use case at all, so if you do wind up removing scratchpad please at least create an addon that provides the same features, because with scratchpad I can save a script on one of my computers and have Dropbox sync that file to another computer and just pick up where I left off earlier with barely any difficulty.

If we add the snippet UI we were discussing about, and that those snippets would be synced with your Firefox account, would that be enough? or are you expecting to really be able to write files to disk, and if so, could you tell us the reason? Thanks!

Flags: needinfo?(ngranger.tech)

Regarding the snippets idea, I'd like the ability to alter the files outside of using Firefox, especially if I want to manually reference them in a web page I'm building (just to give an example), but mostly so I have as much control as possible about the files and their placement on my various computers without having to use a Firefox Account to access them.

Flags: needinfo?(ngranger.tech)

Additionally, I was thinking that a more options button on the Browser Console tab could resolve the space issue mentioned earlier in this bug thread.

(In reply to @Ngranger_Tech from comment #15)

Regarding the snippets idea, I'd like the ability to alter the files outside of using Firefox, especially if I want to manually reference them in a web page I'm building (just to give an example), but mostly so I have as much control as possible about the files and their placement on my various computers without having to use a Firefox Account to access them.

Noted, thanks for your feedback

Thanks a lot for the feedback, the details in your use case help a lot!

without having to use a Firefox Account to access them.

When I read your first comment, FxA and sync was the first solution that came to mind to me as well. What would be the downsides of syncing snippets via FxA – beyond physical access?

Flags: needinfo?(ngranger.tech)

Well lately one of my Firefox installations has been having long freezes on the bookmarking/syncing system which could affect the accessing of snippets unless the Firefox Account website portal would allow for manual copy & paste or download options. But mostly I'd require physical access to the files, so I could open them in an editor of my choice (e.g. VS Code) and I have around 50 plus saved scratchpad files.

Flags: needinfo?(ngranger.tech)

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

A "lot of room" for one might be limited for other with smaller screens, devtools docked to a side, people with different locales where label are longer, and so on.
We are trying our best to find the right balance between usefulness and simplicity. Adding save/load buttons would impact all users, while we suspect this to be only used by a fraction of people, and only from time to time (I depends a lot on what people are used to, for sure).

Fair enough, although I would argue that with the editor enabled, you are already splitting the console window in half, so having it docked to the side will already make it difficult to work with it. If you now add to that that you would usually write longer scripts in the editor (i.e. longer than one or two lines), then you probably want it to be much wider than 20 characters anyway. And at ~40 characters, there’s already enough space for another button or two.

And I think you could even put all these file-related buttons into some “File” drop down menu that offers load, save, and maybe recent files, without having to impact the available space in that bar too much.

If we add the snippet UI we were discussing about, and that those snippets would be synced with your Firefox account, would that be enough? or are you expecting to really be able to write files to disk, and if so, could you tell us the reason? Thanks!

I would personally prefer writing to the disk over using the Firefox account. Mainly for two reasons:

  1. Having a physical file allows me to edit the file using an external editor, e.g. VS Code, which will offer me an additional editing experience. It also allows me to use things like version control with Git to properly version my scripts.
  2. I may want to share the script between different Firefox profiles/accounts. In particular, at work, I don’t have a Firefox profile but I might want to move scripts over from my personal machine to my work machine or vice versa. Since I don’t share the same Firefox account (and I certainly don’t want to sync work stuff with my personal account), that would make it more difficult for me.

Scratchpad is a very important tool for web developers. The multiline console won't replace it. Please don't remove it.

If you are going to remove scratchpad
Please add a toggle button to switch single/multi line mode of WebConsole
In multi line mode, we press [Enter] for adding a newline character.
Press [Ctrl+Enter] for executing the whole code in WebConsole

In single line mode, we press [Enter] for executing code

When you type for(var i = 0; i < 10; i++) {}
and move your cursor into curly brackets, press [Enter]

WebConsole will regard as single line mode and execute the code
but, it should be regard as multiple line mode because we want to add more codes in the body of for loop!!

That is, the user story in scratchpad CANNOT be replaced by WebConsole.
Please don't remove scratchpad or add a single/multi line mode switch button, thank you!

(In reply to grassboy from comment #22)

If you are going to remove scratchpad
Please add a toggle button to switch single/multi line mode of WebConsole
In multi line mode, we press [Enter] for adding a newline character.
Press [Ctrl+Enter] for executing the whole code in WebConsole

In single line mode, we press [Enter] for executing code

When you type for(var i = 0; i < 10; i++) {}
and move your cursor into curly brackets, press [Enter]

WebConsole will regard as single line mode and execute the code
but, it should be regard as multiple line mode because we want to add more codes in the body of for loop!!

That is, the user story in scratchpad CANNOT be replaced by WebConsole.
Please don't remove scratchpad or add a single/multi line mode switch button, thank you!

Hello,

We did add a button to switch between modes (+ a keyboard shortcut).
You can experience the new multiline editor mode in Firefox Nightly.

(In reply to Krzysztof from comment #21)

Scratchpad is a very important tool for web developers. The multiline console won't replace it. Please don't remove it.

As said before, Scratchpad is holding us back on a Firefox-wide refactoring and we don't have the resources to properly migrate Scratchpad given how little users it has in comparison to the other tools.

When you are saying multiline console won't replace it, what are you thinking of? We are open to adding missing pieces for Scratchpad parity.

Flags: needinfo?(krzysztof.glebowicz)

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

(In reply to grassboy from comment #22)

If you are going to remove scratchpad
Please add a toggle button to switch single/multi line mode of WebConsole
In multi line mode, we press [Enter] for adding a newline character.
Press [Ctrl+Enter] for executing the whole code in WebConsole

In single line mode, we press [Enter] for executing code

When you type for(var i = 0; i < 10; i++) {}
and move your cursor into curly brackets, press [Enter]

WebConsole will regard as single line mode and execute the code
but, it should be regard as multiple line mode because we want to add more codes in the body of for loop!!

That is, the user story in scratchpad CANNOT be replaced by WebConsole.
Please don't remove scratchpad or add a single/multi line mode switch button, thank you!

Hello,

We did add a button to switch between modes (+ a keyboard shortcut).
You can experience the new multiline editor mode in Firefox Nightly.

oh, okay... I think it will be better (just like firebug many years ago)
I'm in the beta channel... I will try few weeks later.

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

(In reply to Krzysztof from comment #21)

Scratchpad is a very important tool for web developers. The multiline console won't replace it. Please don't remove it.

As said before, Scratchpad is holding us back on a Firefox-wide refactoring and we don't have the resources to properly migrate Scratchpad given how little users it has in comparison to the other tools.

From my experience, not many users even know that something named "Scratchpad" is actualy an internal JS editor.

When you are saying multiline console won't replace it, what are you thinking of?

I'm thinking of the visual similarity of Scratchpad to other code editors, possibility to load and save files and working on different contexts.

Flags: needinfo?(krzysztof.glebowicz)

I've just tried the ML Console, it's not bad for a MVP state, but feature parity would be really appreciated.

I think one of the better features of firefox is scatchpad. For me, to see it go, Well, i've only ever used firefox for scratchpad, firebug and rarely web console I've been using the (firefox) developer edition for well over 15 years.
The web console just doesn't cut it unfortunately. Its great for instant feedback but when i'm working on a wip script that includes page refreshes and reattachment of my script... how does web console help? I am working on like a 100 lines of js before i'll commit it to the code base... and scratchpad helps....really really helps!!!
I need to be able to paste in, write from scratch, dynamicly edit and re-run JS in scratchpad; inclusive of page refreshes etc where i dont lose the code. Web console (multi line) doesnt allow me to edit JS and work with it how i want to.... and looking at the comments, other people are saying similar things. I'd have to press the up arrow to vie 100 lines of JS, try and scroll to where i need to make an edit, hit enter to reregister 100 lines or more of js.... i'm not sure how web console became the better alternative?
Without scratchpad, firefox still is good it has alot more than the others but i think chrome is getting there, and their rendering of pages is pretty good compared to firefox. If dev becomes difficult in firefox then people might just move on.

Would it not be possible to rewrite scratchpad so it works with your new framework? Rewrite it and keep your loyal customer base loyal to start with! and keep them happy too :)

if i've got web console completely wrong... then please show me how i can use it exactly like scratchpad as i really do need it. If web console can be made like scratchpad easily then please do this....its probably better to keep the functionality of scratchpad and incorporate if into web console PROPERLY though. It has to work like scratchpad. I understand the resource may not be there to rewrite scratchpad but i'm already compromising and saying.... make web console exactly like scratchpad.... and firefox will be even better than the others!!! Its already good. Lets keep it that way instead of going back in time... and losing customers to other browsers.

(In reply to saqib from comment #28)

I think one of the better features of firefox is scatchpad. For me, to see it go, Well, i've only ever used firefox for scratchpad, firebug and rarely web console I've been using the (firefox) developer edition for well over 15 years.
The web console just doesn't cut it unfortunately. Its great for instant feedback but when i'm working on a wip script that includes page refreshes and reattachment of my script... how does web console help? I am working on like a 100 lines of js before i'll commit it to the code base... and scratchpad helps....really really helps!!!
I need to be able to paste in, write from scratch, dynamicly edit and re-run JS in scratchpad; inclusive of page refreshes etc where i dont lose the code. Web console (multi line) doesnt allow me to edit JS and work with it how i want to.... and looking at the comments, other people are saying similar things. I'd have to press the up arrow to vie 100 lines of JS, try and scroll to where i need to make an edit, hit enter to reregister 100 lines or more of js.... i'm not sure how web console became the better alternative?

Thanks for your feedback. What we are calling multi-line editor mode is triggered by a button (or shortcut) and then changes the layout of the console.
The input is on the left, taking the whole vertical space, the output is on the right (like you have the VariableView on the right in Scratchpad)
When evaluating, you can see errors on the right, with a proper stacktrace (they aren't put as comments in the input, like they do in Scratchpad).

So far the only missing things are loading and saving from/to disk, and we're thinking of a way to integrate it in the console.

Would it not be possible to rewrite scratchpad so it works with your new framework? Rewrite it and keep your loyal customer base loyal to start with! and keep them happy too :)

It's not a new framework or something we can postpone. This is base technological piece that will be removed Firefox as a whole (for speed and security reason). Rewriting Scratchpad would be very time consuming given its low usage (the console is used by millions, scratchpad by thousands). We're a small team, and we currently don't even have a maintainer for Scratchpad (this kind of defaults to me, the Console maintainer and only full-time employee on it), and we have to make choices as we also have to deal with the security rewrite for the console + general maintenance.

if i've got web console completely wrong... then please show me how i can use it exactly like scratchpad as i really do need it. If web console can be made like scratchpad easily then please do this....its probably better to keep the functionality of scratchpad and incorporate if into web console PROPERLY though. It has to work like scratchpad. I understand the resource may not be there to rewrite scratchpad but i'm already compromising and saying.... make web console exactly like scratchpad....

I understand Scratchpad users heavily rely on it, but I really think Scratchpad is very subpar in what it offers. I want to provide a better experience for people who wants to build long scripts and evaluate it against a given context. The Firefox refactor is an opportunity for us to be able to offer a better experience than what Scratchpad currently is.

Sometimes it takes sometime to get used to a new tool, but I'm pretty sure (when load/save is implement) that you'll find Multiline Editor better than Scratchpad.
Please, if you can, try the new feature (either on Nightly or on latest DevEdition), and let us know how that feels for you.

Thanks

Thank you very much for a prompt response....

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

(In reply to saqib from comment #28)

This honestly sounds amazing. It seems its similar to swift dev playground on OSX - is that the case?

Thanks for your feedback. What we are calling multi-line editor mode is triggered by a button (or shortcut) and then changes the layout of the console.
The input is on the left, taking the whole vertical space, the output is on the right (like you have the VariableView on the right in Scratchpad)
When evaluating, you can see errors on the right, with a proper stacktrace (they aren't put as comments in the input, like they do in Scratchpad).

So far the only missing things are loading and saving from/to disk, and we're thinking of a way to integrate it in the console.

I think you seem to understand what we require. I think if your alternative is that good then we should genuinely be ok.

I understand Scratchpad users heavily rely on it, but I really think Scratchpad is very subpar in what it offers. I want to provide a better experience for people who wants to build long scripts and evaluate it against a given context. The Firefox refactor is an opportunity for us to be able to offer a better experience than what Scratchpad currently is.

Yes i will have to try this. Is this just a download from firefox's site? I'm using developer edition. Is there a nightly for the dev edition? I will try it and feedback.

Please, if you can, try the new feature (either on Nightly or on latest DevEdition), and let us know how that feels for you.

Thanks

Many Thanks

We also just uplifted bug 1580871, so the next build (b7) will have the editor buttons in the console.

And if you can't wait, you can go to about:config and turn on devtools.webconsole.features.editor (and then restart the console) :)

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

And if you can't wait, you can go to about:config and turn on devtools.webconsole.features.editor (and then restart the console) :)

I've updated to b6.... and turned on multiline. I'm going to use this for the rest of the day... so i should have some feedback for you soon.

Many Thanks

I've tried out the new web console in the latest nightly, it seems reasonably good other the open/save button. However one thing that did jump out at me is the lack of a way turn the display of the whole expression in the output pane, because it seems like it is just repeating everything from the input side when there aren't any errors and I would like to have the output side be able to act just like the old web console in terms of showing the error messages instead of a stack trace.

I meant a way to turn off the display of the whole expression.

I forgot to mention that I regularly use the code collapse toggles in Scratchpad to make it easier to see just the section(s) that I'm currently interested in changing during a WIP script.

Additionally, a line wrap on the code would be an improvement over the Scratchpad because even with a monitor with 1920x1080 resolution my lines of code sometimes will extend all the way from one side of the screen to the other and beyond. I also just noticed that sometimes when I'm typing on the input side of the new web console that the inspector/console/debugger/style editor/network/storage tabs' text and icons will briefly vanish then re-appear, without causing a layout shift fortunately, still it can be a bit unnerving to see happen.

I forgot to mention that I regularly use the code collapse toggles in Scratchpad to make it easier to see just the section(s) that I'm currently interested in changing during a WIP script.

Filed in bug 1581641.

I also just noticed that sometimes when I'm typing on the input side of the new web console that the inspector/console/debugger/style editor/network/storage tabs' text and icons will briefly vanish then re-appear, without causing a layout shift fortunately, still it can be a bit unnerving to see happen.

Sounds like a rendering glitch. Could you file a bug, with information from about:support copied in?

Blocks: 1583972
No longer regressions: 1583972

For those following here:

  • Bug 1584259 will be about adding load/save buttons to the browser console
  • Bug 1584262 will be about having a way to only display results of the evaluated expression in editor mode (so no messages coming from the content page)

we can't guarantee any precise date for implementing this, but we'll surely have the save/load buttons before retiring Scratchpad.

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