Skip to content

[Feature]: Improved flow for Add Resource to Library dialog #5885

@kwvanderlinde

Description

@kwvanderlinde

Describe the Problem

I've been digging into the Add Resource to Library dialog, and noticed a number of issues with UX once the Install button is pressed. These are particularly apparent when installing multiple libraries.

  1. The dialog disappears right away, relinquishing control back to the user. Sounds good at first, except that modal popups will soon appear anyway, taking control right back. The Add Resource to Library dialog should remain open while the libraries are being downloaded, showing the user a cancelable progress bar just in case it takes too long.
  2. If a library fails to install (download, extract, or otherwise), the user is shown a modal dialog say that the library failed to download. Several problems here:
    • It gets shown once for each failure.
    • It doesn't say which library failed to download, i.e., the same message gets repeated per failure.
    • If there is a failure midway through extracting, partial results will already be in the user's ~/.maptool-rptools directory.
  3. Post-installation, the user is shown each library's license. Again, multiple issues in this step:
    • No option to not accept the license (it's too late, already installed)
    • The dialogs for each license don't wait for the previous one to be hidden. So the user ends up with a bunch of stacked dialogs.

The Solution you'd like

This is how I would expect the Add Resource to Library dialog to have the following behaviour:

  1. The dialog would remain open until the installation of all selected libraries is completed.
  2. Download and extract libraries to a temporary location before moving them to a permanent location. In case of failure, delete the partial results from the filesystem so we don't pollute it.
  3. When reporting errors, report all affected libraries together rather than one-by-one.
  4. Give the user the opportunity to reject a license they don't like. Rejecting a license cancels the installation of that particular library.

The full flow would look like this:

  1. User picks the libraries they want to install.
  2. If user cancels the dialog, close the dialog and do not continue with the subsequent steps. Otherwise, if they select Install, proceed.
  3. Download and extract all selected libraries to a temporary location. Show the user the progress in some way, and allowing them to cancel if it is taking a long time.
  4. If the user canceled the previous step, close the dialog, abort the downloads and do not continue with subsequent steps.
  5. If any libraries failed to download, report this to the user at this point. Include the list of libraries that failed (or some subset with a count if it is a long list).
  6. For each successful library download, one by one:
      1. Show the license to the user, allowing them to accept or reject it.
    1. If the user rejects the license, delete the extract library from the temporary location and continue on to the next library.
    2. Otherwise, move the extracted library to a permanent location. If this fails, add the failure to a list.
  7. If any failures were recorded in (6.iii), report them to the user in a single message.
  8. Finally, close the Add Resource to Library dialog.

Alternatives that you've considered.

No response

Additional Context

This is what we get after installing four libraries at once on 1.18.5:
Image

Similarly, when there are multiple failures downloading or installing libraries, this dialog is displayed once for each failure, though they don't stack like the license dialogs:
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureAdding functionality that adds value

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions