Skip to content

feat: dark mode, skeleton loaders, batch upsert optimization, and error boundaries (#122, #124, #125, #128) - #299

Open
Sweet-Kid wants to merge 8 commits into
accensa:mainfrom
Sweet-Kid:feat/issues-122-124-125-128
Open

feat: dark mode, skeleton loaders, batch upsert optimization, and error boundaries (#122, #124, #125, #128)#299
Sweet-Kid wants to merge 8 commits into
accensa:mainfrom
Sweet-Kid:feat/issues-122-124-125-128

Conversation

@Sweet-Kid

Copy link
Copy Markdown

Summary

This PR resolves 4 open issues to improve the merchant dashboard experience:

closes #128 – Dark Mode Support

  • Updated ThemeToggle to support 3-way cycling: light → dark → system
  • Added Monitor icon from lucide-react for system theme indicator
  • Theme persists to localStorage via next-themes

closes #125 – Skeleton Loaders

  • Created reusable WidgetSkeleton component with 4 variants: card, chart, table, stat
  • Integrated WidgetSkeleton into dashboard loading states
  • Prevents layout shift (CLS) during data fetch

closes #124 – Optimize Postgres Upsert Queries

  • Refactored sync route to use batch insert via insertPaymentsInTransaction
  • Fixed broken function structure in respond() and POST() handlers
  • Removed duplicate imports and undefined variable references
  • Single transaction for all batch operations improves performance

closes #122 – API Error Boundaries

  • Created dashboard layout wrapping all routes with ErrorBoundary
  • Wrapped individual dashboard sections (settlement summary, settlements table) for widget isolation
  • Custom fallback UI with retry button and clear error messaging
  • Crashes in one widget don't take down the entire dashboard

Files Changed

  • apps/web/src/components/theme-toggle.tsx – 3-way theme toggle
  • apps/web/src/components/widget-skeleton.tsx – New skeleton component
  • apps/web/src/app/dashboard/page.tsx – Integrate skeletons and error boundaries
  • apps/web/src/app/dashboard/layout.tsx – New dashboard layout with ErrorBoundary
  • apps/web/src/app/api/sync/route.ts – Batch upsert optimization and bug fixes

@drips-wave

drips-wave Bot commented Aug 30, 2026

Copy link
Copy Markdown

@Sweet-Kid 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

@vercel

vercel Bot commented Aug 30, 2026

Copy link
Copy Markdown

@Sweet-Kid is attempting to deploy a commit to the ACCENSA Team on Vercel.

A member of the Team first needs to authorize it.

@mergekeeper

mergekeeper Bot commented Aug 30, 2026

Copy link
Copy Markdown

MergeKeeper review

Scope: in scope for linked issue #128.
Verdict: clean

The pull request correctly implements dark mode cycling, skeleton loaders, database upsert query optimizations, and API error boundaries as specified by the linked issues.

Reviewed commit: fe70050fcd444a8da017749172641a26010a63fd.
CI and merge eligibility are checked separately.

@mergekeeper

mergekeeper Bot commented Aug 30, 2026

Copy link
Copy Markdown

MergeKeeper merge status

Status: blocked
PR state: open
Mergeability: mergeable
Checked commit: fe70050fcd444a8da017749172641a26010a63fd.

Reason: One or more required CI checks failed.

Failing checks:

Next steps:

  1. Open the failing check details above and fix the reported error.
  2. Run the same checks locally where possible.
  3. Commit and push the fix.
  4. MergeKeeper will automatically re-review the updated PR.

- theme-toggle: use lazy initializer, ThemeIcon component, eslint-disable for mount
- widget-skeleton: replace Math.random() with pre-computed bar heights
- sync route: remove unused imports (decodeTransferEvent, setLastSyncedLedger, PAYMENTS_BATCH_SIZE)
- dashboard: remove unused loadRefundedFromStorage, saveRefundedToStorage, TableSkeleton
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant