Show connection status banner when the device is offline#695
Open
gemdev111 wants to merge 18 commits into
Open
Show connection status banner when the device is offline#695gemdev111 wants to merge 18 commits into
gemdev111 wants to merge 18 commits into
Conversation
Shared vocabulary for the connection status ladder, generated for iOS and Android via typeshare. ConnectionStatus is the user-facing rollup (online, noInternet, noService); ConnectionComponent names the monitored components (internet, api, nodes, stream); ConnectionComponentHealth carries per-component health with typed metadata (internet network conditions, unreachable chains) so monitors report detail without new plumbing.
NWPathMonitor wrapped in a ConnectivityMonitoring stream, consumed by the ConnectivityService actor that debounces offline transitions by 500ms, commits recovery immediately, and fans state out to subscribers through observe(). Includes TestKit mocks and deterministic tests.
A single connectionStatusBanner() modifier on MainTabView renders the banner above the floating tab bar so it covers every tab and pushed screen, with measured scroll content margins so content is never hidden. ConnectionStatusObserver in FeatureServices fans in ConnectionComponentMonitoring health streams and rolls them up into ConnectionStatus by component severity, resetting service health when internet recovers. InternetConnectionMonitor wrapping ConnectivityService is the first monitor and the reference pattern for api, nodes and stream, including typed metadata reporting. The observer stops in background and restarts on foreground through AppLifecycleService, rebuilding the path monitor so a stalled NWPathMonitor cannot leave a stale banner. The banner is dismissible and reappears on the next status change.
Mirror the iOS connection status architecture with Android patterns: ConnectionComponentMonitor exposes a health Flow per component, InternetConnectionMonitor wraps ConnectivityManager with a 500ms offline debounce and network metadata, and ConnectionStatusObserver fans monitors into a ConnectionStatus StateFlow with severity rollup and internet-recovery reset. AppLifecycleCoordinator starts and stops the observer with the app lifecycle, re-reading the current network on every foreground. MainActivity provides a shared ConnectionBannerState through a composition local; the main screen bottom bar and the shared Scene scaffold render the same animated, dismissible strip above the bottom chrome, so every tab and pushed screen shows connection status with one dismissal state.
gemdev111
marked this pull request as ready for review
July 14, 2026 22:10
gemcoder21
reviewed
Jul 15, 2026
| import com.gemwallet.android.ui.theme.space10 | ||
|
|
||
| private val statusIconSize = 18.dp | ||
| private val dismissButtonSize = 28.dp |
Contributor
There was a problem hiding this comment.
can you remove hardcoded values, use our standard spacings
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.
closes #208
Monitors internet connectivity and shows a dismissible banner when the connection is lost. The banner follows across tabs and screens, hides on recovery, and returns on the next offline event. Detection is debounced so brief drops do not flash it.
What changed
ConnectionStatusObserveron both apps: per-component monitors stream health and roll up to oneConnectionStatus(internet today, api/nodes/stream covered by the same rollup)maestro/android/connection_banner.yaml: offline → tabs → details → recovery → re-offline → dismissVerification
images:
Wallet home, banner above the tab bar
Banner above the bottom navigation