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

Added the Selection of cells till Top and Bottom #7177

Merged
merged 8 commits into from Oct 12, 2019
Merged

Added the Selection of cells till Top and Bottom #7177

merged 8 commits into from Oct 12, 2019

Conversation

adityar-r
Copy link
Contributor

References

This Pull Request solves the issue: #6783

Code changes

The following files were changed:

  1. jupyterlab/packages/notebook-extension/src/index.ts
    in which two new command definitions i.e extendBottom and extendTop have been added.
  2. jupyterlab/packages/notebook-extension/schema/tracker.json
    in which two new shortcut keys are defined i.e Shift+PageUp and Shift+PageDown to select to top and bottom respectively.
  3. jupyterlab/packages/notebook/src/actions.tsx
    in which the function definitions extendSelectionAbove and extendSelectionBelow have been added an extra parameter to identify selections till top or only one cell above and vice versa, respectively.

User-facing changes

Backwards-incompatible changes

@jupyterlab-dev-mode
Copy link

Thanks for making a pull request to JupyterLab!

To try out this branch on binder, follow this link: Binder

@jasongrout
Copy link
Contributor

How about the new toTop and toBottom parameters default to false? Then the current code does not need to change, and it is backwards compatible so this can go in for 1.2.

@jasongrout
Copy link
Contributor

Thanks! I left a few review comments.

@jasongrout
Copy link
Contributor

Thanks! I added a few more comments inline.

@adityar-r
Copy link
Contributor Author

@jasongrout do I need to change any more files for accepting the pull request?

@jasongrout
Copy link
Contributor

Can you look at the two outstanding comments above?

#7177 (review)

#7177 (comment)

@adityar-r
Copy link
Contributor Author

I have made the necessary changes, @jasongrout is the file ok?

@adityar-r
Copy link
Contributor Author

@jasongrout any more changes to be made, before merging?

@adityar-r adityar-r closed this Oct 11, 2019
@adityar-r adityar-r reopened this Oct 11, 2019
@jasongrout
Copy link
Contributor

@jasongrout any more changes to be made, before merging?

Thanks for your patience. I think the only thing left is picking the right keyboard shortcuts. The survey on macOS in #7177 (comment) indicates that probably Accel-Shift-Up/Down is the right keystroke on a mac. As I mention in #7177 (comment), I'm hoping someone will have time to experiment a bit on windows/linux to see if the corresponding Ctrl-Shift-Up/Down is natural there compared to common applications.

@adityar-r
Copy link
Contributor Author

adityar-r commented Oct 11, 2019

For Ubuntu(Linux):

Application Selection Type Select to Top Select to Bottom Consecutive Behaviour
VS Code Text Ctrl + Shift + Home (Shift + Page Up) Ctrl + Shift + End (Shift + Page Down) Last Extreme
LibreOffice Writer Text Ctrl + Shift + Home (Shift + Page Up) Ctrl + Shift + End (Shift + Page Down) Last Extreme
LibreOffice Calc * Object Column: Ctrl + Shift + Up Arrow Column: Ctrl + Shift + Down Arrow None
HTML TextArea in Firefox Text Ctrl + Shift + Home (Shift + Page Up) Ctrl + Shift + End (Shift + Page Down) Last Extreme

LibreOffice Calc : Shift + Home, Shift + End -> Selects upto the last extreme top of current column and last extreme bottom of current column respectively.

@jasongrout
Copy link
Contributor

Thanks. Can you try a file browser list of files? That is a common object list that people will have experience with. Also, do you happen to know of an application that has a gnome listbox to see the behavior there?

@adityar-r
Copy link
Contributor Author

I have tried with the gedit's( file->open), file browser list, using Shift + Home and Shift + End selects some items, but not upto the top or bottom respectively, and consecutively it repeats selecting the same number of items before or after the currently selected items respectively. I suppose after searching in nautlius(file browser of Gnome) the results are displayed in a list box, and the results are same as the file browser above.

@jasongrout
Copy link
Contributor

jasongrout commented Oct 11, 2019

We're trying on windows:

Application Selection type Select to top Consecutive behavior
Windows Explorer (file manager) Object Shift Home Last Extreme
Windows Explorer (file manager) Object Ctrl Shift Home Everything
Excel 2016 Object Ctrl Shift UpArrow Last Extreme
Anki application Object Shift Home Everything
Wordpad Text Ctrl Shift Home Last Extreme
Firefox multiselect, Chrome multiselect, Edge multiselect object Shift Home Last Extreme
Chrome multiselect object Ctrl Shift Home Last Extreme
Firefox multiselect object Ctrl Shift Home Everything
Firefox textarea, Chrome textarea, Edge textarea text Ctrl Shift Home Last Extreme

@jasongrout
Copy link
Contributor

jasongrout commented Oct 11, 2019

@bw-space - based on these survey results, how about we have Last Extreme behavior, with the following two sets of shortcuts:

Shift Home / Shift End

Cmd Shift UpArrow, Cmd Shift DownArrow (and explicitly Cmd so that it is mac-specific) Never mind. I experimented a bit (see phosphorjs/phosphor#438), and I think it is difficult to make mac-only keybindings. The current keybinding schema insists that keys is a nonempty array, for example. So let's just do Shift Home / Shift End for now, and wait for discussion at phosphorjs/phosphor#438 to resolve before trying to add the mac-specific keybinding.

@jasongrout
Copy link
Contributor

In other words, let's do Shift Home / Shift End as keybindings and we can merge this, and later we can do the mac-specific keybindings when we figure out a good way to do it.

@@ -87,11 +87,21 @@
"keys": ["Shift K"],
"selector": ".jp-Notebook:focus"
},
{
"command": "notebook:extend-marked-cells-top",
"keys": ["Shift PageUp"],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"keys": ["Shift PageUp"],
"keys": ["Shift Home"],

{
"command": "notebook:extend-marked-cells-below",
"keys": ["Shift ArrowDown"],
"selector": ".jp-Notebook:focus"
},
{
"command": "notebook:extend-marked-cells-bottom",
"keys": ["Shift PageDown"],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"keys": ["Shift PageDown"],
"keys": ["Shift End"],

@jasongrout
Copy link
Contributor

I suggested the changes to the keybindings above. If those look good to you (given the survey results above), feel free to commit the suggestions, and then I can merge.

Thanks again for working on this, and your patience in the process.

@adityar-r
Copy link
Contributor Author

@jasongrout, I am very thankful to you for helping me in the process, you have been one of my constant guides. I am looking forward to solve more of the issues :D . It's feels great to contribute here.

@jasongrout
Copy link
Contributor

I put in a PR to make it possible for us to have platform-specific bindings: #7335. So after that is merged, we can introduce the mac-specific binding too.

@jasongrout
Copy link
Contributor

One last test - and it works great! Thanks again. I look forward to working with you again on another issue.

@jasongrout jasongrout merged commit c9d9a39 into jupyterlab:master Oct 12, 2019
@jasongrout
Copy link
Contributor

@meeseeksdev backport to 1.x

meeseeksmachine pushed a commit to meeseeksmachine/jupyterlab that referenced this pull request Oct 12, 2019
@jasongrout jasongrout modified the milestones: 1.2, 2.0 Oct 12, 2019
@jasongrout jasongrout removed the tag:Backport This PR is slated to be backported after it is merged. label Oct 12, 2019
jasongrout added a commit that referenced this pull request Oct 12, 2019
…7-on-1.x

Backport PR #7177 on branch 1.x (Added the Selection of cells till Top and Bottom)
@adityar-r
Copy link
Contributor Author

Thanks a lot, and same here. It would be great to have platform specific key bindings.

@adityar-r
Copy link
Contributor Author

adityar-r commented Oct 12, 2019

@jasongrout there has been a slight error in the key bindings above, and has been corrected.
As with the list views the key bindings are correct.
I sincerely apologise for the same.

For Ubuntu(Linux):

Application Selection Type Select to Top Select to Bottom Consecutive Behaviour
VS Code Text Ctrl + Shift + Home (Shift + Page Up) Ctrl + Shift + End (Shift + Page Down) Last Extreme
LibreOffice Writer Text Ctrl + Shift + Home (Shift + Page Up) Ctrl + Shift + End (Shift + Page Down) Last Extreme
LibreOffice Calc * Object Column: Ctrl + Shift + Up Arrow Column: Ctrl + Shift + Down Arrow None
HTML TextArea in Firefox Text Ctrl + Shift + Home (Shift + Page Up) Ctrl + Shift + End (Shift + Page Down) Last Extreme
LibreOffice Calc : Shift + Home, Shift + End -> Selects upto the last extreme top of current column and last extreme bottom of current column respectively.

@lock lock bot added the status:resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion. label Nov 11, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Nov 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status:resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants