Skip to content

feat: auto-detect of native dolphin#291

Merged
matellush merged 4 commits into
TeamWheelWizard:devfrom
altpyrion:linux-autodetect
Jun 18, 2026
Merged

feat: auto-detect of native dolphin#291
matellush merged 4 commits into
TeamWheelWizard:devfrom
altpyrion:linux-autodetect

Conversation

@altpyrion

@altpyrion altpyrion commented Jun 17, 2026

Copy link
Copy Markdown

feat: added auto-detect of native dolphin installations for linux
fix: fixed auto-detect of data folder to be based on textbox instead of saved value

Purpose of this PR:

The launcher can now detect native installations of Dolphin. If it is detected it will ask the user as with the data folder if the user wants to accept the path found

Also the data folder detection used not the text field, but possibly an older value that didn't represent the users intent aynmore

How to Test:

What Has Been Changed:

Related Issue Link:

Checklist before merging

  • You have created relevant tests

@coderabbitai

coderabbitai Bot commented Jun 17, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Adds IsDolphinInstalledNative() to ILinuxDolphinInstaller and implements it via a dolphin-emu command check. PathManager.TryFindUserFolderPath gains an overload accepting an explicit Dolphin file path. The settings browse handler replaces its single Flatpak check with an iterable candidate list (Flatpak + native), and the user data path detection now uses the currently-entered Dolphin exe path.

Changes

Linux Native Dolphin Detection

Layer / File(s) Summary
ILinuxDolphinInstaller native detection contract and implementation
WheelWizard/Features/DolphinInstaller/LinuxDolphinInstaller.cs
Adds IsDolphinInstalledNative() to the interface and implements it in LinuxDolphinInstaller by calling commandEnvironment.IsCommandAvailable("dolphin-emu").
PathManager path-aware user folder overload
WheelWizard/Services/PathManager.cs
Adds TryFindUserFolderPath(string dolphinFilePath) overload; the parameterless version delegates to it with DolphinFilePath. Linux Flatpak branch now evaluates IsFlatpakDolphinFilePath(dolphinFilePath) on the passed-in value.
Settings UI: extensible candidate list and path-aware user folder
WheelWizard/Views/Pages/Settings/WhWzSettings.axaml.cs
Replaces single Flatpak check with an iterable (isInstalled, path) candidate list; adds IsNativeDolphinInstalled() helper. User data path browse uses PathManager.TryFindUserFolderPath(DolphinExeInput.Text) when the field is populated.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 Hop hop, the wizard checks anew,
Not just Flatpak — native paths too!
A list of candidates, one by one,
Until the right Dolphin exe is done.
The user folder follows your lead,
No more hardcoded paths to impede! 🎉

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ❓ Inconclusive The PR description is mostly complete but lacks critical details in the 'How to Test' and 'What Has Been Changed' sections. Fill in the 'How to Test' section with clear reproduction steps. Complete the 'What Has Been Changed' section with a detailed summary of modifications across all affected files.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat: auto-detect of native dolphin' clearly summarizes the main feature addition described in the changeset - auto-detection of native Dolphin installations on Linux.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
WheelWizard/Views/Pages/Settings/WhWzSettings.axaml.cs (1)

175-205: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Avoid prompting Flatpak install when native Dolphin is already installed.

Line 175 only checks Flatpak absence. If native Dolphin is detected (and the user declines autofill), the flow still offers Flatpak installation, which is incorrect for an already-installed setup.

