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

question about extension-defined actions #3549

Closed
parmentelat opened this issue Apr 20, 2018 · 8 comments · Fixed by #3561
Closed

question about extension-defined actions #3549

parmentelat opened this issue Apr 20, 2018 · 8 comments · Fixed by #3561

Comments

@parmentelat
Copy link
Contributor

Hey folks

I’m facing an issue about an extension that defines actions
(all this is with the classic notebook and the RISE extension)

What is happening is that:

  • users can see those actions in the ‘Edit Keyboard Shortcuts’ UI
  • from this UI they can also bind the actions to keystrokes
  • and that works fine for the current session
  • it is also properly saved in nbconfig/notebook.json
  • but then if they come back later on in a new notebook session, this error shows up in the console:
Uncaught (in promise) Error: does not know how to deal with : RISE:toggle-note
    at ShortcutManager.add_shortcut (keyboard.js:457)
    at ShortcutManager.add_shortcuts (keyboard.js:475)
    at keyboardmanager.js:80

which of course suggests that keybinding takes place before the extension is loaded

It seems like a pretty standard situation, so I wonder if I did something wrong in the way I defined these actions;

where should I start looking to see how folks handle that in other extensions ?

@takluyver
Copy link
Member

It is a reasonable thing to do, and other people have run into the same roadblock (#2954). It's waiting for someone to dig in and figure out a fix. Maybe a way to register shortcuts without checking their names, and then trigger a check of all names after extensions have loaded?

takluyver added a commit to takluyver/notebook that referenced this issue Apr 24, 2018
When users bind custom shortcuts to actions coming from extensions, the
shortcuts can be loaded before the extensions, so we need to allow
defining a shortcut for an action that doesn't exist yet.

Closes jupytergh-3549
Closes jupytergh-2954
@takluyver
Copy link
Member

If you've got time to test, can you check that #3561 fixes it? There are instructions on installing from source here: http://jupyter-notebook.readthedocs.io/en/stable/contributing.html#setting-up-a-development-environment

@takluyver takluyver added this to the 5.5 milestone Apr 24, 2018
@parmentelat
Copy link
Contributor Author

Sur thing, I will give this a try as soon as I have the opportunity
Thanks a lot for the very fast reaction !

@parmentelat
Copy link
Contributor Author

as an aside, I see this attached to the 5.5 milestone, is there any known indication about when this would be released, even approximative ?
Just to get a sense of the best pace for addressing this..

@takluyver
Copy link
Member

The best way to get a sense is how many other things are in the milestone - at the moment there are just a handful, and that's because I'd like to get 5.5 ready in the next few days. :-)

@parmentelat
Copy link
Contributor Author

I struggled a bit to get in position, but as far as I can tell, using takluyver:i3549 indeed solves the issue, the registered action does not trigger any message upon reloading, and the shortcut triggers as expected, so we should be fine

Thanks a lot!


PS. I'd like to add that on the mac I had to explicitly run

brew install bower

in addition to what was mentioned in the contributing doc that you quoted; this was required before I could run

pip3 install -e .

from my local notebook repo, that attempted to run bower which was not installed

@takluyver
Copy link
Member

Thanks!

It's meant to use npm to install bower, but I guess it may have installed it somewhere that wasn't on $PATH. Installing stuff is hard! :-(

@parmentelat
Copy link
Contributor Author

agreed ;)

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants