Skip to content

Add sample conversations for the chat stories #96

Closed

Description

@pratikbuilds

Add one shared, deterministic set of sample conversations, built only from the contract types, for every chat story that shows conversation data.

Part of #94.

Depends on #95.

Why

Chat stories need realistic data without an app behind them. One shared set keeps the stories consistent and exercises the contract on real shapes: long chats, tool storms, every approval outcome, images, threads and failures.

What

  • stories/chat/samples/conversations.ts:
    • shortChat
    • longChat: a few hundred messages, generated deterministically.
    • toolStorm: many steps, a tool batch, a failure, a pending approval and one of each resolved outcome (approved once, approved always, denied, timed out, expired).
    • generatedImages
    • withThread: a message with replies.
    • failedSend
  • stories/chat/samples/play-turn.ts: playTurn(message, onFrame) reveals a message's parts over time for streaming stories and returns a stop function.
  • stories/chat/samples/samples.stories.tsx: one story listing each sample's size.

Requirements

Constraints

  • Deterministic: no Math.random and no current time; fixed timestamps.
  • Generic names only (agent, workflow, …); no product brands in names or text.
  • Samples live under stories/ and never ship. E2E fixtures can't import them; fixture scenarios build their data inline from the public exports.
  • The shared rules in Replace the chat components with a stateless Conversation family #94 apply: no new dependency, no change to existing modules.

Done when

  • tsconfig.json already includes stories, so bun run check typechecks the samples and passes.
  • bun run stories:build succeeds with the samples.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions