chats
A chat interface package that draws AI replies written out in real time and ordinary chat with the same composer and message list; the product using it owns requests and retries.
- 2025.09 ~ Present
- Firstage
- Design and implementation (solo)

Core value
A product adding AI conversation only adds its own messages, such as edit proposal cards, without rebuilding live replies or scrolling.
Outcomes
- Powers the photobook conversations in Journey and on the homepage
- Tied to no particular connection method or server
- Loading earlier history keeps the reader's place
- Long conversations stay light by drawing only the messages on screen
Tech stack
Context
chats renders the conversation screens in Firstage’s AI-driven flows. The main one is the photobook editor, where you revise pages by talking with AI, and that conversation carries product-specific messages such as edit proposal cards, clarifying questions, and usage notes. I kept the basics of a conversation screen, such as streaming display and scrolling, in one place so no product has to rebuild them, and tied the package to no particular transport (WebSocket, SSE, the AI SDK) or backend.
Decisions and implementation
- The composer and the message list are independent parts, so either can be used alone. AI streaming conversations and regular chat compose the same parts.
- A pure function applies streaming events to message nodes, and the UI handles token-level rendering and virtual scrolling. There is no separate state machine.
- Message content renders through a renderer registry keyed by node.type. A product registers its own nodes, such as edit proposals, and the host’s renderer catalog must cover every node type the product defines.
- Requests, retries, storage, and optimistic state belong to the product that uses the package. The host carries the explicit responsibility that re-rendering a message, replaying history, or pressing a recovery control never repeats a paid request.
- A short conversation sits right above the composer, and the view follows a growing response until the person scrolls up. Loading earlier history keeps the reader’s position.
Current state
The AI conversation in the Journey app’s photobook editor and the photobook creation screen on the Firstage homepage render their conversations with this package. The current version is 1.0.0-alpha.0, and an end-to-end check of the photobook integration in the live service remains before 1.0.0.
