Move Transport Node toggle to a new Advanced settings card#846
Move Transport Node toggle to a new Advanced settings card#846torlando-tech merged 3 commits intomainfrom
Conversation
The Transport Node toggle was nestled inside the Network card, which conflated "here's how to configure interfaces" with a power-user decision about whether this device relays mesh traffic for other peers. Users who just wanted to add a TCP interface got prompted to consider a routing decision they probably shouldn't touch. Move it to a new dedicated Advanced card between RNode Flasher and About on the Settings page — findable for power users, out of the way for everyone else. The new card carries the same toggle with the same wiring (SettingsViewModel.transportNodeEnabled / setTransportNodeEnabled), so behavior and persisted state are unchanged. Changes: - Added SettingsCardId.ADVANCED between SHARE_COLUMBA and ABOUT. - Created AdvancedCard composable; mirrors the layout pattern of the other settings cards. - Removed the Transport Node row + associated props from NetworkCard (networkCard now only concerns Network Status and Manage Interfaces). - Moved the 7 transport-node unit tests from NetworkCardTest to a new AdvancedCardTest. Network-card default-values test updated to drop the Transport Node assertion. - Wired AdvancedCard into SettingsScreen between RNodeFlasherCard and AboutCard with the same viewModel state/callbacks. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Greptile SummaryThis PR relocates the Transport Node toggle from Confidence Score: 5/5This PR is safe to merge — it is a pure UI relocation with no changes to business logic or persisted state. All findings are P2 or lower. The ViewModel wiring is identical to the pre-PR state, tests are faithfully migrated and improved with more precise assertions in the unit suite, and the new ADVANCED enum value initialises collapsed by default as expected. No data-loss, security, or runtime-error risk. app/src/androidTest/java/network/columba/app/ui/screens/settings/cards/AdvancedCardTest.kt — the description-text and enabled-state instrumented tests were not ported from the old NetworkCardTest, leaving a minor gap in the instrumented suite. Important Files Changed
Sequence DiagramsequenceDiagram
participant VM as SettingsViewModel
participant SS as SettingsScreen
participant AC as AdvancedCard
participant NC as NetworkCard
VM->>SS: state.transportNodeEnabled
VM->>SS: state.cardExpansionStates[ADVANCED]
SS->>AC: transportNodeEnabled, onTransportNodeToggle
SS->>AC: isExpanded, onExpandedChange
SS->>NC: (no transport node props)
AC-->>VM: setTransportNodeEnabled(value)
AC-->>VM: toggleCardExpanded(ADVANCED, value)
Reviews (3): Last reviewed commit: "Move Transport Node tests out of android..." | Re-trigger Greptile |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Drops the "Power-user toggles. Leave at defaults…" header text that opened the card — gatekeeping tone, assumes users won't understand. Extends the Transport Node description with concrete guidance: mobile devices typically aren't good transport nodes (no fixed position in the network hurts multihop routing), there's a data-usage and battery cost, but BLE-only meshes actually need it for multi-hop messaging. User can make an informed decision instead of being told "don't touch". Also updates AdvancedCardTest's description assertion to match the new text. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Mirror the src/test changes on the androidTest side — CI's Instrumented Tests job was failing because app/src/androidTest/.../NetworkCardTest.kt still called NetworkCard with transportNodeEnabled / onTransportNodeToggle after those params were removed. Deletes the five transport-node tests from the androidTest NetworkCardTest and moves them to a new androidTest AdvancedCardTest, targeting AdvancedCard. Also fixes networkCard_withAllDefaultValues_displaysCorrectly to drop its Transport Node assertion. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Summary
The Transport Node toggle was nestled inside the Network card, which conflated "here's how to configure interfaces" with a power-user decision about whether this device relays mesh traffic for other peers. Users who just wanted to add a TCP interface got prompted to consider a routing decision they probably shouldn't touch.
Moves the toggle to a new dedicated Advanced settings card between RNode Flasher and About — findable for power users, out of the way for everyone else. Same wiring (
SettingsViewModel.transportNodeEnabled/setTransportNodeEnabled), so behavior and persisted state are unchanged.Changes
SettingsCardId.ADVANCEDbetweenSHARE_COLUMBAandABOUTin the enum.AdvancedCardcomposable mirroring the layout pattern of the other settings cards, with the Transport Node toggle and description moved verbatim.transportNodeEnabled,onTransportNodeToggle) fromNetworkCard. It now only concerns Network Status and Manage Interfaces.NetworkCardTestto a newAdvancedCardTest. Adjusted the Network-card default-values test to drop its Transport Node assertion.AdvancedCardintoSettingsScreenbetweenRNodeFlasherCardandAboutCardwith the same viewModel state/callbacks.Visual
Settings page card order now reads: Network → Identity → Privacy → Notifications → ... → Share Columba → RNode Flasher → Advanced → About.
Test plan
./gradlew :app:testNoSentryDebugUnitTest --tests '*.settings.cards.AdvancedCardTest' --tests '*.settings.cards.NetworkCardTest'— all green.—
Posted by Claude (claude-opus-4-7) on behalf of @torlando-tech.