Skip to content

Storybook setup with stories for Stellar components #25

@truthixify

Description

@truthixify

Labels: Stellar Wave, stellar, dx, test, drips, help-wanted
Tier: M (2–4 days)
Type: dx / test

Context

The demo has 16+ React components, but no way to develop them in isolation. Want to tweak the Stellar Receive list rendering? You have to spin up the whole app, connect a wallet, get matches, and only then can you see your change. This is slow, fragile, and discourages UI work.

Storybook fixes this. It also doubles as visual regression testing.

Scope

  1. Install Storybook 8 with the Vite + React preset.
  2. Configure for Wraith's dark monochrome design system — load the same Tailwind theme as the demo.
  3. Write stories for the key Stellar components:
    • StellarSend (with mocked wallet context, various amount/recipient states)
    • StellarReceive (variants: empty, 1 match, 10 matches, 50 matches, scan in progress, scan error)
    • Stealth match card (the inner item — focus + hover states, balance loading, balance error)
    • Wallet connect button (disconnected, connecting, connected, network mismatch)
    • Chain switcher dropdown (all 4 chains, with disabled states)
    • Copy button (idle, copying, copied)
  4. Mocked contexts:
    • Build .storybook/decorators/ providing fake ChainContext, StealthKeysContext, StellarWalletContext for stories.
    • Each story configures its context state — no real wallet, no real RPC.
  5. Visual regression CI — wire @storybook/test-runner or Chromatic. On every PR, snapshot all stories; fail on unexpected diff.

Constraints

  • Stories live alongside the component (e.g., StellarSend.stories.tsx).
  • No story should require a network request or wallet interaction.
  • Each story has at least three variants (idle, loading, error) where applicable.

Acceptance criteria

  • Storybook running locally (pnpm storybook).
  • Stories for ≥ 6 Stellar-related components.
  • Mocked contexts working cleanly.
  • CI snapshot job (Chromatic or test-runner) running on PRs.
  • Documented in CONTRIBUTING for future contributors.

Why this matters

UI quality is a function of iteration speed. The faster a contributor can see their change in 8 different states, the more states they'll fix. Storybook is the cheapest way to buy that speed.

Resources

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programdripsFunded via Drips NetworkdxDeveloper experiencehelp wantedExtra attention is neededstellarTouches Stellar / Soroban codetestTest coverage / harness

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions