From 1334ce24a582952586690f3ed3631176bd266821 Mon Sep 17 00:00:00 2001 From: dirwin31 <83434411+dirwin31@users.noreply.github.com> Date: Tue, 3 Nov 2026 17:06:09 -0800 Subject: [PATCH 01/10] StarPort: draw the default layer order when none is saved - Use StarPort's default widget layer order in the car projection when no widgetOrder is saved, so the map no longer draws over the PiP - Make the layout editor and the car screen agree on that order - Cover the default order in the projection layout and widget layer tests --- openpilot/starpilot/system/starport/projection_layout.py | 7 ++++--- .../system/starport/tests/test_projection_layout.py | 9 +++++++++ openpilot/starpilot/ui/tests/test_widget_layers.py | 4 ++-- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/openpilot/starpilot/system/starport/projection_layout.py b/openpilot/starpilot/system/starport/projection_layout.py index 3dd3151639..84a1ae282c 100644 --- a/openpilot/starpilot/system/starport/projection_layout.py +++ b/openpilot/starpilot/system/starport/projection_layout.py @@ -385,9 +385,10 @@ def projection_customization(document, base_customization): shifts['torque_bar'] = (tx - native['torque_bar']['default']['x'], ty - native['torque_bar']['default']['y']) result = copy.deepcopy(base_customization) result['clock24Hour'] = document.get('clock24Hour', False) - result.setdefault('widgetOrder', {}).pop('large', None) - if 'widgetOrder' in document: - result['widgetOrder']['large'] = list(document['widgetOrder']) + # Without a saved order the car screen draws the same default layers the theme maker shows, + # instead of the native view's unordered fallback (which puts the map over PiP). + result.setdefault('widgetOrder', {})['large'] = list(document['widgetOrder'] if 'widgetOrder' in document else + layout_metadata_for_viewport((width, height))['widgetOrder']) result['layouts']['large'] = {} for key, placement in document['widgets'].items(): dx, dy = shifts.get(key, (0, 0)) diff --git a/openpilot/starpilot/system/starport/tests/test_projection_layout.py b/openpilot/starpilot/system/starport/tests/test_projection_layout.py index aa1bdc839f..50352929a6 100644 --- a/openpilot/starpilot/system/starport/tests/test_projection_layout.py +++ b/openpilot/starpilot/system/starport/tests/test_projection_layout.py @@ -34,6 +34,15 @@ class TestProjectionLayout(unittest.TestCase): self.assertGreaterEqual(placed[axis], metadata['bounds'][axis]) self.assertLessEqual(placed[axis] + widget[extent], metadata['bounds'][axis] + metadata['bounds'][extent]) + def test_unsaved_layer_order_draws_the_editor_default(self): + document = default_layout(SCREEN) + self.assertNotIn('widgetOrder', document) + order = projection_customization(document, default_document())['widgetOrder']['large'] + self.assertEqual(order, layout_metadata(SCREEN)['widgetOrder']) + self.assertLess(order.index(NAV_MAP), order.index('pip_right')) + saved = [NAV_MAP, *(key for key in order if key != NAV_MAP)][::-1] + self.assertEqual(projection_customization({**document, 'widgetOrder': saved}, default_document())['widgetOrder']['large'], saved) + def test_sources_save_actual_attached_actions_inside_each_projection_screen(self): from openpilot.starpilot.ui.onroad_customization import default_document, placement for viewport in ((1860, 1080), (2880, 1080), (1920, 1440)): diff --git a/openpilot/starpilot/ui/tests/test_widget_layers.py b/openpilot/starpilot/ui/tests/test_widget_layers.py index b53ee6c617..0430419055 100644 --- a/openpilot/starpilot/ui/tests/test_widget_layers.py +++ b/openpilot/starpilot/ui/tests/test_widget_layers.py @@ -43,9 +43,9 @@ def test_projection_order_is_independent_from_native_and_survives_decode(): native['widgetOrder'] = {profile: list(DEFAULT_WIDGET_ORDER[profile]) for profile in PROFILES} before = copy.deepcopy(native) projection = default_layout_for_viewport((2880, 1080)) - # Legacy AA layouts must not inherit native large ordering. - assert 'large' not in projection_customization(projection, native)['widgetOrder'] + # Legacy AA layouts must not inherit native large ordering; they draw the editor's default layers. default_order = layout_metadata_for_viewport((2880, 1080))['widgetOrder'] + assert projection_customization(projection, native)['widgetOrder']['large'] == default_order projection['widgetOrder'] = [*reversed([key for key in default_order if key != CAR_EXIT]), CAR_EXIT] decoded = decode_layout_for_viewport(json.dumps(projection).encode(), (2880, 1080)) assert decoded == projection From 11a65c1010b2a15fe4a9ea9f22ec057390a78bd0 Mon Sep 17 00:00:00 2001 From: dirwin31 <83434411+dirwin31@users.noreply.github.com> Date: Tue, 3 Nov 2026 17:06:09 -0800 Subject: [PATCH 02/10] Maps: lane guidance, calmer rotation and steadier navigation layout - Add lane guidance to the on-road navigation banner, fed by new route engine fields in the custom cereal schema - Calm map rotation and steady the navigation layout, including the Galaxy layout preview - Add route runtime, on-road map and navigation tests --- openpilot/cereal/custom.capnp | 6 + .../starpilot/galaxy/web/js/onroad-layout.js | 21 +++- .../starpilot/navigation/route_engine.py | 27 ++++- .../navigation/tests/test_route_runtime.py | 24 ++++ .../starpilot/ui/layout_preview_renderer.py | 4 +- openpilot/starpilot/ui/navigation_state.py | 12 +- openpilot/starpilot/ui/onroad_map.py | 107 ++++++++++++++++- openpilot/starpilot/ui/onroad_navigation.py | 111 ++++++++++++++---- .../starpilot/ui/tests/test_onroad_map.py | 105 ++++++++++++++++- .../ui/tests/test_onroad_navigation.py | 75 +++++++++++- 10 files changed, 450 insertions(+), 42 deletions(-) diff --git a/openpilot/cereal/custom.capnp b/openpilot/cereal/custom.capnp index 7545955c1f..c50a4be203 100644 --- a/openpilot/cereal/custom.capnp +++ b/openpilot/cereal/custom.capnp @@ -87,6 +87,12 @@ struct StarPilotCarControl @0x81c2f05a394cf4af { distanceMeters @3 :Float32; remainingDistanceMeters @4 :Float32; remainingDurationSeconds @5 :Float32; + lanes @6 :List(Lane); + } + struct Lane { + active @0 :Bool; + directions @1 :List(Text); + activeDirection @2 :Text; } version @12 :UInt16; } diff --git a/openpilot/starpilot/galaxy/web/js/onroad-layout.js b/openpilot/starpilot/galaxy/web/js/onroad-layout.js index 6e5d529f23..db0beb1438 100644 --- a/openpilot/starpilot/galaxy/web/js/onroad-layout.js +++ b/openpilot/starpilot/galaxy/web/js/onroad-layout.js @@ -264,13 +264,18 @@ export const LayoutWidgetPreview = { - - + 500 ft + Turn right onto Las Vegas Blvd + + + + + + - Turn right onto - Las Vegas Blvd - 500 ft - 4.2 mi - 9 min + + + ETA 3:51 PM @@ -293,6 +298,10 @@ export const LayoutWidgetPreview = { + + + Desert Inn Road +