Add "Exclude MQTT" filter to Nodes view. (#4825)

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: James Rich <2199651+jamesarich@users.noreply.github.com>
Co-authored-by: James Rich <james.a.rich@gmail.com>
This commit is contained in:
Victorio Berra 2026-03-18 10:39:59 -05:00 committed by GitHub
parent 1e9e838025
commit eae5a6bdac
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 73 additions and 2 deletions

View file

@ -44,6 +44,7 @@ const val KEY_EXCLUDE_INFRASTRUCTURE = "exclude-infrastructure"
const val KEY_ONLY_ONLINE = "only-online"
const val KEY_ONLY_DIRECT = "only-direct"
const val KEY_SHOW_IGNORED = "show-ignored"
const val KEY_EXCLUDE_MQTT = "exclude-mqtt"
@Single
@Suppress("TooManyFunctions") // One setter per preference field — inherently grows with preferences.
@ -73,6 +74,7 @@ class UiPreferencesDataSource(@Named("CorePreferencesDataStore") private val dat
val onlyOnline: StateFlow<Boolean> = dataStore.prefStateFlow(key = ONLY_ONLINE, default = false)
val onlyDirect: StateFlow<Boolean> = dataStore.prefStateFlow(key = ONLY_DIRECT, default = false)
val showIgnored: StateFlow<Boolean> = dataStore.prefStateFlow(key = SHOW_IGNORED, default = false)
val excludeMqtt: StateFlow<Boolean> = dataStore.prefStateFlow(key = EXCLUDE_MQTT, default = false)
fun setAppIntroCompleted(completed: Boolean) {
dataStore.setPref(key = APP_INTRO_COMPLETED, value = completed)
@ -106,6 +108,10 @@ class UiPreferencesDataSource(@Named("CorePreferencesDataStore") private val dat
dataStore.setPref(key = SHOW_IGNORED, value = value)
}
fun setExcludeMqtt(value: Boolean) {
dataStore.setPref(key = EXCLUDE_MQTT, value = value)
}
private fun <T : Any> DataStore<Preferences>.prefStateFlow(
key: Preferences.Key<T>,
default: T,
@ -126,5 +132,6 @@ class UiPreferencesDataSource(@Named("CorePreferencesDataStore") private val dat
val ONLY_ONLINE = booleanPreferencesKey(KEY_ONLY_ONLINE)
val ONLY_DIRECT = booleanPreferencesKey(KEY_ONLY_DIRECT)
val SHOW_IGNORED = booleanPreferencesKey(KEY_SHOW_IGNORED)
val EXCLUDE_MQTT = booleanPreferencesKey(KEY_EXCLUDE_MQTT)
}
}

View file

@ -53,6 +53,7 @@
<string name="internal">Internal</string>
<string name="node_sort_via_favorite">via Favorite</string>
<string name="node_filter_show_ignored">Only show ignored Nodes</string>
<string name="node_filter_exclude_mqtt">Exclude MQTT</string>
<string name="unrecognized">Unrecognized</string>
<string name="message_status_enroute">Waiting to be acknowledged</string>
<string name="message_status_queued">Queued for sending</string>