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

Overwriting shortcuts via the GUI is not working on Mac #16186

Open
kolibril13 opened this issue Apr 18, 2024 · 14 comments
Open

Overwriting shortcuts via the GUI is not working on Mac #16186

kolibril13 opened this issue Apr 18, 2024 · 14 comments
Labels
bug os:macos Issues specific to macOS operating system
Milestone

Comments

@kolibril13
Copy link

just tried pip install -U --pre jupyterlab on a Mac, and overwriting shortcuts via the GUI is not working:

Screen.Recording.2024-04-18.at.13.02.31.mov
@kolibril13 kolibril13 added the bug label Apr 18, 2024
@jupyterlab-probot jupyterlab-probot bot added the status:Needs Triage Applied to new issues that need triage label Apr 18, 2024
@jtpio jtpio added this to the 4.2.0 milestone Apr 18, 2024
@krassowski
Copy link
Member

@kolibril13 I cannot reproduce this in 4.2.0b1 but I am not on a Mac. I would be slightly surprised if this was OS-specific - did you try on a different OS already? Is there anything in the browser dev console? Can you try with a different shortcut and a different keybinding?

works-for-me

@kolibril13
Copy link
Author

interesting! I did
python3.12 -m venv .venv && source .venv/bin/activate
pip install -U --pre jupyterlab
jupyter lab

on MacOS + Safari
The console does not show anything, but the magnification glass looks a bit bigger:

Screen.Recording.2024-04-18.at.15.56.59.mov

I don't have another OS, but I've tried once in Firefox, everything is fine there, shortcut-reassigning works!

image

Overwrite in Google Chrome works as well, so I guess this is a Safari-Only issue.

@krassowski
Copy link
Member

Also works well on GNOME Web 45 (Epiphany, uses same webkit engine as Safari). What version of Safari do you use? The magnifying glass icon is concerning, again works well on Epiphany

@kolibril13
Copy link
Author

Safari Version 17.4.1 (19618.1.15.11.14)

@kolibril13
Copy link
Author

and another observation: on firefox, changing the second shortcut does not work:
it changes the first shortcut instead

Screen.Recording.2024-04-20.at.13.30.29.mov

@kolibril13
Copy link
Author

same behaviour on google chrome.
And another observation:
the new assigned shortcut for "Toggle block comment" does also not work in Google Chrome and in Firefox (have not tried other browsers)
image
triggering has no effect on:
image

I also tried another custom shortcut binding: Insert cell above, and that one did work.

@krassowski
Copy link
Member

Thanks for extra testing @kolibril13!

changing the second shortcut does not work: it changes the first shortcut instead

I can reproduce this, it is a bug. I think it deserves its own issue as it is not Mac specific.

the new assigned shortcut for "Toggle block comment" does also not work

It does not have any effect in Python because CodeMirror Python mode does not define block comment syntax for Python. Technically it is right - Python does not have block comments, although multi-line strings are de facto used for this purpose. This is documented here:

label: trans.__('Toggle Block Comment'),
caption: trans.__(
'Toggles block commends in languages which support it (e.g. C, JavaScript)'
),

and here:

- the shortcuts for toggling line comments (by default <kbd>Ctrl</kbd>+<kbd>/</kbd>) and block comments (by default <kbd>Alt</kbd>+<kbd>A</kbd>) can be customized in the Shortcuts Editor, enabling users of non-US keyboards to adjust the keybinding to one optimal on their keyboard layout. Please note that the block comment only works in languages which have a dedicated block comment syntax defined in the CodeMirror language data (e.g. C, JavaScript, but not Python). The line comment shortcut can be also used to comment out multiple lines.

Please note that the block comment only works in languages which have a dedicated block comment syntax defined in the CodeMirror language data (e.g. C, JavaScript, but not Python). The line comment shortcut can be also used to comment out multiple lines.

So there are two ways forward:

  • work on adding the caption in the UI to expose this info more because users don't read past changelogs.
  • propose adding multi-line comments as block syntax for Python upstream in CodeMirror (if you feel like this is the way forward please open an issue on https://github.com/codemirror/dev/issues and link it back here)

@kolibril13
Copy link
Author

I can reproduce this, it is a bug. I think it deserves its own issue as it is not Mac specific.

Good to know, I've opened #16211 for this.

So there are two ways forward:

  • work on adding the caption in the UI to expose this info more because users don't read past changelogs.
  • propose adding multi-line comments as block syntax for Python upstream in CodeMirror (if you feel like this is the way forward please open an issue on https://github.com/codemirror/dev/issues and link it back here)

I will forward this report, as this feature would benefit a lot of people with non US keyboard layouts! :)

@krassowski
Copy link
Member

@kolibril13 when reporting issues upstream it is better to include all details and follow the issue template carefully. The upstream maintainers are kind to help us in their time and we should respect it by making it as easy for them as possible :)

@kolibril13
Copy link
Author

Noted. Thanks for adding these details! :)

@krassowski
Copy link
Member

Thank you for testing and help with the issues!

@kolibril13
Copy link
Author

Thanks! :) I also really appreciate your dedication to make Jupyter better and more accessible with every release!

@JasonWeill
Copy link
Contributor

I can also reproduce the bad behavior noted in Firefox on macOS. Thank you for your contribution!

@JasonWeill JasonWeill added os:macos Issues specific to macOS operating system and removed status:Needs Triage Applied to new issues that need triage labels Apr 23, 2024
@krassowski
Copy link
Member

@JasonWeill can you reproduce it with #16214?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug os:macos Issues specific to macOS operating system
Projects
None yet
Development

No branches or pull requests

4 participants