Skip to content

Instantly share code, notes, and snippets.

@ancorgs
Last active February 13, 2019 09:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ancorgs/67dcd8a52debd95496137a1cd5bacf6f to your computer and use it in GitHub Desktop.
Save ancorgs/67dcd8a52debd95496137a1cd5bacf6f to your computer and use it in GitHub Desktop.
Select Devices

Improving the "select disks" screen

See the "Improve devices selection in the Guided Setup PBI.

We basically have to answer three questions.

  1. Which information to display for each device?
  2. Which widget to use for a reasonable number of disks?
  3. Which widget to use for an insane number of disk?

(1) Information to display for each device

Possible information

  • BlkDevice#name -> "/dev/sda"
  • BlkDevice#size -> "320.00 GiB"
  • DiskAnalyzer.installed_systems -> "Windows, openSUSE Leap 42.3"
  • Disk#transport -> "SATA", "USB". More info below.
  • Vendor -> "usb 0x8644 General", "usb 0x8564 JetFlash"
  • Model -> "General USB Flash Disk", "ST31000524AS", "JetFlash Trascend 8GB"

The possible values for transport are "UNKNOWN", "SBP", "USB", "ATA", "SATA", "SAS", "iSCSI", "SPI", "FC" and "FCoE". See the corresponding section of the man page of lsscsi for the descriptions. As pointed by HuHa in Irc, only some values are really useful for most users to distinguish the disk (like "USB" or "SBP", which refers to IEEE 1394 devices). Most of the values are in fact a low level detail that is more likely to add confusion that to help.

Current information

Currently we display the following information

  • BlkDevice#name
  • BlkDevice#size
  • DiskAnalyzer.installed_systems

Current screen

(2 and 3) Possible widgets

Current UI

It's the best-looking one and the usage is obvious, but it only scales up to something like 15 disks (see the screenshots with 30 elements, which it's unusable both in Ncurses and Qt).

N nCurses Qt
3 current-curses-3 current-qt-3
10 current-curses-10 current-qt-10
30 current-curses-30 current-qt-30

With MultiSelectionBox

Scales to any size and the usage is obvious. But it looks weird in QT with few elements, because of the colored background and because it doesn't always react to HSquash and/or HStretch and one could expect (it tends to cut the text when not really needed). Maybe it's possible to make it look better with some extra Libyui magic I was not able to spell.

N nCurses Qt
3 multiselect-curses-3 multiselect-qt-3
10 multiselect-curses-10 multiselect-qt-10
30 multiselect-curses-30 multiselect-qt-30

With a table with multiSelection

Scales to any size... including horizontally, if we decide to add more info for each disk. In Qt it tends to look weird, specially with few elements because, just as the MultiSelectionBox, it's hard to make it fit nicely in the layout.

Moreover, the multi-selection feature (ctrl+click) is not obvious at all in Qt (in my experiments, I would say it even works in a slightly bogus way). In ncurses is obvious that you are supposed to mark one or several lines, but that's not the case at all in Qt.

N nCurses Qt
3 table-curses-3 table-qt-3
10 table-curses-10 table-qt-10
30 table-curses-30 table-qt-30
@joseivanlopez
Copy link

joseivanlopez commented Feb 13, 2019

My vote goes to:

Information to show

  • BlkDevice#name -> "/dev/sda"
  • BlkDevice#size -> "320.00 GiB"
  • DiskAnalyzer.installed_systems -> "Windows, openSUSE Leap 42.3"
  • Disk#transport -> "SATA", "USB".

Yes, some transports could not be useful, but others are. I would prefer to have that information, at least USB devices are quite obvious.

Widget

I like none of them too much. Having said that, I don't see the table a valid option at all in QT because it is quite confusing (although in ncurses it really looks good!). The multi-select-box option is a better approach (IMHO), but it is true that there is too much white space around. Don't you consider the "double table" a possible alternative? See the following screenshot:

two_tables

@joseivanlopez
Copy link

And what about using different widgets depending on the number of available devices and UI type?

  • Available devices <= N

    • Current UI
  • Available devices > N

    • QT: e.g., double table
    • ncurses: table with multiselect

Probably this breaks the philosophy of YaST, where the same UI should be used for both, text and graphical modes.

@ancorgs
Copy link
Author

ancorgs commented Feb 13, 2019

Replying to Iván proposal of the "double table":

That eats all the horizontal space with no clear benefit (other than maybe being less ugly). We need that horizontal space for things like:

  • /dev/sda, 50.00 GiB, USB, Windows, Fedora 17 (Beefly Miracle)

And about having two possible interfaces for the case Available devices > N:

That will be the less used scenario. So we better keep it simple/consistent to avoid breakage there.

People trying to use the Guided Setup in a machine with more than 10 candidate disks should be ready to deal with some ugliness.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment