DavidoTek / ProtonUp-Qt

Install and manage GE-Proton, Luxtorpeda & more for Steam and Wine-GE & more for Lutris with this graphical user interface.
https://davidotek.github.io/protonup-qt
GNU General Public License v3.0
1.25k stars 40 forks source link

Batch Update: Use UI file & UX Improvements #325

Closed sonic2kk closed 9 months ago

sonic2kk commented 10 months ago

I know I already have a meaty enough PR open for a UI change (#319), and that soon I'll be taking a look at another CtInfo dialog change for anti-cheat runtimes (#186) so no hurry to review this. I wanted to get it up and document the changes here while it was all fresh in my head.

Overview

This PR moves the Batch Update dialog to use a Qt UI file and makes a couple of UX tweaks. It's a similar vein to what I did for Custom Install Directory in #225.

I think these changes make the Batch Update dialog a little bit more user-friendly. I have provided some sample screenshots below that I hope will show the improvements.

Implementation

Fetching the Compatibility Tool List

As noted above, we fetch the list of installed compatibility tools in the Batch Update dialog. But to allow the dropdown to be disabled if no other supported tools are installed, we have to know the current ctool name. We can get this from the displayname of the ctinfo dialog, since Batch Update is called from that dialog we already have that compatibility tool context.

I also changed how we build the dropdown elements, using a list and calling addItems. The filtering is done in a list comprehension instead of in the for loop.

All these changes should have a negligible performance impact.

Warning Labels

I created a helper method to generate warning labels. This creates a QLabel and adds it to a FormLayout, which the Batch Update dialog uses. We give this as an argument to add_warning_message but we could hardcode it to just use self.ui.formLayout. Finally we also pass a stylesheet, because the Steam Running warning uses orange text since it's a warning that won't prevent the user from performing the batch update, but the missing compatibility tools message uses red text since we do prevent the user from performing the batch update. Taking an optional stylesheet made this simpler. Finally we of course give this method the text to use.

These labels are centered solely because I thought it looked nicer. I also used a full stop on both labels because it's there for the Steam Running warning on main, but it could be taken out if it's not necessary. On the Games List we use an exclamation mark, maybe we could do that here too :slightly_smiling_face:

These labels are generated and added programmatically in an if/elif/else block, because it doesn't make sense imo to show both at once. The "no compatibility tool" message takes priority because it doesn't matter if Steam is running or not, Batch Update cannot be performed. The user would have to close the dialog anyway to install the new tool or to update the list of compatibility tools if a new one was added while the dialog was open. That's why only one is shown at a time, and why the No Compatibility Tools message takes precedence. I hope I explained that well enough.

Doing things in this way also made managing the layout easier. The label row is "structurally important" to the UI, which I'm not very pleased about, but it was better than fitting it into the bottom left and making the dialog wider just to accommodate that label. Putting the labels here would be less natural than it is for the Games List which puts the Steam Running label here. It might also be tricky, as we would have to programmatically set the label text, as having both labels at once would still lead to "structurally important" label placement.

On the subject of structurally important labels, that's why we have the "spacer label" in the else block. It allows for that bit of spacing between the form layout and the Batch Update and Close buttons, which imo it looks better to have the space there than under the buttons.

Comparison

Main Branch

image

This PR

No Supported Compatibility Tools

image

Steam Client Running

image

Happy Migration Path

image

Considerations

I have a couple of thoughts on the current state of this PR. While everything is functional there are some points that might merit discussion :slightly_smiling_face:

Here is the screenshot to illustrate how the "Batch Update" button on the ctinfo dialog and Batch Update dialog are more visually distinct by having the Batch Update's button on the right:

image


I think that covers it. I hope these are good improvements, in my opinion it makes the UI a bit cleaner and feel a bit more consistent with the rest of ProtonUp-Qt, and gives some practical advantages such as being able to close the dialog with a dedicated button. But I made the PR so of course I'm a little biased :wink:

Please let me know if you have any other feedback on these changes or any further changes that should be made while I'm poking around this part of the code.

Thanks! :-)

sonic2kk commented 10 months ago

Made a small phrasing change to the description text and updated the screenshots accordingly.

sonic2kk commented 10 months ago

I'm wondering if we should add a small horizontal line between the description text and the form layout. We don't do this on the Custom Install Directory, but since we don't have any text labels, the distinction is more obvious. But since the first element in the form layout here is a label, the text can kind of blend together.

If we move the dropdown to be the first element, it would fix this problem, otherwise a horizontal rule may help a little. We'd have to slightly increase the dialog height by 10 to accomplish this though. I did a quick implementation in Qt Designer and to be honest I'm not sure what the best approach is.

Horizontal Rule

image

New Version being 1st Row (No Horizontal Rule)

image

New Version being 1st Row (With Horizontal Rule)

image

Not sure if adding this line, moving the "New Version" row to be the 1st row, both, or no change at all is the best approach :sweat_smile: Also, having "New Version" as the first row throws me off slightly, since the width of the "Old Version:" label is slightly shorter, so the labels go in descending order of width instead of ascending order, which in this instance I find the latter (current implementation in this PR) more aesthetically pleasing.

If we don't want a horizontal rule another potential change is to make the "Old/New" version labels bold, although I don't think I like this change much compared to the above proposal. It would be inconsistent and a bit too "loud". A horizontal line is much more subtle imo.

It's late and maybe I'm getting too deep in a rabbit hole of minor UI details but any input is greatly appreciated :smile:

DavidoTek commented 9 months ago

Thanks!

Disable the "Batch Update" button on the dialog itself if no compatibility tools to migrate to are found.

