feat: refactor NetworkStatusIndicator — state hook, framer-motion animations, unit tests, screen reader support#997
Merged
starTecchie merged 1 commit intoJun 24, 2026
Conversation
… and screen reader support for NetworkStatusIndicator - Extract network monitoring state logic into useNetworkMonitor hook (starTecchie#967) - Add framer-motion animation variants for status transitions, dot pulse, refresh button spin, and connection quality in network-animations.ts (starTecchie#968) - Convert NetworkStatusIndicator.accessibility.test.tsx from Jest to Vitest syntax (vi.mock, vi.fn, vi.hoisted for shared mock instances) (starTecchie#969) - Add comprehensive ARIA attributes: aria-live, aria-atomic, aria-busy, aria-describedby, aria-pressed on refresh button, role="group" on details panel, sr-only announcement region, and online/offline event announcements via useScreenReader (starTecchie#970) - Simplify Escape key handler in useNetworkMonitor to always restore focus (removes focus-equality guard that prevented restoreFocus from being called) Closes starTecchie#967 Closes starTecchie#968 Closes starTecchie#969 Closes starTecchie#970
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
useNetworkMonitorcustom hook, keeping the component as a pure presentation layer backed by a Zustand store (useNetworkStatusStore)network-animations.tswithgetAdaptiveTransitionfor reduced-motion supportNetworkStatusIndicator.accessibility.test.tsxfrom Jest to Vitest (vi.mock,vi.fn,vi.hoistedfor shared mock instances across component and tests); all test dependencies (@testing-library/react,vitest,jsdom) already present inpackage.jsonrole="region"witharia-live="polite",aria-atomic,aria-busy(during checks),aria-describedbylinking to details panel,role="group"on details,.sr-onlylive-region,aria-pressed/aria-busyon refresh button,window.online/offlineevent announcements viauseScreenReader, Ctrl+R keyboard shortcut, Escape key restores focusTest plan
npm run test:unitpasses infrontend/— mainNetworkStatusIndicator.test.tsxcovers rendering, status display, refresh, auto-check, ARIA attributesNetworkStatusIndicator.accessibility.test.tsx) runs withoutjest is not definederrorsCloses #967
Closes #968
Closes #969
Closes #970