Port Mod Manager to Avalonia with Linux and Steam Deck support - #1283
Port Mod Manager to Avalonia with Linux and Steam Deck support#1283Yokimitsuro wants to merge 51 commits into
Conversation
…e/cross-platform-mod-manager # Conflicts: # OpenKh.Tests.ModsManager/ModsServiceTest.cs # OpenKh.Tools.ModsManager/Services/ConfigurationService.cs # OpenKh.Tools.ModsManager/Services/ModsService.cs # OpenKh.Tools.ModsManager/Services/OperationDispatcher.cs # OpenKh.Tools.ModsManager/Services/RepositoryService.cs # OpenKh.Tools.ModsManager/ViewModels/MainViewModel.cs # OpenKh.Tools.ModsManager/ViewModels/SetupWizardViewModel.cs
Keep the established YAML property names, migrate preview configurations, repair Lua Backend section formatting, and remove obsolete application files without touching user data.
Package the Launcher and Mod Manager as a distro-neutral AppImage, keep mutable data outside the mounted image, hand updates back to the Launcher, and validate controller navigation in headless UI tests.
# Conflicts: # OpenKh.Tools.ModsManager/Services/ConfigurationService.cs # OpenKh.Tools.ModsManager/ViewModels/MainViewModel.cs # OpenKh.Tools.ModsManager/ViewModels/SetupWizardViewModel.cs # OpenKh.Tools.ModsManager/Views/MainWindow.xaml
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Initial review did not cover all of the code just testing interacting with the UI.
In debug at least clicking Top to move a mod to the top while the top of the mod selector window is not in view gives this error.
If I hit continue (in my debugger) it all continues as expected but it seems when you have scrolled down on selected mods (making the top of the list not on screen) and move a mod to Top you get this error.
Just did a quick test after posting this. This also happens if you move a mod up off the top of the screen. (does not happen when moving mods down off the bottom Only Up)
Very recently topaz added the ability to clone mods from other git sources using shorthand such as TopazTK/KH2-ArchipelagoEnablers@codeberg.org. This is a regression (tbf its only been a thing for a few days) that needs to be migrated to new MM.
You removed Fast Restore entirely when using panacea. Restore is for use with patching as it deletes any build mods in mod/Launch Game: and restores your patches pkgs from backups OKH made.
Fast Restore is for use with panacea as all it does is delete mod/"Launch Game." WHen i named this I did as such since it does half of what Restore does. This option should remain viewable with panacea but feel free to rename to something that anyone would understand without the knowledge of the backend code. No attachment to the name and Im bad at naming things.
While I and I dont think many others use it since you made a UI option for where mods are saved/built. I do think this option by default should be behind a dropdown. It can still be where it is and making it easier to edit for those who want/need to is nice. And if this will be in the GUI you should have both one for mod install location and mod build location. Also this is technically a regression of tryashtars PR making it so a mods folder is not created (which i followed with a PR to ensure mod and mods were not the same to prevent them overwriting each other). I didnt really care and I doubt many users use the ability to change the mods folder at all but since they made that PR (and i added the code to prevent the clash in the even mod and mods are the same) I imagine they would want it to match the update they did in their PR.
Then also the bdxio build error to test i just removed the name change that added .library so i could build it, I imagine something wasnt renamed along with adding .library?
A little more nitpicky personally i dont like really like the rename of run to play idk just looks weird to me but maybe everyone else likes this more. Even so if we keep it saying play I think Play without rebuilding should just be something like Start Game or similar. or maybe i just like Build and Run and Run only too much.
Taking a quick look at r2modman and lumafly maybe it could be closer to them. 2 buttons Start/Launch Modded/Vanilla. Definitely want to still keep build only even if we did this. and move Fast Restore back in case someone want to "Build" with no mods. Ofc feel free to rename it since again I suck at naming.
last even more nitpick i like new windows sometimes over changing the entire window. such as installing a new mod but tbf unless many other people (at least 10) agree keep it this way
Ill do a more thorough code review later after more changes.
|
Was shown a screenshot of this, don't have dotnet set up at the moment, but have some initial quick feedback.
|
|
Avalonia supports pop-up windows, but they cause issues on Steam Deck, which is why I removed all the extra windows. I pushed the following changes:
I kept Game Setup and App Settings in the main menu for now since that was presented as a suggestion rather than a required change, but I can revisit it later if needed. Please let me know if you find anything else during practical testing. |
shananas
left a comment
There was a problem hiding this comment.
The new in UI keyboard is nice I wasn't able to actually type using the windows on-screen keyboard as it wasnt in focus (then again i wont be using this with controller just testing).
Commonly on screen keyboards like this have a couple extra shortcuts such as (for PS) Square being backspace triangle shift/caps lock or space. Itd be nice to support those. Pretty sure consistently middle left button is backspace others could be preference.
| if (Directory.Exists(destinationDirectory)) | ||
| { | ||
| if (!overwrite) | ||
| throw new ModAlreadyInstalledException(packageName); |
There was a problem hiding this comment.
Not sure why this behaves differently. When installing over specifically a zip or PCPatch I get an error in my IDE from here. This behaves differently than overwriting a Repo or Lua script which does not throw and IDE error. I still see the replace screen after hitting continue (in my IDE). Not sure if this will be a problem on the release version but ideally needing to overwrite a zip or PCPatch mod doesn't interrupt debugging and just cleanly proceeds to the next screen of confirming if you want to overwrite the mod just like how overwriting a Lua Script or Repo install works.
| <TextBlock Grid.Row="4" Text="Branch (Optional)" FontWeight="SemiBold" /> | ||
| <TextBox x:Name="BranchTextBox" Grid.Row="6" PlaceholderText="main" /> | ||
| <TextBlock Grid.Row="8" | ||
| Text="GitHub repositories, custom Git hosts, ZIP links, OpenKH patch archives, and Lua files are supported." |
There was a problem hiding this comment.
PCPatches were not developed for OpenKH. They were made for AntonioDePau/KHPCPatchManager. We just support using them in Mods Manager. Suggest changing the name though this but if you have a more preferred choice go ahead with that. Just there is no such thing as an OpenKH Patch Archive.
| Text="GitHub repositories, custom Git hosts, ZIP links, OpenKH patch archives, and Lua files are supported." | |
| Text="GitHub repositories, custom Git hosts, ZIP links, PC Patch archives, and Lua files are supported." |
|
The last installed mod hovered over when navigating with a controller can be moved up/down with the triggers even if on the side buttons or search bar up top. Not sure if you want to keep that or require the controller to actually be over the mod to prevent accidentally changing mod order while navigating with the controller. |
Allow controller focus to enter expanded setup fields and keep nested menu commands separate from their parent expanders. Restore virtual keyboard shortcuts, repository submission with Enter, focused-row actions, and platform-specific extraction guidance.
Inspect local packages and repositories before installation so existing mods receive a clear replacement prompt. Reuse package inspection for local archives and preserve the current list position after removing a mod.
Identify new and existing PC Patch imports, keep them below OpenKH mods, and preserve their relative order. Prevent manual reordering across the format boundary while retaining full installation support.
|
Thanks for the detailed feedback. I pushed another set of fixes:
|
|
With the recent batch of updates you can only move mod priority with controller one time with the trigger buttons before needing to go off and on the mod to move priority again. Probably to do with preventing moving the mods while not focused on them. |
Restore focus to the moved mod row after each priority change so trigger-based reordering can continue without leaving and reselecting the item.
Publish and validate a tar.gz archive with executable permissions while retaining the ZIP asset used by existing Linux update installations.
Remove the unmerged Linux ZIP asset, publish only the portable tar.gz package, and teach the Launcher updater to extract it directly.
Promote new local and repository installations to the top of their allowed format group while preserving the existing order when replacing a mod.
|
Hi, thanks for going through the effort to make things better. The work is appreciated. These are nitpicks coming from my future expectation for people having problems using this version of Mod Manager compared to the WPF version. I'm basing this on a build Shan sent me, and none of these are things that need to be fixed, just observations.
None of these are that big a deal, and functionally, it appears to have feature parity. I just wanted to note the initial expectations I had when using it for the first time. |
|
It's looking great so far, and I'm glad there is an AI use disclosure above. Here are somethings I have found in my testing:
When building It looks like these assets are custom ones provided by Re:Fined, such as Pirate Sora and Org. XIII Moogle costumes. The issue is that some items fail to build into the finished collection of mods, while others do and still soft lock. Below is an example screenshot image showing the same mod (
As you can see, the one on the right has two less files, This results in the game giving an infinite loading screen because those assets could not be found. Although one could just simply get those files and drop it in, other custom assets, such as Pirate Sora, are built into the game's mod folder, but also refuse to load. When building with build 1680, I was able to drag it's mod folder into the PR one, and the game loaded with zero issues. I do believe that the PR mod manager is failing to correctly build mods with custom assets and this needs to be looked into urgently. Unlike tommadness's issue with Steam Direct Launch, it works perfectly on my end, and I also use Nobara with Native Steam Linux. I'm not sure what the issue is there, but I will also be testing this on my Steam Deck once the other issues are addressed. Otherwise, this is fantastic work and I can't wait for more improvements to come. |
|
As I have said in previous PRs that had AI involvement, I cannot support any PR that is inherently based on artificially generated code. No offense to anyone involved, thanks for your transparency. We need more of this in our projects. |
|
I cannot in good conscious continue to use this mod loader anymore now that you've decided to give up and slopcode it. You should feel ashamed of yourself for betraying the community's trust. Generative AI is looked down upon in every field for a reason, and anything defending it at all is just excusing theft. |
|
I have to agree with Topaz. As much as the modloader needs a rework, I think basing the foundation for a new era of the modloader entirely on AI-generated code is short-sighted. I worry about the technical debt being incurred by such a massive change being essentially fully generated. I can't imagine the potential for bugs is anything short of impossible to test with without pushing this PR live, and at that point it risks the functionality and reputation of OpenKH for its users. I have to ask, is the code in this PR understood deeply enough to maintain it? When bugs arise, will they be able to be properly addressed? Is that code going to be maintained by individuals, or fed back to the AI to fix it? With the rising costs of code generation, are those credits going to be burned through in an effort just to maintain this refactoring? I'm sure many OpenKH users have their own ethical and moral misgivings around AI, but at the end of the day, I am worried by the amount of work being put in the hands of a language model, and how much extra work that could simply create in the event it's a step back instead of a step forward. I can tell by the initial PR that much of this has been considered, and I'm glad for that. I can see this isn't just blindly being pushed without thought, but I still believe the concerns outweigh the potential value. |
|
With the light of the AI practices used, I retract my support. |
|
I have no dog in this fight, but even as someone who isn't as harsh about the use of AI (insert the nuance hat image here) I am entirely against it's use in here and refuse to support or utilize this loader anymore if this does end up being merged. To be a little frank I'm disappointed that it's even up for consideration. I appreciate the transparency with it's use. |



Note
AI-assisted development disclosure
AI-assisted tooling, specifically GPT-5.6 Sol, was used during the development of this PR. It contributed substantially to the Avalonia port, UI scaffolding, controller navigation, cross-platform packaging, tests, and repetitive refactoring.
I directed the intended behavior, reviewed the changes, tested builds on the supported platforms, reproduced reported issues, and decided how review feedback should be addressed. I take responsibility for the submitted code and am willing to explain or rework any section that raises technical or maintainability concerns.
Summary
This replaces the WPF Mod Manager with a cross-platform Avalonia implementation for Windows, Linux, and Steam Deck while preserving the established workflows and configuration format.
Highlights
owner/repository@codeberg.orgConfiguration compatibility
Existing installations continue using the established
mods-manager.ymlproperty names:extractedGameDataPathinstalledModsPathinstalledCollectionsPathcompiledModPathyamlGenPrefsFiles written by earlier Avalonia previews are migrated automatically. Existing mods, extracted data, presets, enabled mod lists, load order files, collection settings, game paths, and creator preferences are preserved.
Advanced storage settings keep installed mods, installed collections, and built mods configurable independently. Custom folders retain the established direct game-folder layout, while matching install and build paths are separated into
modsandmodsubfolders to prevent overwrites.The latest
masterbehavior for package patching is also included. Patching tools stay hidden unlessEnable package patching toolsis selected in Settings, and the previousdevViewsetting is migrated automatically.Linux and Steam Deck
$XDG_DATA_HOME/OpenKHor$HOME/.local/share/OpenKHValidation
Screenshots
Mod library
Browse mods
Setup