← Back to PRs

#19209: feat(android): add disconnect button via StatusPill tap

by gregmousseau open 2026-02-17 14:39 View on GitHub →
app: android size: XS
## Summary - When connected to a gateway, tapping the green "Connected" status pill now shows a confirmation dialog with options to **Disconnect** or open **Settings**. - Previously, tapping the pill always opened Settings regardless of connection state. - This is needed if your gateway is offline (for the crazy people who don't run 24/7), the app will constantly try to connect, and the only way around it was to force stop the app. Clicking Disconnect in settings would just try to auto reconnect (possibly only if manual connection was used. I had tailscale issues with auto discovery, so I cannot test that workflow) ## AI Disclosure - [x] AI-assisted (ClaudeCode Via OpenClaw) — human reviewed and tested - [x] I understand what this code does ## Testing - Lightly tested on OnePlus 12 (Android 15) - Verified the disconnect dialog appears when tapping the "Connected" pill - Confirmed tapping "Disconnect" actually disconnects from the gateway - Confirmed tapping "Settings" opens the settings sheet ## Screenshots ![Screenshot_2026-02-17-07-55-58-73_9e4f220af4158cf313504e53a3b01c8c](https://github.com/user-attachments/assets/00225346-99e2-435a-9af5-bf48ead9b2c2) ![Screenshot_2026-02-17-09-35-13-51_9e4f220af4158cf313504e53a3b01c8c](https://github.com/user-attachments/assets/6392db58-ff2c-47bc-903e-951243120eb6) ![Screenshot_2026-02-17-09-34-50-13_9e4f220af4158cf313504e53a3b01c8c](https://github.com/user-attachments/assets/65983c5b-f861-4928-aa44-e928012ab997) 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- greptile_comment --> <h3>Greptile Summary</h3> Added conditional disconnect dialog when tapping the status pill in connected state. When tapped while connected to a gateway, users now see a confirmation dialog with "Disconnect" and "Settings" options instead of immediately opening Settings. The dialog integrates with the existing `viewModel.disconnect()` method and maintains the original behavior (opening Settings) for all other connection states. <h3>Confidence Score: 5/5</h3> - This PR is safe to merge with minimal risk - The changes are minimal and well-scoped: adds a simple state variable, conditional logic based on existing `GatewayState` enum, and a standard Material3 `AlertDialog`. The disconnect flow calls an existing `viewModel.disconnect()` method, and the fallback behavior (opening Settings) is preserved for non-connected states. No complex logic, edge cases are handled cleanly, and the implementation follows Jetpack Compose best practices. - No files require special attention <sub>Last reviewed commit: 349fac8</sub>

Most Similar PRs