Skip to content

Move Transport Node toggle to a new Advanced settings card#846

Merged
torlando-tech merged 3 commits intomainfrom
feat/settings-advanced-card
Apr 25, 2026
Merged

Move Transport Node toggle to a new Advanced settings card#846
torlando-tech merged 3 commits intomainfrom
feat/settings-advanced-card

Conversation

@torlando-tech
Copy link
Copy Markdown
Owner

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

  • Added SettingsCardId.ADVANCED between SHARE_COLUMBA and ABOUT in the enum.
  • Created AdvancedCard composable mirroring the layout pattern of the other settings cards, with the Transport Node toggle and description moved verbatim.
  • Removed the Transport Node row + associated props (transportNodeEnabled, onTransportNodeToggle) from NetworkCard. It now only concerns Network Status and Manage Interfaces.
  • Moved the 7 transport-node unit tests from NetworkCardTest to a new AdvancedCardTest. Adjusted the Network-card default-values test to drop its Transport Node assertion.
  • Wired AdvancedCard into SettingsScreen between RNodeFlasherCard and AboutCard with 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.
  • CI passes on the broader test matrix.
  • Manual: open Settings, confirm Transport Node is no longer visible inside Network and is present in the new Advanced card just above About.


Posted by Claude (claude-opus-4-7) on behalf of @torlando-tech.

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-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 24, 2026

Greptile Summary

This PR relocates the Transport Node toggle from NetworkCard to a new AdvancedCard composable positioned between the RNode Flasher and About cards, reducing cognitive load for typical users configuring network interfaces. The ViewModel wiring (transportNodeEnabled / setTransportNodeEnabled) is unchanged, and all seven unit tests plus the instrumented tests are properly migrated to the new card's test files.

Confidence Score: 5/5

This 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

Filename Overview
app/src/main/java/network/columba/app/ui/screens/settings/cards/AdvancedCard.kt New composable housing the Transport Node toggle; correctly mirrors the layout pattern of other cards, with expanded description text compared to the original NetworkCard version.
app/src/main/java/network/columba/app/ui/screens/SettingsScreen.kt Wires AdvancedCard between RNodeFlasherCard and AboutCard with correct ViewModel state/callbacks; transport node props correctly removed from NetworkCard call.
app/src/main/java/network/columba/app/viewmodel/SettingsViewModel.kt Adds ADVANCED to SettingsCardId enum in the correct position; expansion state will default to false (collapsed) for new installs, which is the expected initial state.
app/src/androidTest/java/network/columba/app/ui/screens/settings/cards/AdvancedCardTest.kt Four instrumented tests cover header, default-enabled, callback, and disabled state; the description-text assertion and enabled-state test present in the old androidTest NetworkCardTest are not ported over.
app/src/main/java/network/columba/app/ui/screens/settings/cards/NetworkCard.kt Cleanly removed Transport Node toggle, its props, and associated imports; no regressions introduced.
app/src/test/java/network/columba/app/ui/screens/settings/cards/AdvancedCardTest.kt Eight Robolectric unit tests covering header display, label, description, on/off state, callbacks, and call count — an improvement over the original NetworkCardTest set.
app/src/test/java/network/columba/app/ui/screens/settings/cards/NetworkCardTest.kt Transport Node tests properly removed; remaining tests updated with consistent formatting; default-values test adjusted to drop the Transport Node assertion.
app/src/androidTest/java/network/columba/app/ui/screens/settings/cards/NetworkCardTest.kt Transport Node instrumented tests cleanly removed; comment left explaining the move to AdvancedCardTest.

Sequence Diagram

sequenceDiagram
    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)
Loading

Reviews (3): Last reviewed commit: "Move Transport Node tests out of android..." | Re-trigger Greptile

@sentry
Copy link
Copy Markdown
Contributor

sentry Bot commented Apr 24, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

torlando-tech and others added 2 commits April 24, 2026 10:32
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>
@torlando-tech torlando-tech merged commit cb18720 into main Apr 25, 2026
11 checks passed
@torlando-tech torlando-tech deleted the feat/settings-advanced-card branch April 25, 2026 19:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant