posit-dev / positron

Positron, a next-generation data science IDE
Other
2.27k stars 68 forks source link

Overlap between R shortcuts / keybindings and positron ones #2423

Closed EmilHvitfeldt closed 1 day ago

EmilHvitfeldt commented 5 months ago

Positron Version:

Positron Version: 2024.03.0 (Universal) build 893 Code - OSS Version: 1.87.0 Commit: 864257d0a5e7131c1c3bbe891deefc09b3811f47 Date: 2024-03-05T03:24:32.501Z Electron: 27.3.2 ElectronBuildId: undefined Chromium: 118.0.5993.159 Node.js: 18.17.1 V8: 11.8.172.18-electron.0 OS: Darwin arm64 23.3.0

Steps to reproduce the issue:

  1. try different keybindings, Explorer Cmd + Shift + E, Run and debug Cmd + Shift + D

https://github.com/posit-dev/positron/assets/14034784/8ec3c921-16aa-4b29-bf27-14aa6f7aa11b

What did you expect to happen?

Some of the listed keybindings on hover doesn't work because they are superseded by R package development commands.

I don't know if it would possible to hide the incorrect shortcuts.

As far as I can tell, I don't have any custom keybindings, so this is vanilla

Were there any error messages in the output or Developer Tools console?

Nope

juliasilge commented 5 months ago

This is a duplicate of #2150 but maybe the right call is to move these keyboard shortcuts to the RStudio Keymap extension. This would not get rid of the actual problem (on hover, you see a keybinding that does not actually apply in your current situation) but it would mean that a) folks opt IN to using it and b) fewer users total would be in this situation.

lionel- commented 4 months ago

Notes from the duplicate issue that I filed at https://github.com/posit-dev/positron/issues/2673:

We currently define a bunch of "cmd+shift+" bindings in the R extension. These are high value bindings that are more likely to cause conflicts with existing Code/Positron bindings, for instance we bind "cmd+shift+e" to check a package inside R projects which conflicts with the regular keybinding to show the file explorer.

Now that we have an RStudio keymap extenstion (https://github.com/posit-dev/positron/pull/2067) I think this frees us to come up with default keybindings that are less likely to conflict with the larger ecosystem. We could:

I've filed this issue in the RC milestone but I would personally bump it to Public Beta.

lionel- commented 4 months ago

@hadley mentions Cmd+R would be an obvious prefix. It doesn't seem to be used for anything important:

Screenshot 2024-04-19 at 15 33 03

juliasilge commented 4 months ago

During our private beta Q&A session, there was some discussion of folks who want to use the R package development shortcuts but not opt in to the RStudio keymap FWIW.

hadley commented 4 months ago

One reason Cmd + R isn't used for anything important is because it probably can't be remapped in the browser, since it's used for refresh.

lionel- commented 2 months ago

I'm experimenting with this keymap. The Cmd+' prefix is available and easy to type on qwerty. Feels good so far!

Screenshot 2024-05-31 at 09 45 03

Is there any reasons we'd not be able to use this prefix?

Edit: We might want to namespace dev keybindings further in Cmd+' Cmd+D. This way we can add a bunch of other usethis based commands within that namespace while keeping the main prefix available for other positron gestures. For instance I'd love:

juliasilge commented 1 day ago

We have collected a number of issues that are related to this problem where the UI always shows a built-in keybinding, even when that keybinding does not apply to that action. The user might end up looking at the UI and trying that keybinding, but it does something completely different. Let's use #2150 to track this problem.