mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-06-07 19:59:14 -04:00
fix(Network): Bucket WiFi signal for stable list order (#2449)
Sort networks by signal bucket of 25 with SSID as tiebreaker so minor RSSI fluctuations between scans no longer reshuffle the list while the user is selecting a network. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -541,7 +541,11 @@ Rectangle {
|
||||
return -1;
|
||||
if (b.ssid === ssid)
|
||||
return 1;
|
||||
return b.signal - a.signal;
|
||||
const aBucket = Math.floor((a.signal || 0) / 25);
|
||||
const bBucket = Math.floor((b.signal || 0) / 25);
|
||||
if (aBucket !== bBucket)
|
||||
return bBucket - aBucket;
|
||||
return (a.ssid || "").localeCompare(b.ssid || "");
|
||||
});
|
||||
return sorted;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user