feat(lora): gate region→preset map + TINY presets on firmware capability#5941
Conversation
Pre-2.8 firmware has no concept of the region→preset legality map or the TINY_FAST/TINY_SLOW presets, so showing them invites confusion (e.g. narrow presets surfacing on the US region). Gate both behind a firmware capability. - Add Capabilities.supportsLoraRegionPresetMap (firmware >= 2.8.0). - Apply the map and hide the TINY presets only when the target node supports them. Capability reads the per-target node's metadata, so remote admin is gated on the remote node's firmware, not the local device's. - The legality map is a function of firmware version + region (not device instance), so the locally-cached map is reused for remote admin once the remote node is known to support it — dropping the prior local-only gate. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
🖼️ Preview staleness check — advisoryThis PR modifies UI composables but does not update any
Changed UI files: What to check:
Adding previews checklist:
If this PR does not require preview updates (e.g., logic-only change, non-visual refactor), add the |
📄 Docs staleness check — advisoryThis PR modifies user-facing UI source files but does not update any page under
Changed source files: What to check:
New page checklist (if adding a new doc page):
If this PR does not require a doc update (e.g., internal refactor, bug fix, test change), add the
|
Firmware older than 2.8 has no concept of the LoRa region→preset legality map (protobufs #951) or the new
TINY_FAST/TINY_SLOWpresets. Surfacing them on a pre-2.8 node invites confusion — e.g. narrow presets appearing as legal options on the US region — so this gates both behind a firmware capability, per the follow-up discussed on Discord.🌟 New Features
Capabilities.supportsLoraRegionPresetMap(firmware ≥ 2.8.0) to centralize the gate alongside the other firmware feature flags.🛠️ Refactoring & Architecture
LoRaConfigScreen: apply the region→preset map and hide theTINY_FAST/TINY_SLOWpresets only when the target node's firmware supports them. The capability is built fromstate.metadata.firmware_version, which is per-target, so remote admin is gated on the remote node's firmware rather than the locally-connected device.buildPresetItemshelper to keepLoRaConfigScreenunder the detekt cyclomatic-complexity limit.Behavior
Testing Performed
No new tests — the change is a UI gate over existing logic. Verified locally:
:core:model:allTests(32 tests) pass.spotlessCheck,detekt, and:feature:settings:compileAndroidMainpass.