Skip to content

feat(frontend): enable optimistic updates, refactor balance sync, add animations and tests#1003

Merged
emdevelopa merged 1 commit into
emdevelopa:mainfrom
ritik4ever:feature/fe-frontend-ux-enhancements
Jun 25, 2026
Merged

feat(frontend): enable optimistic updates, refactor balance sync, add animations and tests#1003
emdevelopa merged 1 commit into
emdevelopa:mainfrom
ritik4ever:feature/fe-frontend-ux-enhancements

Conversation

@ritik4ever

Copy link
Copy Markdown
Contributor

This PR addresses 4 frontend UX enhancement issues focused on the Dark Mode Theme Engine and Real-time Balance Sync modules.

Changes

#951 - Enable optimistic updates in Dark Mode Theme Engine

  • Refactored theme-context.tsx to use useRef for stable theme tracking, eliminating stale closure issues
  • Optimistic UI update pattern: state updates immediately, persistence follows, rollback on failure
  • Cleaned up duplicate rollback code in the error handler
  • Added 7 new tests across theme-context.test.tsx and theme-engine.test.tsx

#952 - Refactor state logic for Real-time Balance Sync

  • Added RESET action and reset() method to useBalanceSync
  • Used onUpdateRef to prevent stale closure issues in the onUpdate callback
  • Cleaned up useCallback dependency arrays

#953 - Implement framer-motion animations for Real-time Balance Sync

  • Added container entrance animation, staggered list items, balance value transitions
  • Error message animate-in/out, refresh button tap feedback, last-updated fade-in
  • Full useReducedMotion() support for accessibility

#954 - Add unit tests for Real-time Balance Sync

  • 9 tests covering rendering, balance display, loading, error, empty states, refresh, and ARIA attributes

Testing

… animations and tests

- Enable optimistic updates in Dark Mode Theme Engine with ref-based stable closures
- Refactor state logic for Real-time Balance Sync with RESET action and callback refs
- Implement framer-motion animations for Real-time Balance Sync with reduced-motion support
- Add unit tests for Real-time Balance Sync component

Closes emdevelopa#951
Closes emdevelopa#952
Closes emdevelopa#953
Closes emdevelopa#954
@vercel

vercel Bot commented Jun 25, 2026

Copy link
Copy Markdown

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

drips-wave Bot commented Jun 25, 2026

Copy link
Copy Markdown

@ritik4ever 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 803d4dc into emdevelopa:main Jun 25, 2026
1 of 5 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