feat: typed mock service layer and global async state system (#38, #48)#107
Merged
Abidoyesimze merged 1 commit intoNeurowealth:mainfrom Mar 30, 2026
Conversation
…alth#38, Neurowealth#48) Issue Neurowealth#38 - Mock data layer and service adapters: - Add src/lib/mock-services.ts with typed AuthService, PortfolioService, StrategyService, and TransactionService interfaces - Shared ServiceError model with code, message, and retryable flag - SimulationOptions for forcing success/failure or auto (15% fail rate) - Each mock service implements its interface — swap for real adapters without touching call-sites Issue Neurowealth#48 - Global loading, empty, and error state system: - Add src/components/ui/ErrorBlock.tsx: inline error block with title, description, and retry action button (spec: title + explanation + CTA) - Add src/hooks/useAsyncState.ts: generic hook managing idle/loading/ success/error with ServiceError-aware retry flag - Export ErrorBlock from src/components/ui/index.ts barrel - Add src/app/dashboard/async-states/page.tsx: demo page covering loading skeletons, empty states with CTAs, and error blocks with retry for portfolio, strategy, transaction, history, and audit pages All checks pass: lint ✓ tsc --noEmit ✓ next build ✓
|
@temiport25 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! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue #38 - Mock data layer and service adapters:
Issue #48 - Global loading, empty, and error state system:
closes #38
closes #48