From c430eacaace8b1f05c15dc11673a2debf294eb81 Mon Sep 17 00:00:00 2001 From: James Rich <2199651+jamesarich@users.noreply.github.com> Date: Sun, 31 May 2026 10:30:27 -0700 Subject: [PATCH] Revert "feat: replace LoRa bandwidth text input with constrained dropdown" (#5691) --- feature/settings/settings-validation.md | 2 +- .../radio/component/LoRaConfigItemList.kt | 23 ++++--------------- 2 files changed, 5 insertions(+), 20 deletions(-) diff --git a/feature/settings/settings-validation.md b/feature/settings/settings-validation.md index 781cff056a..0b7e1ae784 100644 --- a/feature/settings/settings-validation.md +++ b/feature/settings/settings-validation.md @@ -143,7 +143,7 @@ configuration settings screen. Constraints are sourced from two layers: | `region` | Enum | Dropdown: `RegionInfo` entries | Regional frequency plans | | `use_preset` | Boolean | Toggle | Controls manual vs preset LoRa settings visibility | | `modem_preset` | Enum | Dropdown: `ChannelOption` entries | Visible only when `use_preset = true` | -| `bandwidth` | Integer | Dropdown: valid LoRa bandwidths (7.8–500 kHz) | Visible only when `use_preset = false` | +| `bandwidth` | Integer | Numeric input | Visible only when `use_preset = false` | | `spread_factor` | Integer | Numeric input | Visible only when `use_preset = false` | | `coding_rate` | Integer | Numeric input | Visible only when `use_preset = false` | | `hop_limit` | Integer | Dropdown: 0–7 | — | diff --git a/feature/settings/src/commonMain/kotlin/org/meshtastic/feature/settings/radio/component/LoRaConfigItemList.kt b/feature/settings/src/commonMain/kotlin/org/meshtastic/feature/settings/radio/component/LoRaConfigItemList.kt index 20c3c20fda..ced63fff66 100644 --- a/feature/settings/src/commonMain/kotlin/org/meshtastic/feature/settings/radio/component/LoRaConfigItemList.kt +++ b/feature/settings/src/commonMain/kotlin/org/meshtastic/feature/settings/radio/component/LoRaConfigItemList.kt @@ -67,21 +67,6 @@ import org.meshtastic.proto.Config private val SPREAD_FACTOR_RANGE = 7..12 private val CODING_RATE_RANGE = 5..8 -/** Valid LoRa bandwidth codes mapped to their display labels (kHz). */ -private val BANDWIDTH_OPTIONS: List> = - listOf( - 8 to "7.8 kHz", - 10 to "10.4 kHz", - 16 to "15.6 kHz", - 21 to "20.8 kHz", - 31 to "31.25 kHz", - 42 to "41.7 kHz", - 62 to "62.5 kHz", - 125 to "125 kHz", - 250 to "250 kHz", - 500 to "500 kHz", - ) - @Composable fun LoRaConfigScreen(viewModel: RadioConfigViewModel, onBack: () -> Unit) { val state by viewModel.radioConfigState.collectAsStateWithLifecycle() @@ -260,12 +245,12 @@ private fun ManualModemSettings( onConfigChange: (Config.LoRaConfig) -> Unit, ) { androidx.compose.foundation.layout.Column { - DropDownPreference( + EditTextPreference( title = stringResource(Res.string.bandwidth), + value = config.bandwidth, enabled = enabled, - items = BANDWIDTH_OPTIONS, - selectedItem = config.bandwidth, - onItemSelected = { onConfigChange(config.copy(bandwidth = it)) }, + keyboardActions = KeyboardActions(onDone = { focusManager.clearFocus() }), + onValueChanged = { onConfigChange(config.copy(bandwidth = it)) }, ) HorizontalDivider() EditTextPreference(