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
Modal UI #3605
Modal UI #3605
Conversation
Won't some of those changes make e.g. Emacs bindings even harder to implement by locking in a vim-ish model in the implementation? Would C-c C-c be forced to become C-m C-c C-c? I'd like to see a default keypress handling that could be overloaded with either vim-style dual mode or emacs style bindings, or whatever is cool next year. |
@@ -38,6 +38,8 @@ var IPython = (function (IPython) { | |||
this.placeholder = options.placeholder || ''; | |||
this.read_only = options.cm_config.readOnly; | |||
this.selected = false; | |||
this.rendered = false; |
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.
indentation.
Had a quick read-through, not enough to understand everything so I would like to have time to look at it more before judging. I still don't like the if-else block with event number to choose between action, IMHO, we shoudl be able to do that using a dict with value beeing function. It feel strange to me that switching to command-mode is handeled on a per-cell basis, but as I wrote earlier I want to understand more. I feel more-and more that this is too big for 1.0, and that we should really discuss dual-mode editting, and give it more than 10-15 day tests. |
* @method unselect | ||
* @return is the action being taken |
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 don't understand this statement.
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 actually have "@return is the action being taken" in lots of places.
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.
it's like an event handler, return true if an action is taken, false if nothing happend
And now some usage feedback. would bind pgup pgdown to +10 cell - 10cell to move fast. |
Completion is broken. Should not unselect the cell on focus out as completer take focus. |
Focusing out a cell make it jump to top of screen. Eg I'm editting a cell in the middle of my screen, I reach menu. |
The different behavior when clicking in |
shift enter do not select next cell for execution. |
I'll revert to master, is is too hard to edit and tweek a notebook with this branch. I also have a lot of shortcut in my muscle memory ('C-m,a' , type What about |
If I just move out of a heading cell its not get rendered as heading cells. It needs to be executed. Seems like |
I think that's by design |
One comment: I think the cell highlight should be visibly different for edit / command mode |
|
Some quick usability comments from playing around: the 'h' key for help needs to be displayed somewhere in the UI - maybe only appearing during command mode. the help screen should have a link that opens a more complete page documenting usage. I agree with @ivanov about the J,K - as a vim user, it moves where my cursor is, not the line I'm on maybe keyboard shotcuts could appear with hover-help on toolbar buttons some more pronounced visual feedback of what mode is active Should there be a way to disable dual mode completely for beginners? |
One weird thing: if I convert as cell to markdown, and later again to a code cell, it seems to lost the grey border of the command mode (we enter the phantom mode...booo... like vim... hehe ;-) @ivanov) . I mean, you can execute it, but if you want to see the border again you have to alt+enter or ctrl+enter. |
Can you give the exact keystrokes you used? Sent from my iPhone On Jul 11, 2013, at 5:13 PM, Damián Avila notifications@github.com wrote:
|
|
I might be inclined to do that for meta-s as well, since I don't even know where my meta key is ;-). I'm happy for only one shortcut to be documented for each option. |
👍 to that |
perhaps instead of |
} | ||
}, | ||
'shift+o' : { | ||
help : 'toggle output', |
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.
should read 'toggle output scrollbar' or something like that to distinguish it from 'o' above
Split leaves the cursor in the second part of the cell, but we only have a shortcut for join below, not join above, so if you use the shortcuts to split and immediately join, you don't get back to where you started. That's probably not a big problem when you're not testing shortcuts, but it might be an awkward asymmetry to remember. I know we considered whether split should leave the cursor above or below the split - this is a point in favour of above. |
} | ||
}, | ||
'up' : { | ||
help : 'select previous cell', |
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.
"select previous cell (only if on top line, otherwise, go up a line" or something like that
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.
Too long, I think. I'd just leave the help strings out, so they're not listed in the shortcuts help - it should be obvious enough to users how moving the cursor works.
I think @ivanov's suggestion of matching Gmail's '?' shortcut for help makes the most sense now that we don't have a modifier key. But this brings up an issue: while we are using KeyDown, '?' is 'shift+/'; but on French keyboards, it is 'shift+,'. If we use the KeyPress event instead, then it's clear, and the shortcut is just '?' (no shift necessary). However Chrome doesn't fire KeyPress for non-printing characters (esc, arrows, etc.), so we can't use KeyPress exclusively. It seems to me that the most logical approach is:
But this is obviously more complex than just using KeyDown. Still, I think 'A' as a shortcut makes more sense than 'shift+a', and it would mean that we are not (as) sensitive to locale differences. It's also possible that we should look into that in a separate PR, rather than here. |
Keyboard shortcut in IPython is already a mess on non-english keyboard, it is always like that in webapp anyway. IMHO, but probably in a subsequent PR, one should be able to express in the shortcut string wether the shortcut is bounded to a key, or a char. smth like Eg, french again, restart kernel should be bound to |
OK, I have fixed all outstanding review comments:
|
Modal UI - a whole new world of fun....its like vim, but not!
I have some bug reports / feedback on the CodeMirror vim-mode integration with the modal UI. Let me know if I should split this into a separate issue.
Other than those issues it seems to be working quite well, though! This interface is a HUGE improvement over the previous one. There's definitely some "vimception" going on with the three levels of command mode -> edit/normal > insert, but it actually works pretty well together. |
Thanks for the feedback. Can you open a Github issue and assign it to On Mon, Jan 13, 2014 at 1:36 AM, sjobeek notifications@github.com wrote:
Brian E. Granger |
I've opened the issue (#4798), but unfortunately I'm not able to assign it to ivanov. I'll add any additional feedback to that issue. |
Done the assignment to @ivanov |
looks like someone else did this for you, thanks, i'll take a |
Modal UI - a whole new world of fun....its like vim, but not!
The goal of this PR is to fix the various focus related problem in the notebook user experience. The issue for this is #3441. The source of the problem is that we used to call
this.code_mirror.focus
when a cell was selected. This caused all of the jumpy behavior. However, when this call was removed, the entire user experience fell apart. This PR is an attempt to restore a solid user experience while also removing the problematic focus calls.The result is that the notebook is now a dual mode editor with a command mode and edit mode. Command mode is entered using
ESC
orCtrl-m
. Thus our old keyboard shortcuts still work, but multiple of them can be given after you typeCtrl-m
. Edit mode is entered for the current cell by pressingEnter
. This is not ready for merge, but we are thinking about trying to merge this for 1.0. But, it will need lots of testing. The code is relatively simple, but the new interaction model is quite subtle and there are numerous tweaks we could make.Another side effect is that multiple markdown, rawtext and heading cells can now be unrendered at the same time.
Overall I think this is a massive improvement of the user experience. But, this needs tons of interactive hands on user experience testing.
Remaining issues:
ESC
.Questions:
Shift-Enter
,Ctrl-Enter
andAlt-Enter
behave?ESC
for entering command mode?