Chrysalis icon indicating copy to clipboard operation
Chrysalis copied to clipboard

Host layout selection issues

Open algernon opened this issue 4 years ago • 4 comments

Describe the bug

The widget letting us select the host-side layout has a number of shortcomings: ordering is weird, the initial rendering is slow, and searching isn't very convenient either.

To Reproduce

Steps to reproduce the behavior:

  1. Go to the Editor screen.
  2. Click on the "Linux layout" (or "Windows", or "macOS") dropdown.
  3. ~~Observe it takes a long time to open.~~
  4. ~~Open the developer console, and observe that we have a warning about it too ([Violation] 'click' handler took 1150ms)~~
  5. ~~Scroll around, and observe that the language groups aren't sorted by their display name (Chinese is sorted after English), but their language code instead.~~
  6. ~~Also observe that Material-UI complains about having duplicate headers.~~

Expected behavior

~~The selector should open much faster, and sort the languages by their display name.~~

We should also display a preview of the layout, perhaps not while scrolling in the dropdown, but once a layout is selected, so that we can double check that it is the one we seek, without having to go to the keymap editor.

algernon avatar Jan 28 '21 18:01 algernon

IF possible the selector should initaly show the installed / active layouts on the users system first, and only search through the whole list as a second step.

Sadly, I don’t believe operating systems offer us that information. On May 2, 2021, at 10:16 AM, just_A_key @.***> wrote:  IF possible the selector to initaly show the installed / active layouts on the users system first, and only search through the whole list as a second step. — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

I believe Windows has something like https://docs.microsoft.com/en-us/dotnet/api/system.windows.forms.inputlanguage.installedinputlanguages?view=net-5.0

isipka avatar May 02 '21 17:05 isipka

Sadly, I don’t believe operating systems offer us that information.

On May 2, 2021, at 10:16 AM, just_A_key @.***> wrote:

 IF possible the selector to initaly show the installed / active layouts on the users system first, and only search through the whole list as a second step.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

obra avatar May 02 '21 18:05 obra

We have made some progress on this: we're pregenerating the data now, so opening is much, much faster. Other issues still persist.

This is pretty similar to #1010, and since this was sooner, I'll close that one.

algernon avatar Jul 27 '22 00:07 algernon

With #1018 and #1019, and the CLDR data pregeneration already implemented on master, this issue is largely addressed.

One thing we talked about with @obra, which has not been mentioned here yet, is that ideally, we'd want to load both osx and windows layouts, and - by default - offer only the set available for the current platform. Linux would default to Windows (the chromeos layouts are unsuitable for our use case), because in my experience, the two largely agree on layouts, but both of them seem to disagree with osx from time to time.

algernon avatar Jul 27 '22 10:07 algernon