Aren't we already doing that with self.ui.btnBatchUpdate.setEnabled(len(self.games) > 0) in the Ct Info Dialog?

I also changed how we build the dropdown elements, using a list and calling addItems. The filtering is done in a list comprehension instead of in the for loop. All these changes should have a negligible performance impact.

I'd think that it improves the performance as this reduces the amount of calls to the Qt bindings.

it doesn't make sense imo to show both at once. The "no compatibility tool" message takes priority because it doesn't matter if Steam is running or not, Batch Update cannot be performed.

That makes sense.

Not sure if "Batch Update" should be right-aligned with the "Close" button or if we should put it on the left.

I think it's fine like it is now. It also matched the install dialog where the "install" button is also right-aligned.

Related to the above, should the text still say "Batch Update" or should we change it to something more 'standard' such as "Ok" or "Confirm".

I think we can also leave this as is. Makes it more obvious when only skimming the text.

If there are tools to batch update to, should we default to a compatibility tool at all, or set the default entry to something like -- Select --?

Hmm. I think currently it shows the first compatibility tool sorted alphabetically which results in showing the newest one, which is fine I guess.

I am unsure if the "Old Version" label in Batch Update should be the 1st or 2nd row. On one hand, "logically" the ordering makes sense, but since the user interacts with the dropdown and not the "old version" label, it may make more sense to have this on the 1st row...

I think the user would read the dialog from top to bottom, so having everything informative first and then the options is good, the exception here being the warning text. But that shouldn't matter too much as it is in a highlighting color.

All feedback on label phrasing is welcome! I'm not super attached to any of the wording so anything you think is an improvement can be changed.

I guess it is fine :)

Super duper mega semantic: Should we camel case the "Batch update" button in ctinfo? 😅

If you mean writing both words uppercase like Pascal case but with a space inbetween "Batch Update", that's fine. I guess it would make sense as "Batch Update" isn't a sentence. :smile:

Here is the screenshot to illustrate how the "Batch Update" button on the ctinfo dialog and Batch Update dialog are more visually distinct by having the Batch Update's button on the right:

Yes, look quite distinctive, then let's leave it like this.

I hope these are good improvements, in my opinion it makes the UI a bit cleaner and feel a bit more consistent with the rest of ProtonUp-Qt, and gives some practical advantages such as being able to close the dialog with a dedicated button. But I made the PR so of course I'm a little biased 😉

Yeah that's very good indeed, thanks. The close button will also help on the Steam Deck or if the CSD breaks again ...

I'm wondering if we should add a small horizontal line [...]

Hmm, not sure if a separating line belongs there. I guess it looks a bit cleaner, but it could give the user the incentive to skip the text.

sonic2kk commented 9 months ago

Aren't we already doing that with self.ui.btnBatchUpdate.setEnabled(len(self.games) > 0) in the Ct Info Dialog?

Note quite, this is for the compatibility tools. Say we're using GE-Proton8-25, and we have 10 games using that tool. We can still press "Batch Update", but if we only have that tool installed, and no other custom tools, then there are no tools to Batch Update to. The dropdown would show the current tool on main, but this PR removes that, so the dropdown on batch update would be empty.

We don't disable the "Batch update" button on the CtInfo dialog if no other compatibility tools to batch update to are found. I considered making that change but figured there was no need to make the change there, CtInfo in most cases doesn't need to be aware of other installed compatibility tools. But the Batch Update dialog will be aware of those tools and will be fetching them anyway, so I figured it makes more sense to still allow showing the dialog, but disabling the dialog functionality, with a warning message explaining why the action cannot be performed. That way a user can see what the issue is instead of the button on the CtInfo dialog mysteriously disappearing/reappearing or sometimes being enabled/disabled, it's a more visual way for a user to know why the action cannot be performed. And it means we don't have to make the CtInfo dialog aware of other installed tools, we have to fetch them for Batch Update anyway so we just keep the logic on the Batch Update dialog instead of introducing new logic to check installed compatibility tools in the CtInfo dialog.

Sorry if I didn't explain it right but the change I made was to disable "Batch Update" on the Batch Update dialog if there are no other tools to move the games to.

I think it's fine like it is now. It also matched the install dialog where the "install" button is also right-aligned.

Sounds good to me :+1:

I think the user would read the dialog from top to bottom, so having everything informative first and then the options is good, the exception here being the warning text. But that shouldn't matter too much as it is in a highlighting color.

All good then :smile: Happy to leave it as-is.

If you mean writing both words uppercase like Pascal case but with a space inbetween "Batch Update", that's fine. I guess it would make sense as "Batch Update" isn't a sentence. 😄

Heh, this was super unimportant I know, but I like being thorough and getting as much feedback as possible.

Hmm, not sure if a separating line belongs there. I guess it looks a bit cleaner, but it could give the user the incentive to skip the text.

Ah that's a good point, maybe we can just leave it as-is then (no changes for it were pushed to this PR, I made those changes quickly and took a screenshot, didn't commit them).


Thanks for the responses as always, I'll take a look at addressing some of the feedback now :-)

sonic2kk commented 9 months ago

Okay, think I got all the feedback addressed:

DavidoTek commented 9 months ago

Note quite, this is for the compatibility tools

Ah, that makes sense. I didn't consider that there are two different things we are dealing here.

Heh, this was super unimportant I know, but I like being thorough and getting as much feedback as possible.

Making ProtonUp-Qt look as professional as possible isn't that unimportant :smile:

Okay, think I got all the feedback addressed:

Thanks! I will merge this now.