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
Menu cleanup #4662
Menu cleanup #4662
Conversation
I'm all in favour of keeping things properly organised, but the normal menu+toolbar paradigm is that toolbars are shortcuts to options that are also accessible through the menus, not an alternative to menus. I'm not convinced that we should depart from this without a good reason. |
That was definitely my original vision: everything was available in the On Sat, Dec 7, 2013 at 3:56 PM, Thomas Kluyver notifications@github.comwrote:
Brian E. Granger |
I'm with Thomas - I don't think there should be actions that are not in the menus. I think toolbars, keyboard shortcuts, etc. should all be duplicate entry points for convenience. |
Thanks for the feedback. Here is my modified thoughts:
|
LOL, I guess the "Cell Type" items were already in a submenu. I will put that and the "Kernel" menu back... |
My only thought on this is that bootstrap 3 removes submenus, if I recall correctly.
I agree on navigation - these are not normal menu actions. I actually think it's a bit weird for them to be in the toolbar as well. |
Ouch on the Bootstrap 3 submenus... I am a bit confused. We don't have "Select Next/Prev" in the toolbar. Do you mean "Move Up/Down"? I actually use those sometimes... |
I forgot what those arrows were for. Yes, move makes perfect sense, ignore me. |
OK I have added back the Kernel menu and Cell Type submenu. Waiting for Travis, but everything else should be ready to go. |
Notebook.prototype.expand_all_output = function () { | ||
var ncells = this.ncells(); | ||
var cells = this.get_cells(); | ||
for (var i=0; i<ncells; i++) { |
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.
non need to get ncells
, for (i in cells)
will loop through the index. also, would it be possible to either use smth map or debounce, This is one of the call that might hang the notebook as the js is stuck in a tight for loop. (eventually call the expand_output
in a set_timeout 0
Looks good, agree to keep things in menu. |
OK loops are cleaned up. |
@@ -187,9 +181,11 @@ var IPython = (function (IPython) { | |||
// Insert | |||
this.element.find('#insert_cell_above').click(function () { | |||
IPython.notebook.insert_cell_above('code'); | |||
IPython.notebook.select_prev(); |
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.
Why focus on the previous cell of the inserted cell?
It makes sense to insert and focus in the inserted, just IPython.notebook.insert_cell_above('code');
or
it would also makes sense to focus in the "origin" cell with IPython.notebook.select_prev();
so you are just inserting cell not inserting and focus... but the behaviour of the previous cell does not feel right to me 😉
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.
IIRC this is because insert_cell_above doesn't actually focus that 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.
But insert_cell_above
and insert_cell_below
are both focusing in "destination" cell... both are calling insert_cell_at_index
which is selecting itself this.select(this.find_cell_index(cell));
or am I misinterpreting something? (I do not get all the IPython js internals yet 😉)
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 will double check. I think you may be right and I accidentally put these lines thinking this was my newux branch...
Just a couple of comments... |
+1 to keeping all functionality on the menus. It's a well-established convention of UIs that toolbars are only alternate, quick-access conveniences for frequently used items. I very often turn off the toolbar when I need maximal vertical space. Losing functionality altogether with the toolbar off would be pretty terrible. I know the original changes were already reverted, so this comment is mostly to record my feedback on the topic for future reference. |
@ellisonbg do you have plans to push forward this one? Thanks |
Yep, will finish soon. On Sat, Jan 25, 2014 at 8:22 AM, Damián Avila notifications@github.comwrote:
Brian E. Granger |
Ok I have cleaned this up a bit more based on a HipChat with @minrk today. The Cell menu has the following actions for both the current and all cells (each in a submenu):
I think this one is ready to go, but it would be good to have someone look at it again. |
While we're doing menu cleanup, can we get ids for the menu elements? |
Sure I will add those now... |
@takluyver to which item:
|
I am thinking the inner one as its children are the actual menu items. |
I guess the inner one makes sense, but I have no strong preference. |
title="Show/Hide the output portion of a Code cell"> | ||
<a href="#">Toggle Current Output</a></li> | ||
<li id="current_outputs" class="dropdown-submenu"><a href="#">Current Output</a> | ||
<ul class="dropdown-menu"> |
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.
Do we want ids for submenus as well? I guess you can select them as the only subelement of the menu item which opens them.
Other than that, 👍 |
I am actually -1 on adding ids for the submenus. With our change to On Wed, Jan 29, 2014 at 4:45 PM, Thomas Kluyver notifications@github.comwrote:
Brian E. Granger |
ids on top-level uls seems sufficient. Merging. |
Menu cleanup
We had a lot of stuff in the menus that was not really needed and some other stuff that was poorly organized. Here is a summary:
Yeah simplification!