Theia: [outline] 'format document' and 'toggle outline view' have a keybinding collision

Created on 21 Oct 2019  路  15Comments  路  Source: eclipse-theia/theia

Description

As a user, I cannot use the keybinding for the command format document as it is being used to toggle outline view. The workaround is to use the context menu, but I do not believe it gives a proper user experience.

How to test

  • Open a file (ex: cpp-keybindings.ts)
  • Attempt to use the keybinding to format the document (ctrl+shift+i)
  • Notice the Outline View is toggled instead

Additional Information

  • _OS:_ Linux Ubuntu 16.04
  • _Theia:_ f255f5a
OLinux help wanted keybindings outline

Most helpful comment

ok, could someone send a PR removing the keybinding for the outline on Linux for now?

Sure, I can take care of it.

All 15 comments

I can confirm this is an annoying issue
Also, CTRL + Shift + I is used by Chromium to open the dev tools.

What would be the better keybinding to toggle the outline on Linux?

@akosyakov I think the main problem is that Chromium (for example) handles some shortcuts before the web page can. To solve this, you can make Theia installable as a Progressive Web App and then this shortcut story is much more similar to Electron but without Electron and all it's bloat and unportability (isnt trivial to patch for IBM POWER machines even though I've done it for some versions).

My workstation is a RaptorCS Talos II, with IBM POWER CPU.

Once that is done, use exactly the same keyboard shortcuts as VS Code and it will be perfect!

To solve this, you can make Theia installable as a Progressive Web App and then this shortcut story is much more similar to Electron but without Electron and all it's bloat and unportability (isnt trivial to patch for IBM POWER machines even though I've done it for some versions).

That's another issue. But since you mentioned do you have a reference link confirming it. I had it before but never had time to double check whether PWA actually handles keybindings differently or could find any confirmation.

@akosyakov Can't find any reference but I read it at several places over the web. I'll give it a few tests with Chromium and Epiphany (GNOME WebKit based browser) which both support installing PWA.

My muscle memory is on Ctrl + Shift + I so I kind of want to keep that :yum:

But I wish Chromium did support disabling some keyboard shortcuts.

Otherwise I'll have to study better defaults because that's always tricky since if you change one shortcut you most certainly have to change lots of them since they are almost all taken. I personally don't need a shortcut for the outline view which I almost never use.

But I wish Chromium did support disabling some keyboard shortcuts.

We all wish, like Ctrl+W. And Chrome does support it for dedicated windows like pop ups. I wonder whether PWA counts like a pop up window, but there are other issues then 馃槵

hey could we disable shortcuts for outline? this not frequently used, and user would just click on the sidebar to toggle. WDYT?

hey could we disable shortcuts for outline? this not frequently used, and user would just click on the sidebar to toggle. WDYT?

I don't think disabling a keybinding for a view would be a viable way forward, we should instead find a keybinding that can be used with the proper when context.

Hello @vince-fugnitto :)

I don't think any user would ever have to use a short-cut for a particular view. Maybe shortcuts for navigating from one view to another, toogle the editor fullscreen, or switching through predefined layouts, etc ... having a shortcut for all the specific view is definitely not a viable way forward.

Can you elaborate your meaning of "viable way forward" ?

@vince-fugnitto removing the outline keybinding sounds better than what is happening right now or at least till someone proposes another solution or shortcut. Not working format document kebinding is quite bad.

There are also already a way to open the outline with keyboard: F1 -> type Outline -> Enter

We could also consider to add a keybinding for Open View... instead, so one can open any view with keyboard.

@sunix

Hello @vince-fugnitto :)

I don't think any user would ever have to use a short-cut for a particular view. Maybe shortcuts for navigating from one view to another, toogle the editor fullscreen, or switching through predefined layouts, etc ... having a shortcut for all the specific view is definitely not a viable way forward.

I disagree, views should be keyboard operable, just like in other major IDE products.
At least for those contributed by the framework itself, it should be possible to open views by keyboard shortcuts similarly to vscode.

Can you elaborate your meaning of "viable way forward" ?

I mean that removing a keyboard shortcut for a view does not look like the best solution, we are choosing to fix a problem of loss of functionality (inability to run the command 'format document' by a keyboard shortcut) by removing functionality in another area. We should instead find a solution which fixes both, meaning finding a keybinding that can work in both cases.

@vince-fugnitto removing the outline keybinding sounds better than what is happening right now or at least till someone proposes another solution or shortcut. Not working format document kebinding is quite bad.

If it's the worse of the two then we can opt to removing the keybinding for now so users can have the ability to format document. It's true that we have the open view... command, but I also feel like the best solution would be to find a keyboard shortcut that works for both cases.

ok, could someone send a PR removing the keybinding for the outline on Linux for now?

ok, could someone send a PR removing the keybinding for the outline on Linux for now?

Sure, I can take care of it.

Was this page helpful?
0 / 5 - 0 ratings