From b2e94548b9d29ec64c5be43d9cce49ab3b7bf399 Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Thu, 26 Feb 2026 01:20:06 -0800 Subject: [PATCH] ui: move connected wifi buttons to front independent of scan results (#37417) * move items * clean up * wtf * debg --- selfdrive/ui/mici/layouts/settings/network/wifi_ui.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/selfdrive/ui/mici/layouts/settings/network/wifi_ui.py b/selfdrive/ui/mici/layouts/settings/network/wifi_ui.py index c69dc8b225..8b8522ba19 100644 --- a/selfdrive/ui/mici/layouts/settings/network/wifi_ui.py +++ b/selfdrive/ui/mici/layouts/settings/network/wifi_ui.py @@ -1,4 +1,6 @@ import math +import time + import numpy as np import pyray as rl from collections.abc import Callable @@ -326,8 +328,6 @@ class WifiUIMici(NavWidget): if isinstance(btn, WifiButton) and btn.network.ssid not in self._networks: btn.set_network_missing(True) - self._move_network_to_front(self._wifi_manager.wifi_state.ssid) - def _connect_with_password(self, ssid: str, password: str): self._wifi_manager.connect_to_network(ssid, password) self._move_network_to_front(ssid, scroll=True) @@ -382,6 +382,10 @@ class WifiUIMici(NavWidget): def _update_state(self): super()._update_state() + t = time.monotonic() + self._move_network_to_front(self._wifi_manager.wifi_state.ssid) + print('took', (time.monotonic() - t) * 1000, 'ms to move network to front') + # Show loading animation near end max_scroll = max(self._scroller.content_size - self._scroller.rect.width, 1) progress = -self._scroller.scroll_panel.get_offset() / max_scroll