Enhancement/preset offgrid repeat toggle#275
Conversation
8d10adc to
f233bdb
Compare
Code Review FindingsMust Fix
Should Fix
Nice to Have
|
|
I rebased will be pushing with the enhancements shortly |
166cd72 to
fb11882
Compare
There was a problem hiding this comment.
Pull request overview
This PR enhances the off-grid repeat toggle in the radio settings dialog so that toggling repeat mode automatically adjusts the frequency to the appropriate off-grid frequency for the selected region/band (and restores it when disabled). It also tracks and remembers the non-repeat radio state across the session, filters off-grid presets from the visible dropdown, and adds debug logging for radio settings state changes.
Changes:
- Automatically switch frequency to the band-appropriate off-grid frequency when the repeat toggle is enabled, and restore the original preset frequency when disabled.
- Introduce
_RadioSettingsSnapshotclass andMeshCoreRadioStateSnapshotto capture and remember radio state, enabling round-trip persistence of non-repeat settings. - Add debug-mode logging throughout radio settings interactions and refactor preset selection to track and sync with manual setting changes.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
lib/connector/meshcore_connector.dart |
Adds MeshCoreRadioStateSnapshot data class and in-memory storage for remembered non-repeat radio state on the connector. |
lib/screens/settings_screen.dart |
Major refactor of radio settings dialog: adds snapshot tracking, off-grid frequency auto-switching, preset filtering, sync logic, and debug logging. Moves coding rate helpers to top-level. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| _clientRepeat = widget.connector.clientRepeat ?? false; | ||
| _selectedPresetIndex = _findMatchingPresetIndex(); | ||
| _lastNonRepeatSnapshot = _currentSnapshot(); |
There was a problem hiding this comment.
I agree this can be removed
| Navigator.pop(context); | ||
| _logRadioSettingsState('Radio settings saved successfully'); |
There was a problem hiding this comment.
I didn't see this error in debug logs while testing but it can't hurt to move it up.
d0e3767 to
6375710
Compare
This reverts commit 758619b.
…gate debug logging - Replace floating-point epsilon frequency comparison with integer Hz - Add frequencyHz getter and fromMeshCoreSnapshot/toMeshCoreSnapshot conversion methods on _RadioSettingsSnapshot - Move _toUiCodingRate/_toDeviceCodingRate to documented top-level functions - Gate _logRadioSettingsState behind kDebugMode - Use integer Hz in == and hashCode for _RadioSettingsSnapshot Addresses code review findings on preset/off-grid repeat toggle PR.
6375710 to
1e9508d
Compare
|
|
446564
left a comment
There was a problem hiding this comment.
Small, almost optional, changes but otherwise good.
Tested a few times to double check and all functioning well.
|
|
||
| _clientRepeat = widget.connector.clientRepeat ?? false; | ||
| _selectedPresetIndex = _findMatchingPresetIndex(); | ||
| _lastNonRepeatSnapshot = _currentSnapshot(); |
There was a problem hiding this comment.
I agree this can be removed
| Navigator.pop(context); | ||
| _logRadioSettingsState('Radio settings saved successfully'); |
There was a problem hiding this comment.
I didn't see this error in debug logs while testing but it can't hurt to move it up.
just removes extraneous assignment to _lastNonRepeatSnapshot and moves the Navigator pop to after all uses of the context in _RadioSettingsDialog
just removes extraneous assignment to _lastNonRepeatSnapshot and moves the Navigator pop to after all uses of the context in _RadioSettingsDialog
Enhancement for