Skip to content

feat: UI component library with Storybook, Stellar explorer links, dispute filing, and async handler - #214

Merged
dark-sarge merged 1 commit into
arflexx:mainfrom
ScriptedBro:feat/issues-61-66-67-147-ui-disputes-explorer-async
Aug 28, 2026
Merged

feat: UI component library with Storybook, Stellar explorer links, dispute filing, and async handler#214
dark-sarge merged 1 commit into
arflexx:mainfrom
ScriptedBro:feat/issues-61-66-67-147-ui-disputes-explorer-async

Conversation

@ScriptedBro

Copy link
Copy Markdown
Contributor

Description

This pull request implements reusable UI primitives with Storybook documentation, Stellar explorer deep-linking, trade dispute filing UI and endpoints, and an interim async error handler wrapper.

Summary of Changes

1. Interim Async Error Handler Wrapper (`server`)

  • Created generic TypeScript wrapper `server/src/utils/asyncHandler.ts` catching rejected promises and forwarding errors to `next(err)`.
  • Preserves full Express request and response typing across route handlers.
  • Documented with JSDoc outlining deprecation path once `express-async-errors` is deployed.
  • Verified with unit tests covering error forwarding and successful resolution (`server/src/utils/asyncHandler.test.ts`).
  • Closes [server] - Add server/src/utils/asyncHandler.ts Wrapper as Interim Until express-async-errors #147.

2. Stellar Explorer Deep-Link Component (`frontend`)

  • Created `frontend/components/StellarExplorerLink.tsx` supporting `transaction`, `account`, and `contract` types.
  • Dynamically resolves Stellar Expert explorer URLs for testnet and mainnet based on `NEXT_PUBLIC_STELLAR_NETWORK`.
  • Renders external link icon, opens in a new tab with `rel="noopener noreferrer"`, and gracefully handles empty/undefined values.
  • Integrated into wallet transactions and public keys, trade detail escrow contracts, user profile, and admin dashboards.
  • Fully unit tested in `frontend/components/StellarExplorerLink.test.tsx`.
  • Closes [frontend] - Build Stellar Explorer Deep-Link Component #66.

3. Trade Dispute Filing UI & Backend Endpoint (`frontend` & `server`)

  • Implemented accessible `DisputeModal` dialog component with focus trapping, ESC key listener, consequence explanation, and a 500-character textarea counter.
  • Added conditional "Raise Dispute" button on trade detail page for `Locked` trades viewed by buyer or seller.
  • Integrated dispute submission to `POST /api/v1/trades/:id/dispute` and Next.js proxy route `/api/trades/:id/dispute`.
  • Updates trade badge to `Disputed` and displays "Dispute Filed" badge with 24-hour admin review notice upon filing.
  • Unit tested in `frontend/components/ui/ui.test.tsx`.
  • Closes [frontend] - Implement Dispute Filing UI for Buyers and Sellers #61.

4. Reusable UI Component Library with Storybook (`frontend`)

  • Installed and configured Storybook in `frontend/.storybook/` using `@storybook/nextjs` adapter and Tailwind CSS.
  • Created reusable UI primitives in `frontend/components/ui/` with Storybook stories and TypeScript prop types:
    • `Button` (variants: primary, secondary, danger, ghost; loading states)
    • `Input` (labels, helper text, error messages, ARIA states)
    • `Select` (accessible dropdown with options and error styling)
    • `Badge` (status variants: Open, Active, Locked, Completed, Cancelled, Disputed)
    • `Card` (Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter)
    • `Modal` (accessible dialog with focus trap and keyboard dismissal)
    • `Spinner` (accessible loading indicator with ARIA status)
  • Refactored trade detail, wallet, profile, admin, and home page components to consume UI primitives.
  • Pinned Webpack 5 override to ensure clean Storybook static builds without errors.
  • Closes [frontend] — Create Reusable UI Component Library with Storybook #67.

Issues Closed

Verification

  • Server Tests: 12/12 test suites passed, 83/83 tests passing (`pnpm --filter airflex-server test`).
  • Frontend Tests: 5/5 test suites passed, 61/61 tests passing (`pnpm --filter airflex-frontend test`).
  • Storybook Static Build: `pnpm --filter airflex-frontend build-storybook` completed with exit code 0.

… dispute filing, and async handler (arflexx#61, arflexx#66, arflexx#67, arflexx#147)

- Implement interim asyncHandler wrapper with generic TypeScript support and unit tests (arflexx#147)
- Add StellarExplorerLink component for Stellar Expert block explorer deep linking on testnet/mainnet (arflexx#66)
- Implement dispute filing flow with DisputeModal, server endpoint, and client integration (arflexx#61)
- Setup Storybook with @storybook/nextjs adapter and create reusable UI component primitives (arflexx#67)
- Refactor wallet, trade detail, profile, admin, and home pages to use UI primitives and explorer links
@drips-wave

drips-wave Bot commented Aug 28, 2026

Copy link
Copy Markdown

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

@dark-sarge
dark-sarge merged commit 5fedca0 into arflexx:main Aug 28, 2026
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