feat(frontend): balance-sync tests + optimistic updates, SR live region, onboarding reducer extraction#844
Merged
emdevelopa merged 1 commit intoMay 28, 2026
Conversation
…on, onboarding reducer extraction - emdevelopa#805: add unit tests for Real-time Balance Sync covering the Horizon address path, the disabled state, optimistic updates and the stale flag. - emdevelopa#806: give SupportPanel a single authoritative sr-only live region for balance sync, and make the visual balance row non-live to avoid double announcements. - emdevelopa#807: add applyOptimistic() to useBalanceSync so a just-submitted balance is reflected immediately and reconciled by the next poll. - emdevelopa#808: extract the Onboarding Progress Tracker state into a pure, unit-tested onboarding-reducer module, decoupling state logic from the view. Closes emdevelopa#805 Closes emdevelopa#806 Closes emdevelopa#807 Closes emdevelopa#808
|
@david87131 is attempting to deploy a commit to the Emmanuel's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@david87131 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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
Four small frontend changes across the Real-time Balance Sync and Onboarding Progress Tracker modules, bundled into one PR.
src/hooks/useBalanceSync.test.ts): added coverage for the Horizon address path (with native→XLM normalisation), the disabled state, the new optimistic update, and theisStaleflag.src/components/SupportPanel.tsx): added a single authoritative visually-hiddenrole="status"live region that announces sync state ("Syncing…", "unfunded", "Balance synced: X CODE"), and made the visual balance row non-live so screen readers hear one clear message instead of raw element swaps.src/hooks/useBalanceSync.ts): addedapplyOptimistic(code, balance)so a just-submitted balance can be reflected immediately; the next poll reconciles it with the authoritative value.src/components/onboarding-reducer.ts): extracted the reducer, itsOnboardingState/OnboardingActiontypes and an initial-state factory out of the component into a pure module, decoupling state logic from the view and making it independently unit-testable. Component behaviour is unchanged.Test plan
vitest run src/hooks/useBalanceSync.test.ts src/components/onboarding-reducer.test.ts— 12 tests pass (6 balance-sync + 6 onboarding-reducer)tsc --noEmit— no type errors in any of the changed filesNote (pre-existing, not introduced by this PR)
The repository's React component test environment fails on
mainwith a jsdomappendChilderror (verified on the unmodified tree), so component-render tests forSupportPanel/OnboardingProgressTrackercannot run locally. The work above is therefore covered by hook tests and a pure reducer test, which do run green;tscconfirms the component edits type-check.Closes #805
Closes #806
Closes #807
Closes #808