Skip to content
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

Rework overlays #1402

Merged
merged 10 commits into from
May 23, 2024
Merged

Rework overlays #1402

merged 10 commits into from
May 23, 2024

Conversation

halgari
Copy link
Collaborator

@halgari halgari commented May 21, 2024

What started as frustration with how overlays were implemented has slowly turned into a rework of the OverlayController. Now with a lot less Rx and a lot less complexity. Added some tests for the OAuth overlay that failed until I fixed some of the Rx issues in play here.

OverlayController now contains all the active overlays (multiple windows would show the same overlay if we supported multi-window), only one of which is visible. Closing any overlay updates/deactives/activates the overlays. Overlays can optionally have a return value which is used for the Ok/Cancel dialogs. Everything now sits on top of abstract classes to reduce duplicated code.

@halgari halgari requested a review from a team May 21, 2024 20:33
@halgari
Copy link
Collaborator Author

halgari commented May 21, 2024

Fixes : #1379

@erri120 erri120 self-requested a review May 21, 2024 20:47
Copy link
Contributor

This PR conflicts with main. You need to rebase the PR before it can be merged.

@Al12rs
Copy link
Contributor

Al12rs commented May 22, 2024

@halgari I thought the plan was to ditch overlays and replace them with modal windows (Avalonia Dialogs) in the future

@erri120
Copy link
Member

erri120 commented May 22, 2024

@halgari I thought the plan was to ditch overlays and replace them with modal windows (Avalonia Dialogs) in the future

That's what I thought as well, which is why I didn't rework overlays into modal dialogs in my own PR (#1390). We have issue #1128 open, but previously decided not to work on that until later.

@halgari
Copy link
Collaborator Author

halgari commented May 22, 2024

@halgari I thought the plan was to ditch overlays and replace them with modal windows (Avalonia Dialogs) in the future

This isn't a full redesign of the main parts of the overlay. This is the side-effect of me spending most of a day trying to figure out why overlays weren't working and getting fed up with how complex the code currently is.

# Conflicts:
#	src/NexusMods.App.UI/Pages/Downloads/InProgressViewModel.cs
#	src/NexusMods.App.UI/Windows/MainWindowViewModel.cs
Copy link
Contributor

This PR doesn't conflict with main anymore. It can be merged after all status checks have passed and it has been reviewed.

Co-authored-by: erri120 <erri120@fossmailer.de>
Comment on lines +18 to +19
// Has to be here, because otherwise Fody breaks the codegen and doesn't make a backing
// field for Status for some reason :|
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lmao, might be because this is an abstract class or something.

@halgari halgari requested a review from erri120 May 22, 2024 17:04
@erri120 erri120 merged commit 8f1677e into main May 23, 2024
6 checks passed
@erri120 erri120 deleted the oauth-thing branch May 23, 2024 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants