Extract shared node helpers, add Room management UI#270
Merged
Conversation
…t UI
Extract shared node management logic from Repeater-specific views into
reusable helpers (NodeSettingsHelper, NodeStatusHelper, SharedNodeViews)
and create parallel Room management views with RoomAdminService.
Fix two pre-existing MeshCore spec alignment bugs:
- flood.advert.interval validation now accepts 0 (disabled) and 3-168h,
matching firmware (was incorrectly limited to 3-48h)
- password change response now recognized as success when firmware echoes
"password now: {pw}" instead of "OK"
Remove dead code from MessageEventBroadcaster (unused handler methods).
Consistent DeviceInfo section ordering across Room and Repeater settings.
…d.only - CLIResponse.parse() has no cases for these queries, so responses parsed as .raw and the content-based matcher silently discarded them, causing both fields to time out instead of loading - switch to rawMatching: true (FIFO delivery) for these two commands - align cleanup() with RepeaterSettingsViewModel: clear only the CLI handler instead of all three handlers via clearHandlers()
Radio → Behavior → Regions → Identity → Contact → Security → Device Info → Actions
- Firmware echoes "password now: {pw}" on success, which parses as
.raw and gets discarded by the content-based matcher
- Same class of bug as guest.password and allow.read.only
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.
Summary
Repeater and Room node management shared most of their settings/status logic but had separate implementations. This PR extracts the common parts into shared helpers, then builds Room management on top of them.
Also fixes two bugs where the Swift validation didn't match what the firmware actually accepts.
43 files changed, +3893 −2155 (net −1025 lines with the Room UI included).
What changed
New shared helpers:
NodeSettingsHelper— radio, identity, contact, security, behavior validation, password changeNodeStatusHelper— status/telemetry response handling and snapshot persistenceSharedNodeViews— 14 extracted SwiftUI components used by both Room and RepeaterNew Room management:
RoomSettingsView/RoomSettingsViewModel— guest password, allow-read-only, behavior configRoomStatusView/RoomStatusViewModel— post counts (postedCount/postPushCountasUInt16)RoomAdminService— mirrorsRepeaterAdminServiceBug fixes (both pre-existing, found by diffing against
CommonCLI.cpp):flood.advert.intervalvalidation was 3–48h. Firmware accepts 0 (disabled) and 3–168h. Fixed validation and all 9 locale strings.passwordcommand: firmware echoes"password now: {pw}"on success, not"OK". The app was showing "password change failed" even though it worked. Now recognizes the echo as success.Cleanup:
repeaterAdminServicefromMessageEventBroadcasterNodeActionRowsinContactDetailView(Room/Repeater cases were copy-pasted)clearHandlers()instead of no-op closure assignmentallowReadOnlyFooterL10n keyExpandableSettingsSection:error: Binding<String?>→hasError: Binding<Bool>Test plan
MC1Tests,MC1ServicesTests)