Repository navigation
feat(offline): add manual retry button to OfflineIndicator - #844
Merged
Jaydbrown merged 1 commit intoOct 22, 2026
Merged
Conversation
…rotocol#794) Add a 'Retry Connection' button to the offline toast that pings NEXT_PUBLIC_HORIZON_URL with a HEAD/no-store request. On success the banner hides (connection restored); on failure the banner stays visible and the button re-enables so the user can try again. Changes: - components/OfflineIndicator.tsx: add retrying state + handleRetry callback; wrap existing text in <span>; render button inline - components/__tests__/OfflineIndicator.test.tsx: 5 new tests covering button render, in-flight disabled state, success/failure paths, and fetch arguments; add afterEach restoreAllMocks Closes conduit-protocol#794
Jaydbrown
approved these changes
Oct 22, 2026
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
Adds a Retry Connection button to the offline toast in
components/OfflineIndicator.tsx.Users returning from a flight or subway who are back online can now manually trigger a connectivity check rather than waiting for the browser's
onlineevent.What changed
components/OfflineIndicator.tsxretryingstate and ahandleRetryuseCallbackthat sends aHEADrequest withcache: 'no-store'toNEXT_PUBLIC_HORIZON_URL(falls back to the testnet URL if the env var is unset).isOnlineset totrue).Retrying…while the request is in-flight.<span>so the button sits inline cleanly.components/__tests__/OfflineIndicator.test.tsxafterEach(() => vi.restoreAllMocks())to the outer suite.describe('Retry Connection button')block with 5 tests:Retrying…and is disabled while the fetch is in-flight.fetchwith{ method: 'HEAD', cache: 'no-store' }.Test results
All 11
OfflineIndicatortests pass. No pre-existing failures were introduced or masked — the only files changed are:components/OfflineIndicator.tsxcomponents/__tests__/OfflineIndicator.test.tsxCloses #794