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

Disable rename and copy menus #23

Merged
merged 1 commit into from Apr 14, 2022

Conversation

martinRenou
Copy link
Member

@martinRenou martinRenou commented Apr 13, 2022

cc. @fcollonval

Hiding the cut/copy/rename context menu commands.

@martinRenou
Copy link
Member Author

I have some issues with this PR:

  1. It seems to work almost correctly but the rename/copy/cut menus are added back on top and do not respect the rank on the classic file browser:

cut

  1. Also it's a bit annoying because this approach does not work with jupyterlab-unfold unless we use the same id.

  2. I'm unsure how to install the overrides.json file, should this be done manually in the setup.py? Or is there a custom entry to add in the package.json (like it is done for the schema directory)?

@martinRenou
Copy link
Member Author

  1. It seems to work almost correctly but the rename/copy/cut menus are added back on top and do not respect the rank on the classic file browser:

This should be fixed by jupyterlab/jupyterlab#10666

  1. Also it's a bit annoying because this approach does not work with jupyterlab-unfold unless we use the same id.

I'll see if I can rework this

@fcollonval
Copy link
Member

I have some issues with this PR:

1. It seems to work almost correctly but the rename/copy/cut menus are added back on top and do not respect the rank on the classic file browser:

That PR jupyterlab/jupyterlab#10666 will need to be backported to resolve that.

2. Also it's a bit annoying because this approach does not work with jupyterlab-unfold unless we use the same id.

Yes this is where things start to be complex.

A possibility is to deactivate the entry for the core command. And to create a new command that does exactly the same but with a isVisible method that returns false for this widget and true otherwise.

3. I'm unsure how to install the `overrides.json` file, should this be done manually in the `setup.py`? Or is there a custom entry to add in the `package.json` (like it is done for the schema directory)?

You don't need to add the overrides.json, you can place every entries in this extension jupyter.lab.menus.context section of the plugin schema.

@martinRenou
Copy link
Member Author

Thanks for your help @fcollonval!

Now only remains the issue that jupyterlab/jupyterlab#10666 should fix. I don't have a strong opinion whether we should wait for the fix to be released or not. It's a trade-off between having menus that don't work versus misplaced menus.

menus.mp4

@martinRenou martinRenou marked this pull request as ready for review April 14, 2022 08:09
src/index.ts Outdated Show resolved Hide resolved
@jtpio
Copy link
Member

jtpio commented Apr 14, 2022

Thanks @martinRenou!

Looks like the manifest check is failing because of the schema folder.

@jtpio
Copy link
Member

jtpio commented Apr 14, 2022

Thanks!

@jtpio jtpio merged commit a2b8af5 into jupyterlab-contrib:main Apr 14, 2022
@martinRenou martinRenou deleted the disable_rename_copy branch April 14, 2022 10:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants