From 87c5001da1ba00d655fbaa920c48e99f764e02a3 Mon Sep 17 00:00:00 2001 From: Jalil Arfaoui Date: Thu, 19 Mar 2026 13:39:51 +0100 Subject: [PATCH] Remove unreliable max bitrate from Speed line NM.AccessPoint.get_max_bitrate() reports a value that doesn't account for MIMO spatial streams or extended channel widths, leading to the negotiated speed appearing higher than the supposed max (e.g. 1729 vs 540). Remove the max from the connected info Speed line where the comparison is misleading. Keep it in the AP list where it serves as a relative indicator between access points. --- metadata.json | 2 +- src/extension.ts | 19 +++++-------------- src/types.ts | 1 - src/wifiInfo.ts | 1 - 4 files changed, 6 insertions(+), 17 deletions(-) diff --git a/metadata.json b/metadata.json index 1b96bee..4ccdc58 100644 --- a/metadata.json +++ b/metadata.json @@ -3,7 +3,7 @@ "name": "WiFi Signal Plus", "description": "Displays WiFi generation (4/5/6/7) in the top bar with detailed connection info on hover", "shell-version": ["45", "46", "47", "48", "49"], - "version": 6, + "version": 7, "url": "https://github.com/JalilArfaoui/gnome-extension-wifi-signal-plus", "donations": { "liberapay": "Jalil" diff --git a/src/extension.ts b/src/extension.ts index 698b598..a0f7269 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -603,27 +603,18 @@ export default class WifiSignalPlusExtension extends Extension { } private formatBitrate(info: ConnectedInfo): string { - const { txBitrate, rxBitrate, bitrate, maxBitrate } = info; + const { txBitrate, rxBitrate, bitrate } = info; - let speed: string; if (txBitrate !== null && rxBitrate !== null) { const tx = txBitrate as number; const rx = rxBitrate as number; - speed = tx === rx ? `${tx} Mbit/s` : `↑${tx} ↓${rx} Mbit/s`; + return tx === rx ? `${tx} Mbit/s` : `↑${tx} ↓${rx} Mbit/s`; } else if (txBitrate !== null) { - speed = `↑${txBitrate} Mbit/s`; + return `↑${txBitrate} Mbit/s`; } else if (rxBitrate !== null) { - speed = `↓${rxBitrate} Mbit/s`; - } else { - speed = `${bitrate} Mbit/s`; + return `↓${rxBitrate} Mbit/s`; } - - const max = maxBitrate as number; - if (max > 0) { - speed += ` (max ${max})`; - } - - return speed; + return `${bitrate} Mbit/s`; } private formatChannelWidth(width: ChannelWidthMHz | null): string { diff --git a/src/types.ts b/src/types.ts index d03d178..129c6f0 100644 --- a/src/types.ts +++ b/src/types.ts @@ -142,7 +142,6 @@ export interface ConnectedInfo extends BaseConnectionInfo { readonly channelWidth: ChannelWidthMHz | null; readonly txBitrate: BitrateMbps | null; readonly rxBitrate: BitrateMbps | null; - readonly maxBitrate: BitrateMbps; } export interface ScannedNetwork { diff --git a/src/wifiInfo.ts b/src/wifiInfo.ts index 7b5ffce..c51285a 100644 --- a/src/wifiInfo.ts +++ b/src/wifiInfo.ts @@ -297,7 +297,6 @@ export class WifiInfoService { channelWidth: iwInfo.channelWidth, txBitrate: iwInfo.txBitrate, rxBitrate: iwInfo.rxBitrate, - maxBitrate: asBitrateMbps(ap.get_max_bitrate() / 1000), }); }