feat(ui): global offline pill at top of RootView#100
Closed
variablefate wants to merge 2 commits intomainfrom
Closed
feat(ui): global offline pill at top of RootView#100variablefate wants to merge 2 commits intomainfrom
variablefate wants to merge 2 commits intomainfrom
Conversation
Per-tab views (DriversTab, HistoryTab, RideTab) check `isRelayConnected()` independently and render their own inline offline UI, but there was no global "you're offline" indicator. Users had to navigate to a specific tab to spot connectivity issues, and the publish-failure banner from #95 lacked context — "couldn't reach the relay" reads differently when the user can also see at a glance that they're offline. Add `ConnectivityPill` at the top of RootView, above the publish-failure banner. The pill renders only when `isRelayConnected()` returns false and the auth state is past `.loading`. Tap presents the existing `ConnectivitySheet` for diagnostics + manual reconnect. Per-tab inline offline UI is intentionally retained — the pill communicates global state, the per-tab UI communicates per-tab consequences. Closes #97 item 3. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Owner
Author
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. 🤖 Generated with Claude Code - If this code review was useful, please react with 👍. Otherwise, react with 👎. |
…rrectly Two follow-ups from code review on PR #100: 1. Poll cadence 5s -> 10s: per-tab views (RideTab, DriversTab, HistoryTab) all use 10s as the persistent connection-monitoring cadence. ConnectivitySheet polls at 5s because it's a modal the user is actively looking at. The pill is a background indicator, so the per-tab cadence is the correct match. 2. Animate visibility on a computed `shouldShow` rather than `isOffline` alone. On the cold-start offline path, `isOffline` flips to `true` while `authState == .loading`; later `authState` exits `.loading` while `isOffline` is unchanged. Keying the animation on `isOffline` skipped the slide-in transition because the animation key didn't change at the visible-transition moment. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
3 tasks
Owner
Author
|
Closing without merging per user feedback during on-device verification — the existing per-tab connectivity icons are sufficient signal, and the persistent top-of-screen pill was felt to be redundant and noisy. The actual offline-detection bug surfaced during this PR's verification (relay state lying for ~2 minutes after airplane-mode toggle) is being fixed in #101 instead. With #101, the existing red connectivity icon updates correctly — no separate pill needed. |
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.
Summary
ConnectivityPillview at the top ofRootView, above the onboarding publish-failure banner from feat(onboarding): publish-failure banner with retry #95. Renders only whenappState.isRelayConnected()returns false ANDauthState != .loading(avoids a flash on cold launch before the relay manager is configured).ConnectivitySheetfor diagnostics + manual reconnect — same modal the per-tab toolbar buttons already open. The pill is global so users do not have to be on a specific tab to spot connectivity issues.isRelayConnected()every 5s (matchesConnectivitySheet's own self-refresh cadence). Polling lives in the view's.taskmodifier, so it auto-cancels with view lifetime.DriversTab/HistoryTab/RideTabis intentionally retained — the pill communicates global state, the per-tab UI communicates per-tab consequences (empty states, etc).Closes Issue #97 item 3.
Test plan
xcodebuild ... testpasses.ConnectivitySheetopens, toggle airplane mode off → pill auto-dismisses within ~5s.authState != .loading).🤖 Generated with Claude Code