From 0fb059226898bf6b22863c8fbf97e10d0b13ebe6 Mon Sep 17 00:00:00 2001 From: Mansoor Khan Date: Sat, 14 Nov 2026 21:33:25 +0500 Subject: [PATCH 1/7] feat(macos): add an option to hide the Sites section in the menu bar panel Refs #172 --- macos/Sources/FlockUI/PanelView.swift | 10 ++++++++-- macos/Sources/FlockUI/Settings/GeneralPane.swift | 8 ++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/macos/Sources/FlockUI/PanelView.swift b/macos/Sources/FlockUI/PanelView.swift index bd923677..c23fd46a 100644 --- a/macos/Sources/FlockUI/PanelView.swift +++ b/macos/Sources/FlockUI/PanelView.swift @@ -6,6 +6,10 @@ import SwiftUI struct PanelView: View { @Environment(AppModel.self) private var model @Environment(\.openWindow) private var openWindow + @AppStorage(PanelView.hideSitesKey) private var hideSites = false + + /// UserDefaults key: whether the Sites section is left out of the panel (Settings → General). + static let hideSitesKey = "panel.hideSites" var body: some View { VStack(alignment: .leading, spacing: 12) { @@ -27,8 +31,10 @@ struct PanelView: View { Divider() services(status) Divider() - sites(status.sites, proxies: status.proxies) - Divider() + if !hideSites { + sites(status.sites, proxies: status.proxies) + Divider() + } toggles(status) Divider() shortcuts(status) diff --git a/macos/Sources/FlockUI/Settings/GeneralPane.swift b/macos/Sources/FlockUI/Settings/GeneralPane.swift index df7d58a8..ad519244 100644 --- a/macos/Sources/FlockUI/Settings/GeneralPane.swift +++ b/macos/Sources/FlockUI/Settings/GeneralPane.swift @@ -19,6 +19,7 @@ struct GeneralPane: View { get { confirmUnparkState.wrappedValue } nonmutating set { confirmUnparkState.wrappedValue = newValue } } + @AppStorage(PanelView.hideSitesKey) private var hideSitesInPanel = false private let launchAtLoginState = State(initialValue: LoginItem.isEnabled) private var launchAtLogin: Bool { get { launchAtLoginState.wrappedValue } @@ -87,6 +88,13 @@ struct GeneralPane: View { } } + Section("Menu bar") { + Toggle(isOn: $hideSitesInPanel) { + Text("Hide sites in the menu bar panel") + Text("Sites stay available in Settings → Sites.") + } + } + Section { appUpdates if let config = store.config { From a18919e0cf00cfe5e9cfa0dfeffa2d725992e0f6 Mon Sep 17 00:00:00 2001 From: Mansoor Khan Date: Sun, 15 Nov 2026 11:09:33 +0500 Subject: [PATCH 2/7] feat(app): add the option to hide sites to the Windows panel and the Linux tray menu MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Settings → General gets the same switch on every platform, and the docs mention it. Refs #172 --- docs/sites.md | 2 +- linux/src/model.rs | 18 +++++++++ linux/src/panes/general.rs | 16 +++++++- linux/src/prefs.rs | 18 +++++++++ linux/src/tray.rs | 37 ++++++++++++++++++- .../FlockUI/Settings/GeneralPane.swift | 2 +- windows/Flock.Tray.Tests/PreferencesTests.cs | 26 +++++++++++++ .../Features/Preferences/PreferenceData.cs | 2 + windows/Flock.Tray/PanelWindow.xaml | 5 ++- windows/Flock.Tray/Settings/GeneralPane.xaml | 16 ++++++++ .../Flock.Tray/Settings/GeneralPane.xaml.cs | 19 ++++++++++ .../Flock.Tray/ViewModels/PanelViewModel.cs | 9 +++++ 12 files changed, 163 insertions(+), 7 deletions(-) diff --git a/docs/sites.md b/docs/sites.md index 2e0f1c09..81e38f37 100644 --- a/docs/sites.md +++ b/docs/sites.md @@ -148,7 +148,7 @@ Site options such as `tls` and `handle_errors` aren't supported, and neither is ## Listing sites :::app -**Settings → Sites** lists every linked and parked site with its domain and a lock when it's secured. Select one to see its PHP and Node versions, domains and server. Sites from a project folder carry a **Project folder** badge. The **Sites** section of the Flock panel lists them too: click one to open it in your browser. +**Settings → Sites** lists every linked and parked site with its domain and a lock when it's secured. Select one to see its PHP and Node versions, domains and server. Sites from a project folder carry a **Project folder** badge. The **Sites** section of the Flock panel lists them too: click one to open it in your browser. To keep the panel short, switch on **Hide sites in the menu bar panel** in **Settings → General** (**Hide sites in the panel** on Windows). On Linux, **Hide sites in the tray menu** in **General** leaves out the tray menu's **Sites** submenu. ::: :::cli diff --git a/linux/src/model.rs b/linux/src/model.rs index d4e3c729..afd97407 100644 --- a/linux/src/model.rs +++ b/linux/src/model.rs @@ -11,6 +11,7 @@ use gtk::{gio, glib}; use crate::api::{Client, Error, SettingsChange, Status}; use crate::installation; use crate::links::Link; +use crate::prefs; /// How often the daemon is asked for its status. const POLL_INTERVAL: Duration = Duration::from_secs(2); @@ -31,15 +32,32 @@ pub struct AppModel { listeners: RefCell>>, /// Worktrees whose job a progress dialog follows, by folder: their failures aren't notified. followed_worktrees: RefCell>, + /// Whether the tray menu leaves out the Sites submenu, from the preferences. + hides_sites: Cell, } impl AppModel { pub fn new() -> Rc { let model = Rc::new(Self::default()); model.needs_setup.set(installation::needs_setup()); + model.hides_sites.set(prefs::load().hide_sites); model } + pub fn hides_sites(&self) -> bool { + self.hides_sites.get() + } + + /// Shows or hides the Sites submenu in the tray menu, and remembers it in the preferences. + pub fn set_hides_sites(&self, hide: bool) -> std::io::Result<()> { + let mut p = prefs::load(); + p.hide_sites = hide; + prefs::save(&p)?; + self.hides_sites.set(hide); + self.changed(); + Ok(()) + } + pub fn status(&self) -> Option { self.status.borrow().clone() } diff --git a/linux/src/panes/general.rs b/linux/src/panes/general.rs index 6c71c5ca..d517a812 100644 --- a/linux/src/panes/general.rs +++ b/linux/src/panes/general.rs @@ -1,5 +1,5 @@ -//! General: the daemon, the domain, the data folder, opening at login, updates and the project -//! folders. +//! General: the daemon, the domain, the data folder, opening at login, the tray menu, updates and +//! the project folders. use std::cell::RefCell; use std::rc::Rc; @@ -105,6 +105,17 @@ impl GeneralPane { group } + fn tray(&self) -> adw::PreferencesGroup { + let group = group("Tray", ""); + let (model, banner) = (self.model.clone(), self.banner.clone()); + group.add(&switch_row("Hide sites in the tray menu", "The Sites page still lists them.", self.model.hides_sites(), move |on| { + if let Err(e) = model.set_hides_sites(on) { + report(&banner, Some(format!("Could not change the tray setting: {e}"))); + } + })); + group + } + /// Linux apps don't update themselves: the flockphp package comes with the system's updates. fn updates(&self, config: &Config, status: &Status) -> adw::PreferencesGroup { let group = group("Updates", ""); @@ -242,6 +253,7 @@ impl Pane for GeneralPane { groups.push(self.network(config, &status).upcast()); groups.push(self.data(config).upcast()); groups.push(self.startup().upcast()); + groups.push(self.tray().upcast()); groups.push(self.updates(config, &status).upcast()); groups.push(self.project_folders(config).upcast()); } diff --git a/linux/src/prefs.rs b/linux/src/prefs.rs index e9444ade..7930e7aa 100644 --- a/linux/src/prefs.rs +++ b/linux/src/prefs.rs @@ -14,6 +14,8 @@ pub struct Prefs { pub editor: String, /// The sites whose worktrees the Sites list shows, by name; the others are collapsed. pub expanded_sites: Vec, + /// Leaves the Sites submenu out of the tray menu (General → Tray). + pub hide_sites: bool, } /// Editors the Dumps window can open files in: id, name and URL scheme ("" for none). @@ -54,3 +56,19 @@ pub fn save(prefs: &Prefs) -> std::io::Result<()> { std::fs::create_dir_all(dir())?; std::fs::write(file(), serde_json::to_vec_pretty(prefs).expect("prefs")) } + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn shows_sites_unless_the_preference_says_otherwise() { + // app.json from before the preference existed. + let prefs: Prefs = serde_json::from_str(r#"{"editor":"zed","expanded_sites":["acme"]}"#).unwrap(); + assert!(!prefs.hide_sites); + assert!(!Prefs::default().hide_sites); + + let saved = serde_json::to_vec(&Prefs { hide_sites: true, ..Default::default() }).unwrap(); + assert!(serde_json::from_slice::(&saved).unwrap().hide_sites); + } +} diff --git a/linux/src/tray.rs b/linux/src/tray.rs index 3523cb79..ff00bdb5 100644 --- a/linux/src/tray.rs +++ b/linux/src/tray.rs @@ -46,6 +46,8 @@ struct State { running: bool, /// The sites, each with its worktrees; problems are in the main window. sites: Vec, + /// The Sites submenu is left out (General → Tray). + hide_sites: bool, /// The proxies (`flock proxy`), after the sites. proxies: Vec, mail_count: u32, @@ -71,6 +73,7 @@ impl State { warning: status.as_ref().and_then(|s| s.warnings.first().cloned()), needs_setup, sites: status.as_ref().map(SiteItem::all).unwrap_or_default(), + hide_sites: model.hides_sites(), proxies: status.as_ref().map(|s| s.proxies.iter().map(SiteItem::proxy).collect()).unwrap_or_default(), mail_count: status.as_ref().map_or(0, |s| s.mail_count), dump_count: status.as_ref().map_or(0, |s| s.dump_count), @@ -251,7 +254,7 @@ impl ksni::Tray for FlockTray { items.extend([item("Set Up Flock…", || Command::Open("setup")), MenuItem::Separator]); } else { items.extend([item("Open Flock", || Command::Show), MenuItem::Separator]); - if self.state.running { + if self.state.running && !self.state.hide_sites { items.push(self.sites()); } items.extend([ @@ -376,4 +379,36 @@ mod tests { .unwrap(); assert_eq!(SiteItem::proxy(&started.proxies[0]).label, "admin.test · Starting…"); } + + /// The labels of the menu's submenus. + fn submenus(hide_sites: bool) -> Vec { + let state = State { + icon: "", + headline: "Running".to_owned(), + warning: None, + needs_setup: false, + running: true, + sites: vec![SiteItem { label: "acme.test".to_owned(), url: None, worktrees: Vec::new() }], + hide_sites, + proxies: Vec::new(), + mail_count: 0, + dump_count: 0, + xdebug: false, + dumps: false, + }; + let tray = FlockTray { state, icon_theme_path: String::new(), sender: async_channel::unbounded().0 }; + ksni::Tray::menu(&tray) + .into_iter() + .filter_map(|item| match item { + MenuItem::SubMenu(submenu) => Some(submenu.label), + _ => None, + }) + .collect() + } + + #[test] + fn hides_the_sites_submenu_when_asked() { + assert_eq!(submenus(false), ["Sites"]); + assert!(submenus(true).is_empty()); + } } diff --git a/macos/Sources/FlockUI/Settings/GeneralPane.swift b/macos/Sources/FlockUI/Settings/GeneralPane.swift index ad519244..b4bcaa2f 100644 --- a/macos/Sources/FlockUI/Settings/GeneralPane.swift +++ b/macos/Sources/FlockUI/Settings/GeneralPane.swift @@ -91,7 +91,7 @@ struct GeneralPane: View { Section("Menu bar") { Toggle(isOn: $hideSitesInPanel) { Text("Hide sites in the menu bar panel") - Text("Sites stay available in Settings → Sites.") + Text("Settings → Sites still lists them.") } } diff --git a/windows/Flock.Tray.Tests/PreferencesTests.cs b/windows/Flock.Tray.Tests/PreferencesTests.cs index 10be1888..6e854694 100644 --- a/windows/Flock.Tray.Tests/PreferencesTests.cs +++ b/windows/Flock.Tray.Tests/PreferencesTests.cs @@ -28,6 +28,32 @@ public async Task LoadIsPassiveAndIgnoresLegacyEditorChoiceInAnyOrder() } } + [Fact] + public async Task PanelShowsSitesUntilTheyAreHiddenAndRemembersIt() + { + var directory = Directory.CreateTempSubdirectory("flock-preferences-"); + try + { + var path = Path.Combine(directory.FullName, "tray.json"); + // A file from before the preference existed. + await File.WriteAllTextAsync(path, "{\"Editor\":\"Cursor\",\"ExpandedSites\":\"acme\"}"); + var service = new PreferencesService(path); + Assert.False((await service.LoadAsync()).HideSitesInPanel); + Assert.False(new PreferenceData().HideSitesInPanel); + + await service.UpdateAsync(value => value with { HideSitesInPanel = true }); + + var reloaded = await new PreferencesService(path).LoadAsync(); + Assert.True(reloaded.HideSitesInPanel); + Assert.Equal("Cursor", reloaded.Editor); + Assert.Equal("acme", reloaded.ExpandedSites); + } + finally + { + Directory.Delete(directory.FullName, recursive: true); + } + } + [Fact] public async Task MissingAndCorruptFilesUseDefaultsWithoutWriting() { diff --git a/windows/Flock.Tray/Features/Preferences/PreferenceData.cs b/windows/Flock.Tray/Features/Preferences/PreferenceData.cs index c5f6e86f..38014ebf 100644 --- a/windows/Flock.Tray/Features/Preferences/PreferenceData.cs +++ b/windows/Flock.Tray/Features/Preferences/PreferenceData.cs @@ -9,4 +9,6 @@ public sealed record PreferenceData public string Channel { get; init; } = "stable"; /// The sites whose worktrees the panel shows, one per line (a string, so the record keeps its value equality). public string ExpandedSites { get; init; } = ""; + /// Leaves the Sites section out of the panel (Settings → General). + public bool HideSitesInPanel { get; init; } } \ No newline at end of file diff --git a/windows/Flock.Tray/PanelWindow.xaml b/windows/Flock.Tray/PanelWindow.xaml index 38013622..2f6cda37 100644 --- a/windows/Flock.Tray/PanelWindow.xaml +++ b/windows/Flock.Tray/PanelWindow.xaml @@ -94,9 +94,10 @@ - + - + + + + + + + + + + + + + + + + diff --git a/windows/Flock.Tray/Settings/GeneralPane.xaml.cs b/windows/Flock.Tray/Settings/GeneralPane.xaml.cs index 2caca947..e607198d 100644 --- a/windows/Flock.Tray/Settings/GeneralPane.xaml.cs +++ b/windows/Flock.Tray/Settings/GeneralPane.xaml.cs @@ -24,6 +24,7 @@ public GeneralPane(SettingsWindow window, RuntimeService model) viewModel = new GeneralViewModel(model); DataContext = viewModel; Startup.IsOn = Native.StartsAtSignIn; + HideSites.IsOn = model.Preferences.Snapshot.HideSitesInPanel; model.UpdateService.Changed += UpdateChanged; viewModel.PropertyChanged += ViewModelChanged; loaded = true; @@ -170,6 +171,24 @@ private void StartupToggled(object sender, RoutedEventArgs args) } } + private async void HideSitesToggled(object sender, RoutedEventArgs args) + { + if (!loaded || sender is not ToggleSwitch toggle || toggle.IsOn == model.Preferences.Snapshot.HideSitesInPanel) + { + return; + } + var hide = toggle.IsOn; + try + { + await model.Preferences.UpdateAsync(data => data with { HideSitesInPanel = hide }); + } + catch (Exception e) when (e is IOException or UnauthorizedAccessException or System.Text.Json.JsonException or OperationCanceledException) + { + toggle.IsOn = model.Preferences.Snapshot.HideSitesInPanel; + model.ShowRuntimeError($"Could not change the panel setting: {e.Message}"); + } + } + private async void BetaToggled(object sender, RoutedEventArgs args) { if (loaded && Beta.IsOn != viewModel.IsBeta) diff --git a/windows/Flock.Tray/ViewModels/PanelViewModel.cs b/windows/Flock.Tray/ViewModels/PanelViewModel.cs index 5edbd914..95562f36 100644 --- a/windows/Flock.Tray/ViewModels/PanelViewModel.cs +++ b/windows/Flock.Tray/ViewModels/PanelViewModel.cs @@ -27,6 +27,7 @@ public PanelViewModel(RuntimeService model) dumps = new DaemonSwitch(() => OnPropertyChanged(nameof(Dumps))); model.Changed += ModelChanged; model.Dumps.Changed += DumpsChanged; + model.Preferences.StateChanged += PreferencesChanged; ToggleDumpsCommand = new AsyncRelayCommand(SetDumpsAsync, _ => !model.Dumps.IsCaptureBusy); ToggleXdebugCommand = new AsyncRelayCommand(SetXdebugAsync); RestartCommand = new AsyncRelayCommand(model.RestartAsync, () => !IsRestarting); @@ -95,6 +96,8 @@ public bool Dumps public Visibility StatusContentVisibility => HasStatusContent ? Visibility.Visible : Visibility.Collapsed; public Visibility WarningsVisibility => Status?.Warnings.Count > 0 ? Visibility.Visible : Visibility.Collapsed; public Visibility SitesVisibility => HasSites ? Visibility.Visible : Visibility.Collapsed; + /// The Sites section, unless Settings → General hides it. + public Visibility SitesSectionVisibility => model.Preferences.Snapshot.HideSitesInPanel ? Visibility.Collapsed : Visibility.Visible; public Visibility EmptySitesVisibility => HasSites ? Visibility.Collapsed : Visibility.Visible; public Visibility NotRunningVisibility => HasStatusContent ? Visibility.Collapsed : Visibility.Visible; public Visibility SetupVisibility => NeedsSetup ? Visibility.Visible : Visibility.Collapsed; @@ -178,6 +181,12 @@ public void Dispose() released = true; model.Changed -= ModelChanged; model.Dumps.Changed -= DumpsChanged; + model.Preferences.StateChanged -= PreferencesChanged; + } + + private void PreferencesChanged() + { + OnPropertyChanged(nameof(SitesSectionVisibility)); } private void ModelChanged() From 7ba25f235152d2844ece11ea91d14c3d1e362bb4 Mon Sep 17 00:00:00 2001 From: Mansoor Khan Date: Sun, 15 Nov 2026 22:15:19 +0500 Subject: [PATCH 3/7] move linux hide sites pref write into a prefs helper --- linux/src/model.rs | 4 +--- linux/src/prefs.rs | 7 +++++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/linux/src/model.rs b/linux/src/model.rs index afd97407..3e5d9cf8 100644 --- a/linux/src/model.rs +++ b/linux/src/model.rs @@ -50,9 +50,7 @@ impl AppModel { /// Shows or hides the Sites submenu in the tray menu, and remembers it in the preferences. pub fn set_hides_sites(&self, hide: bool) -> std::io::Result<()> { - let mut p = prefs::load(); - p.hide_sites = hide; - prefs::save(&p)?; + prefs::set_hide_sites(hide)?; self.hides_sites.set(hide); self.changed(); Ok(()) diff --git a/linux/src/prefs.rs b/linux/src/prefs.rs index 7930e7aa..c551e79f 100644 --- a/linux/src/prefs.rs +++ b/linux/src/prefs.rs @@ -52,6 +52,13 @@ pub fn set_expanded(site: &str, expanded: bool) { let _ = save(&prefs); } +/// Remembers whether the tray menu leaves out the Sites submenu. +pub fn set_hide_sites(hide: bool) -> std::io::Result<()> { + let mut prefs = load(); + prefs.hide_sites = hide; + save(&prefs) +} + pub fn save(prefs: &Prefs) -> std::io::Result<()> { std::fs::create_dir_all(dir())?; std::fs::write(file(), serde_json::to_vec_pretty(prefs).expect("prefs")) From 0eaccd197b22578027ca474024461bb232b7f217 Mon Sep 17 00:00:00 2001 From: Mansoor Khan Date: Sun, 15 Nov 2026 22:15:19 +0500 Subject: [PATCH 4/7] test the windows panel sites section visibility --- windows/Flock.Tray.Tests/PanelViewModelTests.cs | 8 ++++++++ windows/Flock.Tray/ViewModels/PanelViewModel.cs | 5 ++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/windows/Flock.Tray.Tests/PanelViewModelTests.cs b/windows/Flock.Tray.Tests/PanelViewModelTests.cs index 0ff67e86..734fd12a 100644 --- a/windows/Flock.Tray.Tests/PanelViewModelTests.cs +++ b/windows/Flock.Tray.Tests/PanelViewModelTests.cs @@ -72,6 +72,14 @@ public void SiteRowOffersAToggleAndListsWorktreesOnlyWhenExpanded() Assert.Equal(Microsoft.UI.Xaml.Visibility.Visible, row.Worktrees[1].DatabaseVisibility); } + [Fact] + public void SitesSectionShowsUntilThePreferenceHidesIt() + { + Assert.Equal(Microsoft.UI.Xaml.Visibility.Visible, PanelViewModel.SitesSection(new Features.Preferences.PreferenceData())); + Assert.Equal(Microsoft.UI.Xaml.Visibility.Collapsed, + PanelViewModel.SitesSection(new Features.Preferences.PreferenceData { HideSitesInPanel = true })); + } + [Fact] public void ServiceRowUpdatesInPlaceAndRaisesNotification() { diff --git a/windows/Flock.Tray/ViewModels/PanelViewModel.cs b/windows/Flock.Tray/ViewModels/PanelViewModel.cs index 95562f36..a7c3ce56 100644 --- a/windows/Flock.Tray/ViewModels/PanelViewModel.cs +++ b/windows/Flock.Tray/ViewModels/PanelViewModel.cs @@ -97,7 +97,7 @@ public bool Dumps public Visibility WarningsVisibility => Status?.Warnings.Count > 0 ? Visibility.Visible : Visibility.Collapsed; public Visibility SitesVisibility => HasSites ? Visibility.Visible : Visibility.Collapsed; /// The Sites section, unless Settings → General hides it. - public Visibility SitesSectionVisibility => model.Preferences.Snapshot.HideSitesInPanel ? Visibility.Collapsed : Visibility.Visible; + public Visibility SitesSectionVisibility => SitesSection(model.Preferences.Snapshot); public Visibility EmptySitesVisibility => HasSites ? Visibility.Collapsed : Visibility.Visible; public Visibility NotRunningVisibility => HasStatusContent ? Visibility.Collapsed : Visibility.Visible; public Visibility SetupVisibility => NeedsSetup ? Visibility.Visible : Visibility.Collapsed; @@ -166,6 +166,9 @@ private async Task SaveExpandedAsync(string value) } } + internal static Visibility SitesSection(Features.Preferences.PreferenceData preferences) => + preferences.HideSitesInPanel ? Visibility.Collapsed : Visibility.Visible; + public void DismissError() { model.DismissError(); From 4b69dd2312274e98ce5f548ac011f6db6d6158df Mon Sep 17 00:00:00 2001 From: Mansoor Khan Date: Mon, 16 Nov 2026 10:07:54 +0500 Subject: [PATCH 5/7] restore the linux tray switch when saving fails --- linux/src/panes/general.rs | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/linux/src/panes/general.rs b/linux/src/panes/general.rs index d517a812..2521300e 100644 --- a/linux/src/panes/general.rs +++ b/linux/src/panes/general.rs @@ -107,12 +107,24 @@ impl GeneralPane { fn tray(&self) -> adw::PreferencesGroup { let group = group("Tray", ""); + let row = adw::SwitchRow::builder() + .title("Hide sites in the tray menu") + .subtitle("The Sites page still lists them.") + .active(self.model.hides_sites()) + .build(); let (model, banner) = (self.model.clone(), self.banner.clone()); - group.add(&switch_row("Hide sites in the tray menu", "The Sites page still lists them.", self.model.hides_sites(), move |on| { + row.connect_active_notify(move |row| { + let on = row.is_active(); + // Also the switch going back after a failed save. + if on == model.hides_sites() { + return; + } if let Err(e) = model.set_hides_sites(on) { report(&banner, Some(format!("Could not change the tray setting: {e}"))); + row.set_active(!on); } - })); + }); + group.add(&row); group } From c33dd39cdd32bd9f480759497d3977acf654b419 Mon Sep 17 00:00:00 2001 From: Mansoor Khan Date: Mon, 16 Nov 2026 10:07:54 +0500 Subject: [PATCH 6/7] disable the windows hide sites switch while saving --- windows/Flock.Tray/Settings/GeneralPane.xaml.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/windows/Flock.Tray/Settings/GeneralPane.xaml.cs b/windows/Flock.Tray/Settings/GeneralPane.xaml.cs index e607198d..12c631a0 100644 --- a/windows/Flock.Tray/Settings/GeneralPane.xaml.cs +++ b/windows/Flock.Tray/Settings/GeneralPane.xaml.cs @@ -178,6 +178,8 @@ private async void HideSitesToggled(object sender, RoutedEventArgs args) return; } var hide = toggle.IsOn; + // Until the save commits, the snapshot still has the old value: a second toggle would be ignored. + toggle.IsEnabled = false; try { await model.Preferences.UpdateAsync(data => data with { HideSitesInPanel = hide }); @@ -187,6 +189,10 @@ private async void HideSitesToggled(object sender, RoutedEventArgs args) toggle.IsOn = model.Preferences.Snapshot.HideSitesInPanel; model.ShowRuntimeError($"Could not change the panel setting: {e.Message}"); } + finally + { + toggle.IsEnabled = true; + } } private async void BetaToggled(object sender, RoutedEventArgs args) From 24ee93fd129d2cb8cdaf8e0f0c813a8bb26cba75 Mon Sep 17 00:00:00 2001 From: Mansoor Khan Date: Mon, 16 Nov 2026 10:07:54 +0500 Subject: [PATCH 7/7] give the windows hide sites switch an accessible name --- windows/Flock.Tray/Settings/GeneralPane.xaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/windows/Flock.Tray/Settings/GeneralPane.xaml b/windows/Flock.Tray/Settings/GeneralPane.xaml index 5bf62c93..ba5e93f4 100644 --- a/windows/Flock.Tray/Settings/GeneralPane.xaml +++ b/windows/Flock.Tray/Settings/GeneralPane.xaml @@ -2,7 +2,8 @@ x:Class="Flock.Tray.Settings.GeneralPane" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" - xmlns:controls="using:Flock.Tray.Controls"> + xmlns:controls="using:Flock.Tray.Controls" + xmlns:automation="using:Microsoft.UI.Xaml.Automation"> @@ -109,7 +110,8 @@ - +