WifiUi: pause updates while user is scrolling (#36866)

* pause updates while user is scrolling

* clean up
This commit is contained in:
Shane Smiskol
2025-12-13 05:14:21 -08:00
committed by GitHub
parent 65008d281f
commit 1504e10380
@@ -9,6 +9,7 @@ from openpilot.selfdrive.ui.mici.widgets.dialog import BigMultiOptionDialog, Big
from openpilot.system.ui.lib.application import gui_app, MousePos, FontWeight
from openpilot.system.ui.widgets import Widget, NavWidget
from openpilot.system.ui.lib.wifi_manager import WifiManager, Network, SecurityType
from openpilot.system.ui.lib.scroll_panel2 import ScrollState
def normalize_ssid(ssid: str) -> str:
@@ -366,6 +367,11 @@ class WifiUIMici(BigMultiOptionDialog):
self._network_info_page.update_networks(self._networks)
def _update_buttons(self):
# Don't update buttons while user is actively scrolling
scroll_state = self._scroller.scroll_panel.state
if scroll_state != ScrollState.STEADY:
return
for network in self._networks.values():
# pop and re-insert to eliminate stuttering on update (prevents position lost for a frame)
network_button_idx = next((i for i, btn in enumerate(self._scroller._items) if btn.option == network.ssid), None)