From 954105eb70b81664bcbf9babc5ea96e74dc4e819 Mon Sep 17 00:00:00 2001 From: Phecda Date: Thu, 23 Jul 2026 20:49:38 +0800 Subject: [PATCH 1/2] fix(gui): keep macos device menu current --- crates/openlogi-gui/src/app_menu.rs | 7 +++++-- crates/openlogi-gui/src/main.rs | 3 ++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/crates/openlogi-gui/src/app_menu.rs b/crates/openlogi-gui/src/app_menu.rs index 7530edb7..d718c3f6 100644 --- a/crates/openlogi-gui/src/app_menu.rs +++ b/crates/openlogi-gui/src/app_menu.rs @@ -223,10 +223,13 @@ fn device_menu_items(cx: &App) -> Vec { Some(battery) => format!("{} ยท {}%", record.display_name, battery.percentage), None => record.display_name.clone(), }; - items.push(MenuItem::action(title, OpenSettings).disabled(true)); + items.push(MenuItem::action(title, gpui::NoAction).disabled(true)); } } - _ => items.push(MenuItem::action(tr!("No devices connected"), OpenSettings).disabled(true)), + _ => { + items + .push(MenuItem::action(tr!("No devices connected"), gpui::NoAction).disabled(true)); + } } items diff --git a/crates/openlogi-gui/src/main.rs b/crates/openlogi-gui/src/main.rs index 07d07d06..1f0945e7 100644 --- a/crates/openlogi-gui/src/main.rs +++ b/crates/openlogi-gui/src/main.rs @@ -340,9 +340,10 @@ fn main() -> Result<()> { ) }); // The steady poll mostly repeats an identical snapshot; - // skip the full-window invalidation for those. + // skip the full-window invalidation and menu rebuild for those. if changed { cx.refresh_windows(); + app_menu::rebuild(cx); } (auto_download, asset_source, models) }); From ee9f22768dcffe3a5f8ca69b2bb196bd78b4f86c Mon Sep 17 00:00:00 2001 From: AprilNEA Date: Sat, 1 Aug 2026 06:14:44 +0800 Subject: [PATCH 2/2] fix(gui): rebuild device menu only for inventory changes --- crates/openlogi-gui/src/main.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/openlogi-gui/src/main.rs b/crates/openlogi-gui/src/main.rs index 1f0945e7..ab4380ab 100644 --- a/crates/openlogi-gui/src/main.rs +++ b/crates/openlogi-gui/src/main.rs @@ -312,7 +312,7 @@ fn main() -> Result<()> { // Scanning window overlaps the first sync's completion). let force_refresh = inventory_ready && std::mem::take(&mut assets_dirty); let (auto_download, asset_source, models) = cx.update(|cx| { - let (changed, auto_download, asset_source, models) = cx.update_global::(|state, _| { + let (changed, merged, auto_download, asset_source, models) = cx.update_global::(|state, _| { // Merge only *completed* enumerations. A not-yet-ready // agent can only serve an empty pre-enumeration list, and // counting those as misses would wipe the device list (and @@ -334,6 +334,7 @@ fn main() -> Result<()> { let settings = state.app_settings(); ( changed, + merged, settings.auto_download_assets, settings.asset_source, state.asset_models(), @@ -343,6 +344,8 @@ fn main() -> Result<()> { // skip the full-window invalidation and menu rebuild for those. if changed { cx.refresh_windows(); + } + if merged { app_menu::rebuild(cx); } (auto_download, asset_source, models)