fix(ui): DATA sub-mode and rate switching no longer lags - #176
Merged
Conversation
Reported by DC0SK on the radio. Same read-back fight the sliders had: rx_data_submode and rx_data_rate read straight from the snapshot, so tapping a sub-mode sent DT but the button did not light until the radio's echo returned. Fixed the same way - an optimistic Opt<u8> override per field, set on tap, preferred by the accessor, and reconciled against the radio each tick (confirm-or-expire). The DR rate had the identical gap and is fixed alongside. The standing lesson: a control that reads the radio's state directly rather than through a mirror the send updates will feel laggy. The optimistic override is the default fix for a new radio-backed control. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KiAgfnGv746wwVBSfFkoRY
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.
Reported by @dc0sk on the radio: switching DATA sub-modes is laggy.
Same read-back fight the sliders had (ledger 1.97):
rx_data_submodeandrx_data_rateread straight from the snapshot, so tapping DATA A / AFSK A / FSK D / PSK D sentDTbut the button didn't light until the radio's echo returned.Fixed the same way — an optimistic
Opt<u8>override per field, set on tap, preferred by the accessor, reconciled against the radio each tick (confirm-or-expire). TheDRrate (added in #171 without an override) had the identical gap and is fixed alongside.The standing lesson: a control that reads the radio's state directly, rather than through a mirror the send updates, will feel laggy. The optimistic override is the default fix — worth remembering for any new radio-backed control.
Clippy/fmt clean, gate green. Logic mirrors the tested APF override.
Branches from
main(v0.7.0).🤖 Generated with Claude Code
https://claude.ai/code/session_01KiAgfnGv746wwVBSfFkoRY