diff --git a/app/src/main/java/com/m57/hermescontrol/Navigation.kt b/app/src/main/java/com/m57/hermescontrol/Navigation.kt index 8e6dfaa3..c33dcd02 100644 --- a/app/src/main/java/com/m57/hermescontrol/Navigation.kt +++ b/app/src/main/java/com/m57/hermescontrol/Navigation.kt @@ -244,7 +244,19 @@ fun MainNavigation() { entry { ChatScreenContent( onNavigateToSettings = { - backStack.add(SettingsScreen) + // B7 (Jun 18 2026): previously used + // `backStack.add(SettingsScreen)` directly, + // which bypasses NavigationController's + // navigation guard. The drawer Settings path + // goes through NavigationController which + // deduplicates and prevents stacking duplicate + // SettingsScreen entries when user rapidly + // taps the gear icon. Use the same path for + // consistency and to recover if a duplicate + // SettingsScreen entry was the source of the + // "page unresponsive" symptom reported when + // reaching Settings from the topbar. + NavigationController.navigateTo(SettingsScreen) }, onOpenDrawer = { openDrawer() }, ) diff --git a/app/src/main/java/com/m57/hermescontrol/ui/settings/SettingsScreen.kt b/app/src/main/java/com/m57/hermescontrol/ui/settings/SettingsScreen.kt index c8f225fe..54e2f56c 100644 --- a/app/src/main/java/com/m57/hermescontrol/ui/settings/SettingsScreen.kt +++ b/app/src/main/java/com/m57/hermescontrol/ui/settings/SettingsScreen.kt @@ -175,6 +175,23 @@ fun SettingsScreen( cursorColor = MaterialTheme.colorScheme.primary, ), ) + + Spacer(modifier = Modifier.height(8.dp)) + + // B7 (Jun 18 2026): one-tap escape hatch for when the stored + // token is corrupted / rejected. Clears the token field and + // persists the empty value immediately so a stress-free + // re-pair is possible without manually selecting-and-deleting + // the masked password field character by character. + OutlinedButton( + onClick = { + viewModel.onTokenChange("") + viewModel.save() + }, + modifier = Modifier.fillMaxWidth(), + ) { + Text("Clear Token") + } } // Behavior section