-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add an option to toggle autosave for the document manager. #3734
Conversation
I haven't looked at the code, but strong +1 on the feature and the
expression in the UI. Thanks!
…On Fri, Jan 26, 2018 at 1:43 PM, Ian Rose ***@***.***> wrote:
Fixes #3728 <#3728>
This adds a new toggleable menu item and setting to disable document
autosaving:
[image: image]
<https://user-images.githubusercontent.com/5728311/35461944-cbe51888-029e-11e8-9bfb-2e95afa31445.png>
------------------------------
You can view, comment on, or merge this pull request online at:
#3734
Commit Summary
- Add an option to toggle autosave for the document manager.
File Changes
- *M* packages/docmanager-extension/package.json
<https://github.com/jupyterlab/jupyterlab/pull/3734/files#diff-0> (7)
- *A* packages/docmanager-extension/schema/plugin.json
<https://github.com/jupyterlab/jupyterlab/pull/3734/files#diff-1> (16)
- *M* packages/docmanager-extension/src/index.ts
<https://github.com/jupyterlab/jupyterlab/pull/3734/files#diff-2> (56)
- *M* packages/docmanager/src/manager.ts
<https://github.com/jupyterlab/jupyterlab/pull/3734/files#diff-3> (23)
Patch Links:
- https://github.com/jupyterlab/jupyterlab/pull/3734.patch
- https://github.com/jupyterlab/jupyterlab/pull/3734.diff
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#3734>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABr0MhbZLgUwaa8VXYyJOun7kIy9dQeks5tOkcRgaJpZM4Ru6xN>
.
--
Brian E. Granger
Associate Professor of Physics and Data Science
Cal Poly State University, San Luis Obispo
@ellisonbg on Twitter and GitHub
[email protected] and [email protected]
|
Can I assume it will be a toggle though? Also, we might want to have an
advanced setting that allows a user to adjust the autosave time interval.
…On Fri, Jan 26, 2018 at 1:46 PM, Brian Granger ***@***.***> wrote:
I haven't looked at the code, but strong +1 on the feature and the
expression in the UI. Thanks!
On Fri, Jan 26, 2018 at 1:43 PM, Ian Rose ***@***.***>
wrote:
> Fixes #3728 <#3728>
> This adds a new toggleable menu item and setting to disable document
> autosaving:
> [image: image]
> <https://user-images.githubusercontent.com/5728311/35461944-cbe51888-029e-11e8-9bfb-2e95afa31445.png>
> ------------------------------
> You can view, comment on, or merge this pull request online at:
>
> #3734
> Commit Summary
>
> - Add an option to toggle autosave for the document manager.
>
> File Changes
>
> - *M* packages/docmanager-extension/package.json
> <https://github.com/jupyterlab/jupyterlab/pull/3734/files#diff-0> (7)
> - *A* packages/docmanager-extension/schema/plugin.json
> <https://github.com/jupyterlab/jupyterlab/pull/3734/files#diff-1>
> (16)
> - *M* packages/docmanager-extension/src/index.ts
> <https://github.com/jupyterlab/jupyterlab/pull/3734/files#diff-2>
> (56)
> - *M* packages/docmanager/src/manager.ts
> <https://github.com/jupyterlab/jupyterlab/pull/3734/files#diff-3>
> (23)
>
> Patch Links:
>
> - https://github.com/jupyterlab/jupyterlab/pull/3734.patch
> - https://github.com/jupyterlab/jupyterlab/pull/3734.diff
>
> —
> You are receiving this because you are subscribed to this thread.
> Reply to this email directly, view it on GitHub
> <#3734>, or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AABr0MhbZLgUwaa8VXYyJOun7kIy9dQeks5tOkcRgaJpZM4Ru6xN>
> .
>
--
Brian E. Granger
Associate Professor of Physics and Data Science
Cal Poly State University, San Luis Obispo
@ellisonbg on Twitter and GitHub
***@***.*** and ***@***.***
--
Brian E. Granger
Associate Professor of Physics and Data Science
Cal Poly State University, San Luis Obispo
@ellisonbg on Twitter and GitHub
[email protected] and [email protected]
|
Yes, it is a toggle. A configurable interval would also be nice. I have not done that here, as the specific auto-save procedure is a little subtle, and not strictly a single interval: https://github.com/ipython/ipython/wiki/IPEP-15:-Autosaving-the-IPython-Notebook |
packages/docmanager/src/manager.ts
Outdated
} | ||
set autosave(value: boolean) { | ||
this._autosave = value; | ||
each(toArray(this._contexts), context => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this._contexts
is already an array, so you can just do this._contexts.forEach(...)
.
This pattern in the file probably exists as a a holdover from an earlier version where it was an iterator and not an array. Would you mind changing this spot and the other toArray(...)
places that do this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. Changing now.
👍 on the feature and implementation, I think it's great. |
A possible alternative implementation: rather than toggling autosave as true/false, we could have the minimum autosave interval be settable as a number, where |
@ian-r-rose Unfortunately,
Since this can be documented in the JSON schema it seems like an okay strategy. But for now, I think the |
Okay, that's good to know. Lets keep it simple for now, then. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Even though the milestone is Beta 2, since it is a backward-compatible API change, I'm happy merging it in now unless there's a reason to wait. |
No objection here 😃 |
Greatly appreciated folks, many thanks!! |
Fixes #3728
This adds a new toggleable menu item and setting to disable document autosaving: