diff --git a/openpilot/starpilot/ui/onroad_personality.py b/openpilot/starpilot/ui/onroad_personality.py index 1c35a06347..f3a34cc883 100644 --- a/openpilot/starpilot/ui/onroad_personality.py +++ b/openpilot/starpilot/ui/onroad_personality.py @@ -47,6 +47,12 @@ class PersonalityWidget: width, height = right - left, bottom - top rect = rl.Rectangle(left, top, width, height) draw_widget_frame(rect, state.customization, profile, 'following_distance') + if profile == Profile.COMPACT and state.stock_cruise_active: + self.reset() + if routine: + texture = gui_app.texture('icons_mici/longitudinal/speed_dial.png') + self._draw_centered((texture, 56, 48), rect, 126, 0.9) + return self.draw(rect, personality=state.personality, has_lead=state.lead_detected, longitudinal_active=state.cruise_active, traffic_mode=state.traffic_selected or state.traffic_mode, gas_override=state.gas_pressed_override, visible=routine) diff --git a/openpilot/starpilot/ui/onroad_state.py b/openpilot/starpilot/ui/onroad_state.py index cd96f6b355..7bcbc9bd23 100644 --- a/openpilot/starpilot/ui/onroad_state.py +++ b/openpilot/starpilot/ui/onroad_state.py @@ -399,7 +399,8 @@ class OnroadInput: def _personality_target(self, state: OnroadState) -> tuple | None: if (not state.camera_available or state.quick_select_open or state.alert.size != AlertSize.NONE and not is_personality_notice(state.alert) or - self.profile == Profile.COMPACT and state.reversing and state.appearance.camera_view != CameraViewChoice.NONE): + self.profile == Profile.COMPACT and (state.stock_cruise_active or + state.reversing and state.appearance.camera_view != CameraViewChoice.NONE)): return None return personality_bounds(self.profile, state) diff --git a/openpilot/starpilot/ui/tests/test_long_indicator.py b/openpilot/starpilot/ui/tests/test_long_indicator.py index 979cf85127..100b0fb7de 100644 --- a/openpilot/starpilot/ui/tests/test_long_indicator.py +++ b/openpilot/starpilot/ui/tests/test_long_indicator.py @@ -207,3 +207,12 @@ def test_invisible_art_avoids_gpu_submission_without_losing_faint_visible_art(di else: draw.assert_called_once() assert draw.call_args.args[-1].a == visible_alpha + +def test_compact_active_stock_cruise_draws_dial_instead_of_personality(display): + state = road(longitudinal_active=False, stock_cruise_active=True) + display.render(state) + display._draw_centered.assert_called_once() + assert display._draw_centered.call_args.args[0][0].path.endswith('/speed_dial.png') + display._draw_centered.reset_mock() + display.render(road()) + assert display._draw_centered.call_count == 8