Suggested fix
-            if (!EnvHelper.IsFlatpakSandboxed() && !IsFlatpakDolphinInstalled())
+            if (!EnvHelper.IsFlatpakSandboxed() && !IsFlatpakDolphinInstalled() && !IsNativeDolphinInstalled())
             {
                 var wantsAutomaticInstall = await new YesNoWindow()
                     .SetMainText(t("question.dolphin_flatpack.title"))
                     .SetExtraText(t("question.dolphin_flatpack.extra"))
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@WheelWizard/Views/Pages/Settings/WhWzSettings.axaml.cs` around lines 175 -
205, The condition guarding the Flatpak Dolphin installation prompt in the if
statement at line 175 only checks whether Flatpak is sandboxed and whether
Flatpak Dolphin is installed, but it does not check whether a native version of
Dolphin is already available. Add an additional condition to verify that native
Dolphin is not already installed before prompting the user to install the
Flatpak version. Look for or create an appropriate method (similar to
IsFlatpakDolphinInstalled) to check for native Dolphin installation and add it
to the existing condition using logical AND operators.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@WheelWizard/Views/Pages/Settings/WhWzSettings.axaml.cs`:
- Around line 175-205: The condition guarding the Flatpak Dolphin installation
prompt in the if statement at line 175 only checks whether Flatpak is sandboxed
and whether Flatpak Dolphin is installed, but it does not check whether a native
version of Dolphin is already available. Add an additional condition to verify
that native Dolphin is not already installed before prompting the user to
install the Flatpak version. Look for or create an appropriate method (similar
to IsFlatpakDolphinInstalled) to check for native Dolphin installation and add
it to the existing condition using logical AND operators.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: f3e62b8b-5fb2-417c-b8c8-dabecaf865d3

📥 Commits

Reviewing files that changed from the base of the PR and between 8df6d60 and edf6217.

📒 Files selected for processing (3)
  • WheelWizard/Features/DolphinInstaller/LinuxDolphinInstaller.cs
  • WheelWizard/Services/PathManager.cs
  • WheelWizard/Views/Pages/Settings/WhWzSettings.axaml.cs

@matellush

matellush commented Jun 17, 2026

Copy link
Copy Markdown
Collaborator

lgtm. We should probably retire IsFlatpakDolphinFilePath() (without parameters) altogether and use the local variable for it instead and, if not available, fetch it from PathManager for the call, as it can lead to race conditions, or, as you pointed out, unexpected behavior. For example, the launching code should use the dolphinLocation directly and not depend on another call to fetch the current location. The same applies to the settings validation.

If you could adapt the code to drop that function as well, that would be great!

@altpyrion

Copy link
Copy Markdown
Author

I can defintely do that. But the more im looking at this the more i think that this should be an own "config wizard" that guides the player through setting up all the correct paths, autodetection and also installation itself if nothing was automatically detected. If that sounds something you guys would want I could definitely do that - in a separate PR of course

@matellush

matellush commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

I can defintely do that. But the more im looking at this the more i think that this should be an own "config wizard" that guides the player through setting up all the correct paths, autodetection and also installation itself if nothing was automatically detected. If that sounds something you guys would want I could definitely do that - in a separate PR of course

Sure, that sounds like a good idea. One thing to note there would be that, if the Wheel Wizard application itself is running as a Flatpak (we have checks for this in some places), then, normally, the only two options the users should have would be flatpak run org.DolphinEmu.dolphin-emu and dolphin-emu since it works with wrappers internally. Also, the commands flatpak and dolphin will always be available due to the wrappers, but that doesn't mean that the host actually has the commands installed (so it may be necessary to run the command's --help or --version or something to tell whether it's actually available). In any case, first recommending the Dolphin Flatpak command should be the default, as this PR has it. The file picker should also not even be an option there as it won't work. So we should probably restrict the choices there in the initial setup (i.e., not having the file picker for the dolphin executable location), but still enable users to freely change the dolphin location string if required (as we do have some users with a complex command in there which would break if we forced them to use either of the two wrapper commands).

Another thing that has been confusing is the wording "dolphin executable" in the first place -- users don't realize that it can be a command on non-Windows systems.

These are just some known issues that come to mind that you should be aware of if you intend to improve the initial setup flow. A separate PR for this would be appreciated!

@altpyrion

Copy link
Copy Markdown
Author

Ok then, should I close this PR and create a new one in which I would work on the total rework or do you still wish to keep these smaller changes (with the additions you asked for) for as long as the rework is not done?

@matellush

matellush commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

Ok then, should I close this PR and create a new one in which I would work on the total rework or do you still wish to keep these smaller changes (with the additions you asked for) for as long as the rework is not done?

I wouldn't close this PR, this is still a good change. One thing, though: The base branch should be changed to dev for it to be merged (I just did that).

@matellush matellush changed the base branch from main to dev June 18, 2026 10:41
@matellush matellush enabled auto-merge June 18, 2026 10:44
@matellush matellush self-requested a review June 18, 2026 10:48
@matellush matellush merged commit da74e81 into TeamWheelWizard:dev Jun 18, 2026
2 checks passed
@matellush

Copy link
Copy Markdown
Collaborator

The pop-up would still need a different text in the future (and translations). It currently references a Dolphin "folder".

@altpyrion

altpyrion commented Jun 18, 2026

Copy link
Copy Markdown
Author

Agreed

@altpyrion altpyrion deleted the linux-autodetect branch June 19, 2026 20:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants