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
update quickhelp on adding and removing shortcuts #5049
Conversation
We will have to think further about how to work this. The ShortcutManager is a very low level bit of code that needs to not depend directly on Notebook/Cell/QuickHelp, etc. The usual way we handle this is by firing an event that the QuickHelp could watch for in ShortcutManager. Can you give that a try? |
Any plans to address this before 2.0? |
QuickHelp is rebuilt on show if the dirty bit was set.
Ok, I've changed this to use an event, as @ellisonbg suggested. The Ready for review. |
Ok, I've prettified the keyboard shotrcuts here, and made them consistent with how we refer to keyboard shorcuts in our docs. For example: Here's are screenshots of what the two options look like: We could also combo constituents if that makes better sense. |
I realized as soon as I posted this that the |
I prefer the |
I don't think so... |
The red does look a bit too loud to me. |
I agree that the red is a bit too much. Also, we use On Tue, Mar 11, 2014 at 10:24 AM, Thomas Kluyver
Brian E. Granger |
@ellisonbg the change to |
Originally I picked |
I really like the |
I agree with @ellisonbg here... the |
Of course, my preference would be to use ^⇧⌥⌘ ⏎ symbols with no delimiter, but I think that's not the way we are going. |
|
Do we want to allow |
@@ -18,6 +18,10 @@ var IPython = (function (IPython) { | |||
QuickHelp.prototype.show_keyboard_shortcuts = function () { | |||
// toggles display of keyboard shortcut dialog | |||
var that = this; | |||
if ( this.force_rebuild ) { | |||
delete(this.shortcut_dialog); |
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.
you verify that this is sufficient to actually delete the DOM element from the page as well.
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.
I'm actually not versed enough on front-end stuff to be able to say anything definitive about that. What would be a way to verify this? Is there some DOM view I don't know about?
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.
The thing to do is look at the DOM in the developer tools to make sure there aren't two quick help DOM elements after a rebuild. If there is, you will probably have to add a call to jQuery's remove method to clean up the dialog. But I think our dialog logic may already handle this.
The |
That would be really awkward with the (I didn't mean to close/reopen this issue btw, my finger slipped on my computer's track pad). |
do alliterate, aforementioned color alternative alias is amaranth
This is looking just about ready. I think the last question to resolve is Should we
I would lean toward either switching to Further options in the API that avoid any of the issues that come with using a legitimate shortcut key as a delimiter:
|
I'm working on making the API use |
ok, i think the API now expects and uses |
Travis is green, and there was much rejoicing! |
update quickhelp on adding and removing shortcuts
update quickhelp on adding and removing shortcuts
I've been knee deep in making shortcuts work for vim mode etc, and have more PRs coming to start some discussion about that, but this one seems like a separate small change worth having.
Right now, we have an API for adding and removing shortcuts, but no visual indication in the UI of which shortcuts are actually active (the quick help you see in the notebook is built only once, and reused there-after).
With this change, we just rebuild the quickhelp dialog on keyboard shortcut changes