Skip to content

fix: address UI docs, hook tests, wallet tests, and Docker Prisma issue - #920

Merged
ogazboiz merged 4 commits into
LabsCrypt:mainfrom
osasfaith:fix/880-881-885-888-ui-docs-tests-infra
Jun 29, 2026
Merged

fix: address UI docs, hook tests, wallet tests, and Docker Prisma issue#920
ogazboiz merged 4 commits into
LabsCrypt:mainfrom
osasfaith:fix/880-881-885-888-ui-docs-tests-infra

Conversation

@osasfaith

Copy link
Copy Markdown

Closes #880, Closes #881, Closes #885, Closes #888

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Refactoring (no functional or behavioral changes)
  • Documentation update

Summary

This PR addresses 4 issues across documentation, testing, and infrastructure:

  1. Critical Bug Fix ([Infra] Backend Docker image never contains the generated Prisma client, so the container crashes on startup #888): Backend Docker image was missing the generated Prisma client, causing ERR_MODULE_NOT_FOUND at startup. Fixed by copying the generated directory to the runtime image and moving @prisma/client to runtime dependencies.

  2. Hook Tests ([Testing] useModalDialog focus-trap / Escape / scroll-lock hook has no tests despite powering every modal's a11y #881): Added comprehensive tests for useModalDialog hook covering Escape key handling, focus trapping (Tab/Shift+Tab wrapping), body scroll lock, and focus restoration.

  3. Context Tests ([Testing] WalletProvider (context/wallet-context.tsx) connect/disconnect/hydrate reducer and session persistence are untested #880): Added tests for WalletProvider context covering hydration (valid/malformed/invalid sessions), connect success/failure flows, disconnect behavior, and useWallet hook validation.

  4. Documentation ([Docs] Shared src/components/ui primitives (Button/Stepper/Card/Skeleton/TransactionTracker) have no usage docs or stories #885): Added comprehensive documentation for all UI primitives (Button, Stepper, Card, Skeleton, TransactionTracker) with props tables, type definitions, defaults, and usage examples.

Motivation / Context

These changes improve code reliability, maintainability, and developer experience:

  • The Docker fix prevents production crashes when deploying the backend
  • The new tests ensure critical wallet and modal functionality works correctly
  • The documentation makes it easier for developers to use the UI components properly

Closes #880, Closes #881, Closes #885, Closes #888

The backend Docker image was missing the generated Prisma client, causing
ERR_MODULE_NOT_FOUND at startup. The client is generated into
src/generated/prisma/ which is not compiled by TypeScript and was not
copied to the runner stage.

Changes:
- Copy src/generated directory from builder to runner stage
- Move @prisma/client from devDependencies to dependencies (needed at runtime)

Fixes LabsCrypt#888
Tests cover:
- Body scroll lock (hidden on mount, restored on unmount)
- Escape key closes modal (and respects isCloseDisabled)
- Tab focus wrapping (last to first)
- Shift+Tab focus wrapping (first to last)
- Focus restoration on unmount

Fixes LabsCrypt#881
Tests cover:
- Hydration: restores valid stored session, discards malformed/invalid sessions
- Connect: success dispatches and persists session, failure clears stored session
- Disconnect: clears state and removes localStorage key
- useWallet: throws error when used outside WalletProvider

Fixes LabsCrypt#880
Documents Button, Stepper, Card, Skeleton, and TransactionTracker
components with props, types, defaults, and usage examples.

Each component includes:
- Props table with types and default values
- Variant/state descriptions
- Multiple usage examples
- Accessibility notes

Fixes LabsCrypt#885
@ogazboiz
ogazboiz merged commit c9a0d27 into LabsCrypt:main Jun 29, 2026
8 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment