Skip to content

feat(frontend): balance-sync tests + optimistic updates, SR live region, onboarding reducer extraction#844

Merged
emdevelopa merged 1 commit into
emdevelopa:mainfrom
david87131:feat/issues-805-806-807-808
May 28, 2026
Merged

feat(frontend): balance-sync tests + optimistic updates, SR live region, onboarding reducer extraction#844
emdevelopa merged 1 commit into
emdevelopa:mainfrom
david87131:feat/issues-805-806-807-808

Conversation

@david87131
Copy link
Copy Markdown
Contributor

Summary

Four small frontend changes across the Real-time Balance Sync and Onboarding Progress Tracker modules, bundled into one PR.

  • [Frontend] Add unit tests for Real-time Balance Sync #805 — unit tests for Real-time Balance Sync (src/hooks/useBalanceSync.test.ts): added coverage for the Horizon address path (with native→XLM normalisation), the disabled state, the new optimistic update, and the isStale flag.
  • [Frontend] Improve screen reader support for Real-time Balance Sync #806 — screen reader support for Real-time Balance Sync (src/components/SupportPanel.tsx): added a single authoritative visually-hidden role="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.
  • [Frontend] Enable optimistic updates in Real-time Balance Sync #807 — optimistic updates in Real-time Balance Sync (src/hooks/useBalanceSync.ts): added applyOptimistic(code, balance) so a just-submitted balance can be reflected immediately; the next poll reconciles it with the authoritative value.
  • [Frontend] Refactor state logic for Onboarding Progress Tracker #808 — refactor state logic for the Onboarding Progress Tracker (src/components/onboarding-reducer.ts): extracted the reducer, its OnboardingState/OnboardingAction types 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.ts12 tests pass (6 balance-sync + 6 onboarding-reducer)
  • tsc --noEmit — no type errors in any of the changed files

Note (pre-existing, not introduced by this PR)

The repository's React component test environment fails on main with a jsdom appendChild error (verified on the unmodified tree), so component-render tests for SupportPanel/OnboardingProgressTracker cannot run locally. The work above is therefore covered by hook tests and a pure reducer test, which do run green; tsc confirms the component edits type-check.

Closes #805
Closes #806
Closes #807
Closes #808

…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
@vercel
Copy link
Copy Markdown

vercel Bot commented May 28, 2026

@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.

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 28, 2026

@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! 🚀

Learn more about application limits

@emdevelopa emdevelopa merged commit a27b2b6 into emdevelopa:main May 28, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants