feat: gate network selection behind advanced features - #145
Merged
Conversation
The network selector restarts the node onto a chain most users never want, so it now sits behind the advanced-features switch alongside peer country flags and developer tools. Advanced features default to on in debug builds and off in release, so development builds surface the gated sections without a manual opt-in on every fresh install. The default and the preference read now live in a single shared helper, mirroring PeerFlagsSetting. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
What
Hides the Network section in Settings behind the existing Advanced features switch, and makes that switch default to on in debug builds / off in release builds.
Why
Switching networks restarts the node onto a chain most users never want, so it belongs with the other advanced-only sections (peer country flags, developer tools). Defaulting the flag on outside release builds means development and journey-test builds surface the gated sections without a manual opt-in on every fresh install.
Changes
domain/settings/AdvancedFeaturesSetting.kt:ADVANCED_FEATURES_ENABLED_BY_DEFAULT = BuildConfig.DEBUGplus a sharedPreferencesDataSource.isAdvancedFeaturesEnabled()— same shape as the existingPeerFlagsSetting, so no screen can disagree about the default.SettingsViewModel/NodeViewModelread the preference through that helper;SettingsUiState/NodeUiStateuse the same constant as their initial value.ScreenSettings.kt: the NetworkSectionCardis wrapped inif (uiState.enableAdvancedFeatures).strings.xml: the advanced-features subtitle is now generic ("Show extra settings and tools for advanced users") instead of naming only the log viewer.journeys/README.md: documents thattoggle_advanced_featuresnow gates Network too, and the debug-on/release-off default.journeys/switch_network.xml: turns the advanced-features switch on before expanding Network (the preference persists, so a previous run may have left it off).Verification
./gradlew assembleDebug detekt lintDebug— all green.🤖 Generated with Claude Code