mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-07-12 06:15:55 -04:00
fix(settings): keep the Debug Panel accessible while disconnected (#6199)
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -80,8 +80,6 @@ fun RadioConfigItemList(
|
||||
onNavigate: (Route) -> Unit,
|
||||
) {
|
||||
val enabled = state.connected && !state.responseState.isWaiting() && !isManaged
|
||||
// ponytail: Debug Log/App Logs read local device data, not the radio, so they stay usable offline.
|
||||
val debugPanelEnabled = !state.responseState.isWaiting() && !isManaged
|
||||
|
||||
Column(verticalArrangement = Arrangement.spacedBy(16.dp)) {
|
||||
RadioConfigSection(isManaged, enabled, onRouteClick)
|
||||
@@ -95,7 +93,7 @@ fun RadioConfigItemList(
|
||||
AdministrationSection(enabled, onNavigate)
|
||||
|
||||
if (state.isLocal) {
|
||||
AdvancedSection(isManaged, isOtaCapable, enabled, debugPanelEnabled, onNavigate)
|
||||
AdvancedSection(isManaged, isOtaCapable, enabled, onNavigate)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -192,13 +190,7 @@ private fun AdministrationSection(enabled: Boolean, onNavigate: (Route) -> Unit)
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun AdvancedSection(
|
||||
isManaged: Boolean,
|
||||
isOtaCapable: Boolean,
|
||||
enabled: Boolean,
|
||||
debugPanelEnabled: Boolean,
|
||||
onNavigate: (Route) -> Unit,
|
||||
) {
|
||||
private fun AdvancedSection(isManaged: Boolean, isOtaCapable: Boolean, enabled: Boolean, onNavigate: (Route) -> Unit) {
|
||||
ExpressiveSection(title = stringResource(Res.string.advanced_title)) {
|
||||
if (isManaged) {
|
||||
ManagedMessage()
|
||||
@@ -227,10 +219,11 @@ private fun AdvancedSection(
|
||||
onClick = { onNavigate(SettingsRoute.TakServer) },
|
||||
)
|
||||
|
||||
// Always enabled: the Debug Panel reads app-local logs only — no radio connection,
|
||||
// pending config response, or managed-mode restriction applies to it.
|
||||
ListItem(
|
||||
text = stringResource(Res.string.debug_panel),
|
||||
leadingIcon = MeshtasticIcons.BugReport,
|
||||
enabled = debugPanelEnabled,
|
||||
onClick = { onNavigate(SettingsRoute.DebugPanel) },
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user