From 26067f9c46eee8f71bcea0dd03dd1da2f18618f0 Mon Sep 17 00:00:00 2001 From: Antoine Beyeler Date: Tue, 5 Nov 2024 17:47:19 +0100 Subject: [PATCH] Improve messages --- .../blueprint/components/map_provider.fbs | 6 ------ .../src/blueprint/components/map_provider.rs | 18 +++--------------- .../viewer/re_component_ui/src/map_provider.rs | 4 +++- .../blueprint/components/map_provider.hpp | 6 ------ .../rerun/blueprint/components/map_provider.py | 18 +++--------------- 5 files changed, 9 insertions(+), 43 deletions(-) diff --git a/crates/store/re_types/definitions/rerun/blueprint/components/map_provider.fbs b/crates/store/re_types/definitions/rerun/blueprint/components/map_provider.fbs index af82733e7d63..959720efd79b 100644 --- a/crates/store/re_types/definitions/rerun/blueprint/components/map_provider.fbs +++ b/crates/store/re_types/definitions/rerun/blueprint/components/map_provider.fbs @@ -13,17 +13,11 @@ enum MapProvider: ubyte ( OpenStreetMap (default), /// Mapbox Streets is a minimalistic map designed by Mapbox. - /// - /// **Note**: Requires a Mapbox access token in the settings or using the `RERUN_MAPBOX_ACCESS_TOKEN` environment variable. MapboxStreets, /// Mapbox Dark is a dark-themed map designed by Mapbox. - /// - /// **Note**: Requires a Mapbox access token in the settings or using the `RERUN_MAPBOX_ACCESS_TOKEN` environment variable. MapboxDark, /// Mapbox Satellite is a satellite map designed by Mapbox. - /// - /// **Note**: Requires a Mapbox access token in the settings or using the `RERUN_MAPBOX_ACCESS_TOKEN` environment variable. MapboxSatellite, } diff --git a/crates/store/re_types/src/blueprint/components/map_provider.rs b/crates/store/re_types/src/blueprint/components/map_provider.rs index 65962e353be7..ad8101a200ff 100644 --- a/crates/store/re_types/src/blueprint/components/map_provider.rs +++ b/crates/store/re_types/src/blueprint/components/map_provider.rs @@ -28,18 +28,12 @@ pub enum MapProvider { OpenStreetMap = 1, /// Mapbox Streets is a minimalistic map designed by Mapbox. - /// - /// **Note**: Requires a Mapbox access token in the settings or using the `RERUN_MAPBOX_ACCESS_TOKEN` environment variable. MapboxStreets = 2, /// Mapbox Dark is a dark-themed map designed by Mapbox. - /// - /// **Note**: Requires a Mapbox access token in the settings or using the `RERUN_MAPBOX_ACCESS_TOKEN` environment variable. MapboxDark = 3, /// Mapbox Satellite is a satellite map designed by Mapbox. - /// - /// **Note**: Requires a Mapbox access token in the settings or using the `RERUN_MAPBOX_ACCESS_TOKEN` environment variable. MapboxSatellite = 4, } @@ -58,15 +52,9 @@ impl ::re_types_core::reflection::Enum for MapProvider { fn docstring_md(self) -> &'static str { match self { Self::OpenStreetMap => "`OpenStreetMap` is the default map provider.", - Self::MapboxStreets => { - "Mapbox Streets is a minimalistic map designed by Mapbox.\n\n**Note**: Requires a Mapbox access token in the settings or using the `RERUN_MAPBOX_ACCESS_TOKEN` environment variable." - } - Self::MapboxDark => { - "Mapbox Dark is a dark-themed map designed by Mapbox.\n\n**Note**: Requires a Mapbox access token in the settings or using the `RERUN_MAPBOX_ACCESS_TOKEN` environment variable." - } - Self::MapboxSatellite => { - "Mapbox Satellite is a satellite map designed by Mapbox.\n\n**Note**: Requires a Mapbox access token in the settings or using the `RERUN_MAPBOX_ACCESS_TOKEN` environment variable." - } + Self::MapboxStreets => "Mapbox Streets is a minimalistic map designed by Mapbox.", + Self::MapboxDark => "Mapbox Dark is a dark-themed map designed by Mapbox.", + Self::MapboxSatellite => "Mapbox Satellite is a satellite map designed by Mapbox.", } } } diff --git a/crates/viewer/re_component_ui/src/map_provider.rs b/crates/viewer/re_component_ui/src/map_provider.rs index 8fcff6f6fed3..b44c0b990b22 100644 --- a/crates/viewer/re_component_ui/src/map_provider.rs +++ b/crates/viewer/re_component_ui/src/map_provider.rs @@ -15,7 +15,9 @@ impl VariantAvailableProvider for MapProviderVariantAvailable { VariantAvailable::Yes } else { VariantAvailable::No { - reason_markdown: "Mapbox access token is not set. ".to_owned(), + reason_markdown: "A Mapbox access token is not available. You can set it in the \ + settings or using the `RERUN_MAPBOX_ACCESS_TOKEN` environment variable." + .to_owned(), } }; diff --git a/rerun_cpp/src/rerun/blueprint/components/map_provider.hpp b/rerun_cpp/src/rerun/blueprint/components/map_provider.hpp index 450519b812d8..1dd03dbd68e7 100644 --- a/rerun_cpp/src/rerun/blueprint/components/map_provider.hpp +++ b/rerun_cpp/src/rerun/blueprint/components/map_provider.hpp @@ -27,18 +27,12 @@ namespace rerun::blueprint::components { OpenStreetMap = 1, /// Mapbox Streets is a minimalistic map designed by Mapbox. - /// - /// **Note**: Requires a Mapbox access token in the settings or using the `RERUN_MAPBOX_ACCESS_TOKEN` environment variable. MapboxStreets = 2, /// Mapbox Dark is a dark-themed map designed by Mapbox. - /// - /// **Note**: Requires a Mapbox access token in the settings or using the `RERUN_MAPBOX_ACCESS_TOKEN` environment variable. MapboxDark = 3, /// Mapbox Satellite is a satellite map designed by Mapbox. - /// - /// **Note**: Requires a Mapbox access token in the settings or using the `RERUN_MAPBOX_ACCESS_TOKEN` environment variable. MapboxSatellite = 4, }; } // namespace rerun::blueprint::components diff --git a/rerun_py/rerun_sdk/rerun/blueprint/components/map_provider.py b/rerun_py/rerun_sdk/rerun/blueprint/components/map_provider.py index 3a77f4990089..eb52209dd421 100644 --- a/rerun_py/rerun_sdk/rerun/blueprint/components/map_provider.py +++ b/rerun_py/rerun_sdk/rerun/blueprint/components/map_provider.py @@ -28,25 +28,13 @@ class MapProvider(Enum): """`OpenStreetMap` is the default map provider.""" MapboxStreets = 2 - """ - Mapbox Streets is a minimalistic map designed by Mapbox. - - **Note**: Requires a Mapbox access token in the settings or using the `RERUN_MAPBOX_ACCESS_TOKEN` environment variable. - """ + """Mapbox Streets is a minimalistic map designed by Mapbox.""" MapboxDark = 3 - """ - Mapbox Dark is a dark-themed map designed by Mapbox. - - **Note**: Requires a Mapbox access token in the settings or using the `RERUN_MAPBOX_ACCESS_TOKEN` environment variable. - """ + """Mapbox Dark is a dark-themed map designed by Mapbox.""" MapboxSatellite = 4 - """ - Mapbox Satellite is a satellite map designed by Mapbox. - - **Note**: Requires a Mapbox access token in the settings or using the `RERUN_MAPBOX_ACCESS_TOKEN` environment variable. - """ + """Mapbox Satellite is a satellite map designed by Mapbox.""" @classmethod def auto(cls, val: str | int | MapProvider) -> MapProvider: