New issue
Advanced search Search tips

Issue 755075 link

Starred by 3 users

Issue metadata

Status: Assigned
Owner:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Feature



Sign in to add a comment

[Feature Request] Auto Save snippets

Reported by targ...@gmail.com, Aug 14 2017

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36

Steps to reproduce the problem:
1. Open Dev tools -> Sources/Snippets
2. Input some valid javascript
3. Close Tab
4. Reopen Dev tools

What is the expected behavior?
Recovered snippet that wasn't saved

What went wrong?
All data was lost

Did this work before? No 

Chrome version: 60.0.3112.90  Channel: stable
OS Version: 10.0
Flash Version: 

Auto saving snippets rather than manually saving every time we remember it seems like the way to go. 

As far as i can see Snippets are only locally stored, so saving it 5 times [automated] rather than only when manually triggered wouldn't be a problem for the end user. It would also be a generally good feature to have and prevent dataloss
 

Comment 1 by l...@chromium.org, Aug 14 2017

Labels: -Type-Bug Type-Feature
Owner: einbinder@chromium.org
Status: Assigned (was: Unconfirmed)
Thanks for the feature request.  I imagine there may still be scenarios when autosaving might not be ideal, say modifying an existing snippet, but then realizing later you want to revert.  We could investigate some UX here.

einbinder@ could you please take a look?
Possible alternative: post a "save unused changes?" alert before allowing the user to close the DevTools tab.
We don't want to use alerts. Either we do a full diff store with auto save
our we need a more prominent ux for unsaved work.

One solution to ux would be to use the network throttle warning indicator
in the tab. With a caption to denote unsaved work. Then on any source view
to edit a snippet, we add an infobar about it being unsaved. This feels
like prominent enough ux to make developers aware of the current state.
Much moreso than one easy to miss asterisk on the tab.

Comment 4 by targ...@gmail.com, Aug 15 2017

Alternatively add an option to 'save on focusout' 

I use sublime text daily, and it got a 'save on focusout' option which i immediately turned on, it is so much easier to know that your file is always saved rather than spamming Ctrl-S a few hundred times to make sure it is saved.

What this feature request is for, is not a fancy color to let the developer know that he havn't saved, but rather a feature that ensures no dataloss when closing the dev tool, be it by Alert or auto save.

As regards to the modifying an existing snippet and wanting to undo, you could use Ctrl-Z to go back to the original snippet? or simply make a duplicate?
Labels: -OS-Windows OS-All
There are a lot of workflows to consider with this kind of change. Autosave isn't always the desired outcome, even if you generally do want it on.

You may very well end up editing snippets at some point that you're just experimenting with and don't want your original overwritten. While using the original as a quick base to run with. Should you then need to remember to go in and turn auto-save off for that scenario specifically?

Alert is not a good UX option. This is already being actively warned against by the Chrome team and the way in which alerts work are undergoing some work to help them not block closing tabs and such.

"the Chromium team highly recommends that you not use JavaScript dialogs." referencing the official Dialog Policy [1]. Anything a dialog could be used for, we can find a nice and streamlined inline method of displaying that information.

I'm not looking at this myself as, "User requests autosave therefore autosave must be provided." I'm seeing it as, "A user has presented us with their problem. That is they have a problem knowing whether or not they have an unsaved snippet modification. How can we improve the experience to make it more prominent?" Focusing on problems and having a healthy discussion over possible solutions leads to better software then assuming a specific outcome up front.

[1] https://developers.google.com/web/updates/2017/03/dialogs-policy

Comment 6 by woxxom@gmail.com, Aug 16 2017

Ideally, the entire editor state might be autosaved/restored like it's done in the user-friendly JetBrains IDE editors. The undo history, the scrolling position, current line and column, contents of the find toolbar. Of course it's not trivial because many source tabs with snippets may be unsaved, in which case the question is whether it's worth saving the entire undo history for each snippets tab or just one undo state that would toggle between the original and unsaved versions (another question: for all such tabs or individually).

Comment 7 by targ...@gmail.com, Aug 16 2017

>> "A user has presented us with their problem. That is they have a problem knowing whether or not they have an unsaved snippet modification...

Just to clarify, this is not the problem. Since i have been accustomed to my editors auto saving my changes i never hit ctrl-s per default (my problem not yours) this results in the following:

- I open a tab with dev tools
- Write my little snippet
- Work on another tab going back and forward
- Forget about my snippet (which i still need)
- Accidentally close the tab with the dev tools (This usually happens when i decide to clean up my tabs)

Snippet has now been deleted without warning me or preventing data loss by caching the snippet and restoring on reopening dev tools. 

A Fancy yellow color on the dev tools wouldn't solve the problem here, it requires an action to be taken by the user or somehow be handled by dev tools restoring the snippet upon reopening the snippet. Sometimes i undock Dev tools and run it in a different window, and it can be tricky to figure out which tab this Dev tool is belonging to.

I realise i might be in the minority here, but i recently discovered snippets and have been starting to use it to prototype in and it is a pleasure to work with. The only downside is when the occasional dataloss happens due to my own negligence. 

Sign in to add a comment