-
Notifications
You must be signed in to change notification settings - Fork 90
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
Add Steam Desktop profile overwrite toggle in settings menu #1082
base: main
Are you sure you want to change the base?
Conversation
WalkthroughThe recent updates introduce a new functionality in the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant SettingsPage
participant AppConfig
participant SteamManager
User ->> SettingsPage: Toggle OverrideSteamProfileOnStart
SettingsPage ->> AppConfig: Update OverrideSteamProfileOnStart
AppConfig -->> SettingsPage: Confirm Update
User ->> SettingsPage: Start Application
SettingsPage ->> SteamManager: Check OverrideSteamProfileOnStart
alt OverrideSteamProfileOnStart is True
SteamManager ->> SteamProfile: Override Profile
else
SteamManager ->> SteamProfile: Use Existing Profile
end
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this 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
Outside diff range and nitpick comments (1)
HandheldCompanion/Properties/Resources.Designer.cs (1)
3773-3780
: Review localized string for clarity.The string
Hint_SteamNeptuneReadmeOverridden
provides information about restarting Steam which is good. However, ensure that the context in which this message is displayed is clear to the user—that it relates specifically to when they disable the overwrite after it was previously enabled.Consider adjusting the documentation or UI to clarify when this message will be shown.
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (9)
- HandheldCompanion/App.config (1 hunks)
- HandheldCompanion/Controls/Hints/Hint_SteamNeptuneDesktop.cs (4 hunks)
- HandheldCompanion/Platforms/Steam.cs (2 hunks)
- HandheldCompanion/Properties/Resources.Designer.cs (3 hunks)
- HandheldCompanion/Properties/Resources.resx (1 hunks)
- HandheldCompanion/Properties/Settings.Designer.cs (4 hunks)
- HandheldCompanion/Properties/Settings.settings (1 hunks)
- HandheldCompanion/Views/Pages/SettingsPage.xaml (1 hunks)
- HandheldCompanion/Views/Pages/SettingsPage.xaml.cs (2 hunks)
Files skipped from review due to trivial changes (1)
- HandheldCompanion/Properties/Resources.resx
Additional comments not posted (15)
HandheldCompanion/Controls/Hints/Hint_SteamNeptuneDesktop.cs (3)
15-15
: Addition of event handler for setting changes is appropriate.The addition of
SettingsManager.SettingValueChanged += SettingsManager_SettingValueChanged;
effectively ensures that the hint updates when theOverrideSteamProfileOnStart
setting changes.
71-79
: Effective handling of setting changes for Steam profile override.The method
SettingsManager_SettingValueChanged
is well-implemented to respond to changes in theOverrideSteamProfileOnStart
setting by triggering a UI update throughSteam_Updated
. This ensures the UI is in sync with the current settings.
29-29
: Ensure correct handling of UI updates based on platform status and settings.The logic within
Steam_Updated
method correctly updates the UI based on theOverrideSteamProfileOnStart
setting and the desktop profile status. However, ensure that thePlatformStatus
enum covers all necessary states for robustness.#!/bin/bash # Description: Verify all enum values of PlatformStatus are handled. # Test: Search for the PlatformStatus enum definition and usage. Expect: Comprehensive handling in switch cases. rg --type cs "enum PlatformStatus"Also applies to: 44-58
HandheldCompanion/Platforms/Steam.cs (4)
81-85
: Restoration of files upon stopping the platform is correctly implemented.The
Stop
method properly checks if the desktop profile is applied and restores the files if necessary. This is crucial to ensure the state is correctly reset when the platform stops.
[APROVED]
92-98
: Ensure proper detachment of event handlers and file restoration.It's good to see that the
Process_Exited
method detaches theSettingsManager_SettingValueChanged
event handler and restores the files if needed. This prevents memory leaks and ensures files are restored when the process exits unexpectedly.
152-158
: Conditional file overwriting based on settings is correctly implemented.The conditional logic in
ProcessManager_ProcessStarted
to overwrite files only if theOverrideSteamProfileOnStart
setting is enabled, is a good practice. This respects the user's settings and only modifies the system state when permitted.
166-186
: Robust handling of setting changes for file management.The method
SettingsManager_SettingValueChanged
in theSteam
class effectively handles changes to theOverrideSteamProfileOnStart
setting by either replacing or restoring files based on the new value. This dynamic response to setting changes ensures that the system's behavior aligns with user preferences.HandheldCompanion/App.config (1)
281-283
: Correct implementation of new application setting in configuration file.The addition of the
OverrideSteamProfileOnStart
setting in theApp.config
file with a default value ofTrue
is correctly implemented. This ensures that the application's default behavior aligns with the intended functionality of overriding Steam profiles on startup.HandheldCompanion/Properties/Settings.settings (1)
278-280
: Proper addition of new setting in settings file.The new setting
OverrideSteamProfileOnStart
is correctly added to theSettings.settings
file with a default value ofTrue
. This maintains consistency across configuration files and supports the new feature.HandheldCompanion/Views/Pages/SettingsPage.xaml.cs (2)
119-121
: Proper handling of new setting toggle in the UI.The method
SettingsManager_SettingValueChanged
correctly updates theToggle_OverrideSteamProfileOnStart
based on the setting value. This ensures that the UI reflects the current configuration and responds to changes dynamically.
213-219
: Correct implementation of toggle event for new setting.The
Toggle_OverrideSteamProfileOnStart_Toggled
method correctly updates the setting when the toggle is changed. This ensures that user changes to the setting are saved and applied correctly.HandheldCompanion/Views/Pages/SettingsPage.xaml (1)
252-288
: Ensure consistent UI design and functionality for the new toggle switch.The new section for overriding default Steam desktop and chord profiles has been added correctly following the application's UI design patterns. However, ensure that the toggle switch is tested across different platforms and screen sizes to maintain UI consistency and functionality.
#!/bin/bash # Description: Verify the toggle switch functionality across different platforms and screen sizes. # Test: Run UI tests for the SettingsPage across multiple devices. echo "Running UI tests for SettingsPage across multiple devices..."HandheldCompanion/Properties/Settings.Designer.cs (2)
15-15
: Ensure consistency with attribute usage.The
[SettingsProvider(typeof(CustomSettingsProvider))]
attribute is correctly used to specify a custom settings provider for the settings class. Ensure that this custom provider is implemented correctly elsewhere in your project to handle settings appropriately.#!/bin/bash # Description: Verify the implementation of `CustomSettingsProvider`. # Test: Search for the implementation of `CustomSettingsProvider`. rg --type cs $'class CustomSettingsProvider'
1122-1131
: Review new setting implementation forOverrideSteamProfileOnStart
.The implementation of the
OverrideSteamProfileOnStart
setting follows the established pattern for user-scoped settings in the application. The default value is set toTrue
, aligning with the PR description that this setting is enabled by default. Ensure that the logic handling this setting's value change is implemented correctly in the system to reflect the user's choice accurately.#!/bin/bash # Description: Verify the handling of `OverrideSteamProfileOnStart` setting changes. # Test: Search for the usage of the `OverrideSteamProfileOnStart` setting. rg --type cs $'OverrideSteamProfileOnStart'HandheldCompanion/Properties/Resources.Designer.cs (1)
8177-8193
: Localized string descriptions are clear and informative.The strings
SettingsPage_OverrideSteamProfileOnStart
andSettingsPage_OverrideSteamProfileOnStartDesc
clearly describe the functionality of the setting. These are well-phrased and should be easily understandable to the end-user.
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- HandheldCompanion/Properties/Resources.Designer.cs (3 hunks)
Files skipped from review as they are similar to previous changes (1)
- HandheldCompanion/Properties/Resources.Designer.cs
Adds a toggle in the settings menu to enable/disable overwritting the Steam Desktop profiles on startup.
HC does this overwrite automatically by default, but if you don't intend to use any of the controller features, you are still left with blank desktop and chord profiles, and a notification that prompts you to restart Steam if it had been started before HC.
I've also updated the notification to show the inverted operation, so if you had it enabled and the profiles already overwritten, and then disable it, the notification will inform you that Steam needs to restart so the default profiles are properly reverted.
Summary by CodeRabbit
New Features
Improvements
Bug Fixes