Skip to content

added toggle in settings and a launch option to start retro rewind right away#247

Open
Neo11Neo wants to merge 3 commits intoTeamWheelWizard:mainfrom
Neo11Neo:main
Open

added toggle in settings and a launch option to start retro rewind right away#247
Neo11Neo wants to merge 3 commits intoTeamWheelWizard:mainfrom
Neo11Neo:main

Conversation

@Neo11Neo
Copy link
Copy Markdown

@Neo11Neo Neo11Neo commented Mar 31, 2026

Purpose of this PR:

Adds command-line launch support and settings toggle so WheelWizard can automatically start Retro Rewind at app startup, without needing to click Play in the UI.

grafik

How to Test:

  1. Build/publish WheelWizard for your platform.
  2. Run WheelWizard normally (without args) and confirm normal startup behavior is unchanged.
  3. Run with launch flag:
  • ./WheelWizard --launch rr
  • ./WheelWizard --launch=rr
  • ./WheelWizard -l rr
  1. Navigate to Settings > Other and enable "Launch Retro Rewind on Startup" then restart.

What Has Been Changed:

  1. Added startup launch argument parsing in WheelWizard/Views/App.axaml.cs using a new StartupLaunchTarget enum.
  2. Added support for these argument forms:
  • --launch rr
  • --launch=rr
  • -l rr
  1. Updated protocol argument detection to scan all command-line args for wheelwizard://... instead of only the first positional argument.
  2. Hooked startup launch behavior into app initialization so that when RR is requested, WheelWizard resolves RrLauncher and invokes its existing Launch() flow.
  3. New toggle in settings>other to start retro rewind on wheel wizard startup.

I hope you like the change. Now we can start playing rr even faster than before :)

