Skip to content
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

Contents change notifier #778

Open
davidbrochart opened this issue Apr 6, 2022 · 2 comments
Open

Contents change notifier #778

davidbrochart opened this issue Apr 6, 2022 · 2 comments

Comments

@davidbrochart
Copy link
Contributor

Problem

In JupyterLab we are transitioning to automatically saving after each change to a document, à la Google Docs. When a file change occurs in the back-end, for instance a version-controlled file after a git checkout my_branch, we want to notify the user that the file was changed "on disk", and ask if they want to keep their content and overwrite the file, or revert to the saved file and loose their changes.
I am thinking that we could have a new service in the contents manager, to notify for changes in directories/files.

Proposed Solution

I don't have a solution yet 😄
This issue is mainly to discuss if that would be helpful, and how we would specify it. Maybe it doesn't have a place in core jupyter-server.
But since we already provide file managers, I think that a change notifier could be part of it. We could use watchfiles for that.

Additional context

See jupyterlab/jupyterlab#12306.

@blink1073
Copy link
Contributor

We talked about adopting Cal Poly's Notifications extension in a team meeting

@davidbrochart
Copy link
Contributor Author

Thanks for mentioning that @blink1073, I think a contents change notifier could use this notifications extension.
Right now I don't even need the file change notification to be sent to the front-end, since it would be handled in the back-end. But I am more and more convinced that it should be part of the contents manager, because it depends on the underlying file system. We could ship a default implementation in our file managers, and custom content managers could decide to implement it or not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants