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

When deleting a file, also delete the favorite #7

Open
mlucool opened this issue Apr 20, 2022 · 3 comments
Open

When deleting a file, also delete the favorite #7

mlucool opened this issue Apr 20, 2022 · 3 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@mlucool
Copy link

mlucool commented Apr 20, 2022

If you delete a file via lab, it does not also get removed from favorites. It means you need to go to favorites and remove it from there as well. Can we change this behavior to keep this in sync?

I am not sure if this plugin should handle a favorite being deleted outside of lab (e.g. via git pull, or rm -f etc.), but it seems worthwhile to consider.

@mlucool mlucool added the enhancement New feature or request label Apr 20, 2022
@mlhenderson
Copy link
Collaborator

There was a "purge" action that happened when you tried to select a favorite and it was no longer available which removed the favorite. However, this was problematic for network file systems where the favorite may be temporarily unavailable but not deleted, and so that "purge" behavior was dropped.

This does imply manual syncing of deleted favorites currently.

I'm interpreting "inside" lab delete somewhat narrowly as selecting the file/directory in the file browser and selecting delete (or move? or rename?) from the UI. @mlucool is this the context you are assuming?

@mlucool
Copy link
Author

mlucool commented Apr 20, 2022

However, this was problematic for network file systems where the favorite may be temporarily unavailable but not deleted, and so that "purge" behavior was dropped.

That makes sense.

I'm interpreting "inside" lab delete somewhat narrowly as selecting the file/directory in the file browser and selecting delete (or move? or rename?) from the UI

Yes that is what I meant. It would be nice is move/rename kept the favorite and did the a similar action too.

@fcollonval fcollonval added the help wanted Extra attention is needed label Apr 21, 2022
@fcollonval
Copy link
Member

Thanks for the suggestion @mlucool

We could indeed use the following signal (snippet taken from jupyterlab-git extension):

  // Whenever a user adds/renames/saves/deletes/modifies a file within the lab environment, refresh the Git status
  app.serviceManager.contents.fileChanged.connect(() =>
    gitExtension.refreshStatus()
  );

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants