Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 3, 2026

Settings toggles existed in UI but lacked proper persistence or were commented out on Android. Users couldn't reliably save preferences across app restarts.

Changes

BaseViewModel

  • Added observable properties: MinimizeToTrayPreference, IsMiniLyricsViewEnabled, AllowBackNavigationWithMouseFour
  • Load settings from AppStateModel on initialization

SettingsViewModel

  • Added ToggleMinimizeToTray() and ToggleStickToTop() methods
  • Updated existing toggle methods to sync observable properties after DB write

Windows SettingsPage

  • Added InitializeSettingsState() to restore saved toggle states on navigation
  • Wired up AutoScrobbleToggle click handler
  • All toggles now read from and write to database

Android SettingsFragment

  • Enabled 5 previously commented-out switches: Minimize to Tray, Stick to Top, Mini Lyrics View, Mouse Back Nav, LastFM Scrobbling
  • Connected switches to ViewModel methods instead of direct property access

Pattern

public void ToggleSetting(bool? isChecked)
{
    var realm = RealmFactory.GetRealmInstance();
    var appModel = realm.All<AppStateModel>().FirstOrDefaultNullSafe();
    if (appModel != null && isChecked.HasValue)
    {
        realm.Write(() => appModel.SettingField = isChecked.Value);
        ObservableProperty = isChecked.Value;  // Sync for reactive UI
    }
}

All boolean settings now persist to Realm database and restore on app start with full Windows/Android parity.

Original prompt

This section details on the original issue you should resolve

<issue_title>Complete settings page upgrades</issue_title>
<issue_description>I needa add all the toggleable fields in app model, so they can be edited in settings pages respectively.

That way user can change any field as wanted then save to DB directly with parity on both platforms </issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits January 3, 2026 22:45
Co-authored-by: YBTopaz8 <41630728+YBTopaz8@users.noreply.github.com>
Co-authored-by: YBTopaz8 <41630728+YBTopaz8@users.noreply.github.com>
Copilot AI changed the title [WIP] Add toggleable fields to settings page Implement settings persistence with cross-platform parity Jan 3, 2026
Copilot AI requested a review from YBTopaz8 January 3, 2026 22:48
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.

Complete settings page upgrades

2 participants