diff --git a/openpilot/selfdrive/ui/tests/diff/replay_script.py b/openpilot/selfdrive/ui/tests/diff/replay_script.py index 109f32e47ada96..91e6d3b921d1ca 100644 --- a/openpilot/selfdrive/ui/tests/diff/replay_script.py +++ b/openpilot/selfdrive/ui/tests/diff/replay_script.py @@ -138,6 +138,10 @@ def setup_update_available(available: bool = True) -> None: params.remove("UpdaterTargetBranch") +def set_updater_state(state: str) -> None: + Params().put("UpdaterState", state, block=True) + + def setup_calibration_params() -> None: params = Params() # live calibration @@ -479,6 +483,9 @@ def type_keyboard() -> None: # === Settings - Software === script.setup(lambda: setup_update_available(False), wait_after=0) # start with no update available script.click(278, 720) # software + script.setup(lambda: set_updater_state("checking...")) # updater mid-check + script.setup(lambda: set_updater_state("downloading...")) # updater mid-download + script.setup(lambda: set_updater_state("idle"), wait_after=0) for _ in range(2): script.click(720, 120) # toggle current release notes script.setup(setup_update_available) # set update available diff --git a/openpilot/system/ui/widgets/list_view.py b/openpilot/system/ui/widgets/list_view.py index 82613c37c8efac..705cb476de34ba 100644 --- a/openpilot/system/ui/widgets/list_view.py +++ b/openpilot/system/ui/widgets/list_view.py @@ -1,3 +1,4 @@ +import math import os import pyray as rl from collections.abc import Callable @@ -104,7 +105,9 @@ def get_width_hint(self) -> float: value_text = self.value if value_text: text_width = measure_text_cached(self._font, value_text, ITEM_TEXT_FONT_SIZE).x - return text_width + BUTTON_WIDTH + TEXT_PADDING + # round up so the width survives float32 storage in rl.Rectangle, otherwise the + # value label can come out a fraction of a pixel too narrow and get elided + return math.ceil(text_width) + BUTTON_WIDTH + TEXT_PADDING else: return BUTTON_WIDTH