Skip to content

Add dark mode, mobile layout, toasts, and query cache - #1289

Merged
Junirezz merged 1 commit into
Junirezz:mainfrom
miss-yusrah:feat/ui
Aug 26, 2026
Merged

Add dark mode, mobile layout, toasts, and query cache#1289
Junirezz merged 1 commit into
Junirezz:mainfrom
miss-yusrah:feat/ui

Conversation

@miss-yusrah

Copy link
Copy Markdown
Contributor

Summary

Frontend UX foundations for YieldVault: consistent theming, usable mobile layout, user-facing toasts, and a real data cache.

#1271 Dark mode

  • Settings already had Light / Dark / System; that control is wired to a shared theme layer.
  • Theme tokens live in frontend/src/styles/theme.css (CSS variables for surfaces, text, accents, toasts). Light mode overrides [data-theme="light"].
  • ThemeProvider + PreferencesProvider persist the preference (light | dark | system) in localStorage (yieldvault-theme), not only the resolved color.
  • System preference is detected on load and kept in sync via prefers-color-scheme (usePrefersColorScheme / subscribeToSystemTheme).
  • FOUC script in index.html applies the saved or OS theme before paint.
  • Navbar toggle, Settings cards, and several hardcoded colors now use theme variables.

#1274 Responsive layout

  • Breakpoints and touch rules in frontend/src/styles/responsive.css (375 / 768 / 1024, 44px hit targets, safe-area insets).
  • Mobile-first nav: hamburger on small screens, slide-over menu, overlay, Escape to close, body scroll lock, nav-mobile-link rows.
  • Settings locale grid stacks on phones; tables/toasts/panels pick up existing and new mobile rules.
  • accessibility.css is now imported (coarse-pointer / focus styles).

#1278 Toast notifications

  • Added sonner.
  • ToastProvider is the notification context (success / error / warning / info).
  • Auto-dismiss (duration) and manual dismiss (close button).
  • Queue capped at 5 (oldest dropped); dedupe window kept.
  • Alias: NotificationProvider / useNotification.
  • Toaster theme follows data-theme.

#1279 React Query cache

  • TanStack Query was already in the app; cache behavior is now explicit.
  • Stale-while-revalidate: staleTime + placeholderData keep previous data while refetching.
  • networkMode: "offlineFirst" so cached data is used offline.
  • localStorage persistence via persist client (yieldvault-query-cache, 24h), skipped in tests.
  • Invalidation helpers + useInvalidateQueries.
  • Optimistic deposit/withdraw updates remain in useVaultMutations / optimisticVaultCache.

Test plan

  • cd frontend && npm install
  • Settings → Appearance: Light, Dark, System; reload; change OS theme while on System
  • Toggle theme from the navbar; confirm charts, settings, errors, and toasts follow tokens
  • 375 / 768 / 1024: hamburger vs desktop links, overlay, 44px targets, no horizontal overflow
  • Trigger success/error/warning/info toasts; auto-dismiss and close; queue more than 5
  • Deposit/withdraw still optimistic; disconnect network and confirm cached vault/balance data; reconnect refetches

closes #1271
closes #1274
closes #1278
closes #1279

@drips-wave

drips-wave Bot commented Aug 26, 2026

Copy link
Copy Markdown

@miss-yusrah 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

@Junirezz
Junirezz merged commit fe07bf7 into Junirezz:main Aug 26, 2026
9 of 12 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