From 8d6dcdb227d397ac43e883462220181fdfef092d Mon Sep 17 00:00:00 2001 From: daplugg23 Date: Thu, 5 Feb 2026 17:40:13 -0600 Subject: [PATCH] fix(location): correct UI layout and translation keys Resolve vertical text rendering issue by using Modifier.weight(1f) in ConfigSelector. Add proper translation keys to the 'better_location' block in en_US.json so they are accessible to BetterLocationRoot. Update key references to match the new structure. - Add keys: location_search_provider_title, google_maps_api_key_title, option_osm, option_google_maps. - Fix UI layout to handle text wrapping properly. --- .../manager/pages/location/BetterLocationRoot.kt | 16 ++++++++++------ common/src/main/assets/lang/en_US.json | 6 +++++- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/app/src/main/kotlin/me/eternal/purrfectsnap/ui/manager/pages/location/BetterLocationRoot.kt b/app/src/main/kotlin/me/eternal/purrfectsnap/ui/manager/pages/location/BetterLocationRoot.kt index d753ecae..68dd2c22 100644 --- a/app/src/main/kotlin/me/eternal/purrfectsnap/ui/manager/pages/location/BetterLocationRoot.kt +++ b/app/src/main/kotlin/me/eternal/purrfectsnap/ui/manager/pages/location/BetterLocationRoot.kt @@ -427,9 +427,13 @@ class BetterLocationRoot : Routes.Route() { .padding(horizontal = 16.dp, vertical = 12.dp), verticalAlignment = Alignment.CenterVertically ) { - Text(text = text) - Spacer(modifier = Modifier.weight(1f)) - Text(text = value, color = PurrfectPalette.textSecondary, fontSize = 14.sp) + Text(text = text, modifier = Modifier.weight(1f)) + Text( + text = value, + color = PurrfectPalette.textSecondary, + fontSize = 14.sp, + modifier = Modifier.padding(start = 8.dp) + ) } } @@ -440,13 +444,13 @@ class BetterLocationRoot : Routes.Route() { val currentProvider = context.config.root.global.betterLocation.locationSearchProvider.get() ConfigSelector( - text = translation["properties.location_search_provider.name"], - value = context.translation["options.location_search_provider.$currentProvider"] + text = translation["location_search_provider_title"], + value = translation["option_$currentProvider"] ) { showProviderDialog = true } if (currentProvider == "google_maps") { ConfigInput( - text = translation["properties.google_maps_api_key.name"], + text = translation["google_maps_api_key_title"], value = context.config.root.global.betterLocation.googleMapsApiKey.get() ) { showApiKeyDialog = true } } diff --git a/common/src/main/assets/lang/en_US.json b/common/src/main/assets/lang/en_US.json index 833dd816..35cf1f82 100644 --- a/common/src/main/assets/lang/en_US.json +++ b/common/src/main/assets/lang/en_US.json @@ -444,7 +444,11 @@ "no_friends_map": "No friends on the map", "no_friends_found": "No friends found", "include_saved_locations": "Include Saved Locations", - "include_saved_locations_description": "Export your saved location coordinates" + "include_saved_locations_description": "Export your saved location coordinates", + "location_search_provider_title": "Location Search Provider", + "google_maps_api_key_title": "Google Maps API Key", + "option_osm": "OpenStreetMap (Free)", + "option_google_maps": "Google Maps" } }, "dialogs": {