-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
machines: replace os-vendor/os dropdowns with TypeAheadSelect component from PF-react #12152
Conversation
KKoukiou
commented
Jun 25, 2019
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fine, nice cleanup! Looking forward to test this in action. Two questions, and can you please rebase?
A single list will mean that it's harder to operate with just the mouse, as it will be a looong merged list, right? Is that an a11y concern? (I didn't yet test this, waiting for the rebase) |
On the other hand you are able to filter results by typing some substring of the desired distro. |
Right, I personally like this a lot, but I'm a very keyboard-affine person. I was just wondering what that means for mouse users. Also, right now I can type arbitrary strings into that box, like "foo", and there is no error message. It should only be allowed to select an existing entry. |
This is problematic as-is. I discussed this with @andreasn and have an idea on how to incorporate this into a working design which would allow:
It would basically be two side-by-side components in the dialog. I don't have time right now to work on a proper mockup, but I'm adding a table-based sketch on what I have in mind. The first column is the label. The second is a select with several options. The third is either a text string for the auto-detect, an input and auto-complete list for search, or a second dropdown for OS version (when browsing based on vendor on the first dropdown)
It would default to auto-detection. If that doesn't work, the option becomes disabled and then the next selection option should be search, which has the widget from this PR. People can optionally browse by drilling down with vendors and distribution versions, which are then grouped by supportability. Note: One thing I didn't mock-up is showing supportability in the search or even auto-detection... but this should be shown somehow. |
I agree that this becomes very keyboard focused, and there need to be some way to manually select an OS, without knowing exactly what to type. Just showing the entire list straight up and down would end up being quite a long list. |
But if we go for the 2-field solution that @garrett proposes, do we really need "Auto-detect" as a dropdown? I think we could just show the right entry in the list and not make a big fuzz about it (just like how it works now), then you would be able to correct that selection, or go for the Search action. |
Relevant info, recognition vs recall, see bullet point 3. |
How long does it take to check? We could have a placeholder message and then replace it with a widget similar what I described if it fails to detect (except without autodetect). If it doesn't take long. And if it doesn't get it wrong. |
Which of the mentioned examples you mean?
It's long, filtering with substrings helps only in this case.
I don't think this component allows such logic to be implemented.
It's possible to query osinfo-db for EOF for each OS. |
It's a matter of 1-2 seconds after inserting the installation source.
It can't really get it wrong, it can only not get it at all. |
This was false actually. I didn't have libosinfo installed and didn't realize I needed to. |
You don't have libosinfo installed because you built cockpit-machines from sources and you don't have its dependencies.
Probably the order get's messed up somewhere indeed. |
It seems I can also write in anything in freeform now. I tried writing "lennart" and it happily accepted that. Should we check that whatever is written actually matches with a real OS name? Otherwise there is the risk you'll get weird results because someone mistypes "Windows Server 2012" as "Qindows Aerver 2012" or stuff like that and the installation fails due to not setting some flag right. |
Yes, this issue is already mentioned here #12152 (comment), I am going to address it if we agree to use this approach. |
…nt from PF-react Having two entries for information that can be fetched with one element is not user friendly. This commit simplifies the OS related entries in Create VM dialog, by replacing the dropdowns with a TypeAheadSelect component from PF-react. The new component has better support for indicating that the OS is being autodetected by showing a spinner. Closes cockpit-project#12152
All OS data are coming from libosinfo but until this commit we had this extra 'Other OS' attribute appearing on list. Since this is not original data from libosinfo just drop it. Users who don't want to specify an OS will just not autofill the OS dialog field.
Always hide OSes from the list which are either with too old release date or too old EOL date. Tests were adjusted to not try to use OSes which will not be included in the list anymore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! This works very well now, I didn't manage to break it any more.
tests seem fine now, kkoukiou answered about your review comments
…nt from PF-react Having two entries for information that can be fetched with one element is not user friendly. This commit simplifies the OS related entries in Create VM dialog, by replacing the dropdowns with a TypeAheadSelect component from PF-react. The new component has better support for indicating that the OS is being autodetected by showing a spinner. Closes #12152