Skip to content

feat(frontend): Dark Mode Theme Engine — state refactor, animations, unit tests & screen reader support#1008

Merged
emdevelopa merged 2 commits into
emdevelopa:mainfrom
libby-coder:feature/fe-947-948-949-950-dark-mode-theme-engine
Jun 25, 2026
Merged

feat(frontend): Dark Mode Theme Engine — state refactor, animations, unit tests & screen reader support#1008
emdevelopa merged 2 commits into
emdevelopa:mainfrom
libby-coder:feature/fe-947-948-949-950-dark-mode-theme-engine

Conversation

@libby-coder

Copy link
Copy Markdown
Contributor

Summary

This PR addresses all four Dark Mode Theme Engine UX enhancement issues:

Test plan

  • Toggle cycles correctly: light → dark → system → light
  • System theme respects prefers-color-scheme media query
  • localStorage persists preference under the configured storageKey
  • Error state shown and clears on retry
  • Screen reader announces theme change on each toggle
  • Animations play smoothly on theme switch (no jank on mobile)
  • Focus ring visible when navigating by keyboard
  • Mobile-responsive layout verified on Chrome/Safari/Firefox

Closes #947
Closes #948
Closes #949
Closes #950

Replace multiple useState calls with useReducer for atomic, predictable
state transitions. Fix stale closure bug in system media query listener
by using a ref for current theme. Separate mount-time initialization into
a single one-time effect, eliminating redundant listener re-registration
on every theme change. Extract DOM side-effects into reusable helpers
for clarity and testability.
@vercel

vercel Bot commented Jun 25, 2026

Copy link
Copy Markdown

@libby-coder 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

@libby-coder 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

@gitguardian

gitguardian Bot commented Jun 25, 2026

Copy link
Copy Markdown

⚠️ GitGuardian has uncovered 1 secret following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

Since your pull request originates from a forked repository, GitGuardian is not able to associate the secrets uncovered with secret incidents on your GitGuardian dashboard.
Skipping this check run and merging your pull request will create secret incidents on your GitGuardian dashboard.

🔎 Detected hardcoded secret in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
34269854 Triggered Stripe Webhook Secret 6405d1a backend/src/lib/payment-signature-verification.test.js View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secret safely. Learn here the best practices.
  3. Revoke and rotate this secret.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

@emdevelopa emdevelopa merged commit 838f2b8 into emdevelopa:main Jun 25, 2026
0 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