Summary by CodeRabbit

  • New Features
    • Application can now be launched via custom URL protocol scheme.
    • Command-line arguments enable direct launch of RetroRewind on startup.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 31, 2026

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 68b9825e-44a1-42f5-911e-8a1c4ecd34df

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The App initialization logic has been extended to parse command-line arguments for launch protocol URLs (wheelwizard://) and startup launch targets (RetroRewind). A new StartupLaunchTarget enum categorizes launch modes, with dedicated methods extracting the respective arguments and conditionally triggering the appropriate launcher after initialization.

Changes

Cohort / File(s) Summary
App Initialization & Launch Protocol Handler
WheelWizard/Views/App.axaml.cs
Added GetLaunchProtocolArgument() to extract wheelwizard:// URLs from command-line arguments (case-insensitive). Added GetStartupLaunchTarget() method and StartupLaunchTarget enum (None, RetroRewind) to parse --launch / -l and --launch= argument forms. Extended OnInitializedAsync() to resolve RrLauncher from DI and conditionally invoke it when startup target is RetroRewind, executing after standard initialization steps.

Sequence Diagram

sequenceDiagram
    participant App
    participant DI as DI Container
    participant Manager as UrlProtocolManager
    participant Launcher as RrLauncher
    
    App->>App: Parse arguments
    App->>App: GetLaunchProtocolArgument()<br/>(detect wheelwizard://)
    alt Protocol URL present
        App->>Manager: ShowPopupForLaunchUrlAsync(url)
    end
    
    App->>App: Initialize (updates, badges, managers)
    App->>App: GetStartupLaunchTarget()<br/>(detect --launch/rr)
    alt Launch Target is RetroRewind
        App->>DI: Resolve RrLauncher
        App->>Launcher: Launch()
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 Hops through the command line with glee,
Spotting wheelwizard:// and launching spree,
RetroRewind boots up on my say,
Arguments parsed, hooray, hooray!
From startup to launch, smooth as can be! 🎮✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title mentions 'a launch option' and 'start retro rewind right away,' which aligns with the PR's core purpose of adding command-line launch support for Retro Rewind. However, it mentions 'toggle in settings' which is not reflected in the raw_summary or code changes—the changes only add command-line argument parsing and startup launch logic, not a settings toggle UI component. Update the title to accurately reflect the actual changes, such as: 'Add --launch command-line option to start Retro Rewind at app startup' or similar, removing the reference to a settings toggle that is not present in this PR.
✅ Passed checks (2 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description check ✅ Passed The pull request description includes all required sections from the template with detailed information about purpose, testing instructions, and changes made.

✏️ 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.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@WheelWizard/Views/App.axaml.cs`:
- Around line 67-68: The argument is detected case-insensitively in App.axaml.cs
using argument.StartsWith("wheelwizard://", StringComparison.OrdinalIgnoreCase)
but returned with original casing, which breaks the case-sensitive strip in
UrlProtocolManager.cs; modify the return so the protocol scheme is normalized to
the lowercase "wheelwizard://" prefix (e.g., build and return "wheelwizard://" +
the remainder of the original argument after the prefix) so downstream
UrlProtocolManager parsing (case-sensitive Replace) will succeed.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: deb4168c-1ea2-44d6-8779-7b637d77c600

📥 Commits

Reviewing files that changed from the base of the PR and between 27b313e and de40a21.

📒 Files selected for processing (1)
  • WheelWizard/Views/App.axaml.cs

Comment on lines +67 to +68
if (argument.StartsWith("wheelwizard://", StringComparison.OrdinalIgnoreCase))
return argument;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Normalize protocol scheme before returning to avoid mixed-case launch failures.

At Line 67, detection is case-insensitive, but the returned value keeps original casing. WheelWizard/Services/UrlProtocol/UrlProtocolManager.cs strips prefix with a case-sensitive replace, so WheelWizard://... will be detected here but fail parsing downstream.

Proposed fix
-            if (argument.StartsWith("wheelwizard://", StringComparison.OrdinalIgnoreCase))
-                return argument;
+            if (argument.StartsWith("wheelwizard://", StringComparison.OrdinalIgnoreCase))
+                return $"wheelwizard://{argument["wheelwizard://".Length..]}";
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if (argument.StartsWith("wheelwizard://", StringComparison.OrdinalIgnoreCase))
return argument;
if (argument.StartsWith("wheelwizard://", StringComparison.OrdinalIgnoreCase))
return $"wheelwizard://{argument["wheelwizard://".Length..]}";
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@WheelWizard/Views/App.axaml.cs` around lines 67 - 68, The argument is
detected case-insensitively in App.axaml.cs using
argument.StartsWith("wheelwizard://", StringComparison.OrdinalIgnoreCase) but
returned with original casing, which breaks the case-sensitive strip in
UrlProtocolManager.cs; modify the return so the protocol scheme is normalized to
the lowercase "wheelwizard://" prefix (e.g., build and return "wheelwizard://" +
the remainder of the original argument after the prefix) so downstream
UrlProtocolManager parsing (case-sensitive Replace) will succeed.

@Neo11Neo Neo11Neo changed the title added a launch option --launch rr to start retro rewind right away added toggle in settings and a launch option to start retro rewind right away Mar 31, 2026
@DirkDoes
Copy link
Copy Markdown
Member

DirkDoes commented Apr 1, 2026

nice idea!
Also as you may have seen, command line arguments are a bit under developed in wheel wizard.
So adding that is a good step in the right direction.
Later we can make it a bit more dynamic that we can easily expand with more arguments and stuff, but out of scope for this PR prob.

Anyways, it all works.
I was however thinking about 1 small detail. When you have the checkbox "Launch on startup" checked. It now also starts when you start WhWz through the LaunchProtocol (used by gamabanana). In this specific scenario it feels a bit weird starting the game
Can we maybe make it so it ignores this setting when coming from the launch protocol?

I will merge it if that is changed!
or if you have a good reason to keep it as is, let us know
Thanks in advance

@Neo11Neo
Copy link
Copy Markdown
Author

Neo11Neo commented Apr 2, 2026

@DirkDoes Sure i was not familiar with game banana but i created a fix for it. Hope it works for you and we can merge!

@DirkDoes
Copy link
Copy Markdown
Member

DirkDoes commented Apr 3, 2026

awsome!, will check it later today and if everything is good, I will merge it!

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.

2 participants