Skip to content

refactor(settings): Use LocalConfig for radio configuration state#4579

Merged
jamesarich merged 1 commit into
mainfrom
fix/moduleconfig
Feb 17, 2026
Merged

refactor(settings): Use LocalConfig for radio configuration state#4579
jamesarich merged 1 commit into
mainfrom
fix/moduleconfig

Conversation

@jamesarich

Copy link
Copy Markdown
Collaborator

This commit refactors the RadioConfigViewModel to use LocalConfig and LocalModuleConfig for managing the configuration state, aligning it with the data sources from RadioConfigRepository. This change ensures that the local device's configuration is directly observed and updated in the UI.

The radioConfig state is now of type LocalConfig, and separate flows for localConfigFlow and moduleConfigFlow are observed to keep the UI state synchronized when connected to the local node. The previous Config type is replaced, and updates to the state are now done by merging new partial Config data into the existing LocalConfig state.

Additionally, this commit includes several smaller fixes and improvements:

  • Simplifies the isLocal property update logic.
  • Replaces direct access to meshService.packetId with meshService.getPacketId().
  • Adds error handling for setRingtone and setCannedMessages to catch RemoteException.
  • Removes the unused setChannels(channelUrl: String) method.
  • In the Status Message screen, the current node status from telemetry is now used as a fallback if the configured status message is blank, providing a more informative default.

This commit refactors the `RadioConfigViewModel` to use `LocalConfig` and `LocalModuleConfig` for managing the configuration state, aligning it with the data sources from `RadioConfigRepository`. This change ensures that the local device's configuration is directly observed and updated in the UI.

The `radioConfig` state is now of type `LocalConfig`, and separate flows for `localConfigFlow` and `moduleConfigFlow` are observed to keep the UI state synchronized when connected to the local node. The previous `Config` type is replaced, and updates to the state are now done by merging new partial `Config` data into the existing `LocalConfig` state.

Additionally, this commit includes several smaller fixes and improvements:
- Simplifies the `isLocal` property update logic.
- Replaces direct access to `meshService.packetId` with `meshService.getPacketId()`.
- Adds error handling for `setRingtone` and `setCannedMessages` to catch `RemoteException`.
- Removes the unused `setChannels(channelUrl: String)` method.
- In the Status Message screen, the current node status from telemetry is now used as a fallback if the configured status message is blank, providing a more informative default.

Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
@github-actions github-actions Bot added the bugfix PR tag label Feb 17, 2026
@jamesarich jamesarich enabled auto-merge February 17, 2026 14:20
@codecov

codecov Bot commented Feb 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 36 lines in your changes missing coverage. Please review.
✅ Project coverage is 14.78%. Comparing base (85b3acd) to head (b465b41).
⚠️ Report is 2 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...tic/feature/settings/radio/RadioConfigViewModel.kt 0.00% 36 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4579      +/-   ##
==========================================
- Coverage   14.79%   14.78%   -0.02%     
==========================================
  Files         429      429              
  Lines       14846    14861      +15     
  Branches     2457     2464       +7     
==========================================
  Hits         2197     2197              
- Misses      12331    12346      +15     
  Partials      318      318              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jamesarich jamesarich added this pull request to the merge queue Feb 17, 2026
Merged via the queue into main with commit 2878ad7 Feb 17, 2026
8 of 9 checks passed
@jamesarich jamesarich deleted the fix/moduleconfig branch February 17, 2026 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix PR tag

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant