feat(ui): use modem-preset-relative SNR thresholds for signal quality#5903
Merged
Conversation
Contributor
📄 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
|
Signal quality was rated against fixed SNR/RSSI thresholds, ignoring the active modem preset — a node at -10 dB SNR showed BAD even though it is well above LongFast's -17.5 dB demodulation floor. Rate SNR relative to the preset's demodulation floor instead (RSSI dropped from the rating per GUVWAF, still displayed); deliver the preset via a LocalModemPreset CompositionLocal provided once at the app root. Resolves #5446. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
7d6a799 to
32d07e2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Signal quality was rated against fixed SNR/RSSI thresholds, so a node's rating ignored the active modem preset. A node at −10 dB SNR showed BAD even though that's 7.5 dB above LongFast's −17.5 dB demodulation floor — an excellent link. This rates SNR relative to the preset's demodulation floor instead, matching the intent of Meshtastic-Apple's
getSnrColor(snr:preset:).Resolves #5446.
🌟 New Features
determineSignalQuality(snr, modemPreset)now rates SNR against the preset's demodulation floor:GOOD > limit,FAIR > limit − 5.5,BAD ≥ limit − 7.5,NONEbelow. The per-valueSnr()text color uses the same bands.ModemPreset?.snrLimit(core:model, onChannelOptionalongsidebandwidth) maps each preset to its spreading-factor demodulation floor (SF7 −7.5 … SF12 −20); unknown/unset → LongFast default.🐛 Bug Fixes
snrLimit()returns −7.5 for LongSlow (the SF7 value — an apparent bug); every other preset matches the SF physics. This intentionally diverges from Apple on that one value; worth fixing on Apple's side too.🛠️ Refactoring & Architecture
LocalModemPresetCompositionLocal, provided once inMeshtasticAppShellfromRadioConfigRepository.localConfigFlow. Leaf composables (Snr,NodeSignalQuality,LoraSignalIndicator, …) defaultmodemPreset = LocalModemPreset.current, so the node list, node-detail Signal Metrics, and message/reaction rows all rate preset-relative with no per-screen plumbing — matching the app's existing narrowLocal*ambients.feature:car) is non-Compose, so it sources the preset from its ownlocalConfigFlowcombine inCarStateCoordinatorand precomputesNodeUi.signalQuality(its 5-level enum kept, now preset-relative).Testing Performed
core/ui/.../LoraSignalIndicatorTest.kt: SF→floor mapping per preset, the LongSlow −20 correction, null/unset → LongFast fallback, the issue's −10 dB-on-LongFast = GOOD example, band boundaries, and RSSI-independence.CarScreenDataBuilderTest: rewrote the signal-quality cases for the new(snr, modemPreset)signature (preset-relative bands, LongSlow floor).spotlessApply spotlessCheck detekt assembleDebug test allTests kmpSmokeCompile.🤖 Generated with Claude Code