From f69e943d91c3158e3d4f22efcf796c7d0d166578 Mon Sep 17 00:00:00 2001 From: akrm al-hakimi Date: Thu, 2 Jul 2026 20:59:17 -0400 Subject: [PATCH] fix(network): restore IPv4 display and wifi list ordering - Strip the CIDR suffix (/24) from the shown IPv4 address - Sort visible wireless networks by signal strength again - Filter out empty-SSID "hidden network" entries from the list --- cosmic-applet-network/src/app.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cosmic-applet-network/src/app.rs b/cosmic-applet-network/src/app.rs index 2fb1e3f6..cbf46fab 100644 --- a/cosmic-applet-network/src/app.rs +++ b/cosmic-applet-network/src/app.rs @@ -456,6 +456,9 @@ fn ip_address_elements<'a>( ) -> Vec> { let mut elements = Vec::with_capacity(1); if let Some(addr) = ip4_address { + // Strip the subnet mask (e.g. "10.0.0.2/24" -> "10.0.0.2"); the drop-down + // only needs the address itself for glancing at the host on a local network. + let addr = addr.split('/').next().unwrap_or(addr.as_str()); elements.push(text(format!("{}: {}", fl!("ipv4"), addr)).size(12).into()); } elements @@ -629,9 +632,10 @@ fn snapshot_to_applet(snapshot: NetworkSnapshot) -> AppletSnapshot { }) .collect(); - let wireless_access_points = summary + let mut wireless_access_points = summary .wifi_groups .iter() + .filter(|group| !group.ssid.is_empty()) .map(|group| { let strongest = &group.strongest; AccessPoint { @@ -646,6 +650,7 @@ fn snapshot_to_applet(snapshot: NetworkSnapshot) -> AppletSnapshot { } }) .collect::>(); + wireless_access_points.sort_by(|a, b| b.strength.cmp(&a.strength)); let known_access_points = summary .wifi_groups