05 - Streaming Chat & Interpretation
Overview
Implement the Reading Interpretation Chat (streaming content) using React Native + Reanimated + Markdown streaming.
Design Constraints
- OLED Noir Background: Use true black (#000000).
- Typography: High-contrast, elegant serif (Playfair Display) for interpretation content. Clean Sans-Serif (Inter) for chat UI chrome.
- Noir/Minimalist: Clean bubbles, subtle shadow (no borders), deep-indigo/black theme.
- Ritual Pacing: The chat shouldn't blast text. It should feel measured and intentional — a respite from high-intensity apps.
React Native / Expo Implementation
- Chat Container: Minimalist, OLED-noir background. Auto-scroll to bottom as content streams.
- Streaming: Use
fetchwithReadableStreamto stream Markdown content. Render withreact-native-markdown-display. - Typing Effect: Variable-speed typewriter (20-30ms per char). Start fast, slow down as the reading progresses to emphasize gravity. If user interrupts, stop the stream.
- Haptic: Subtle tick vibration every ~5th character streamed via
expo-haptics. - Voice/TTS: If user taps "Listen," play audio stream from TTS API. Handle background audio pause/resume. Fluid, liquid morphing animation for the Voice button states (idle/playing).
- State:
currentMessageIndex,chatMessages(array).
Context
- The web app uses a custom
TypewriterMarkdown.tsxandChatUserInput.tsxfor message sending/retry logic.
Deliverables
src/components/Chat/ChatBubble.tsxsrc/components/Chat/TypewriterText.tsxsrc/components/Chat/ChatInput.tsx
AI Developer Prompt
"Implement the InterpretationChat component. Use a dark mode/OLED noir background. The interpretation text must be rendered in Playfair Display (serif). Implement a Markdown streaming typewriter effect (20-30ms per char) that starts fast and slows down over time. Add subtle haptic ticks via expo-haptics during streaming. Build a custom Voice TTS button that morphs fluidly between states (idle/playing). The chat container must auto-scroll to the bottom during the stream. Support user interruption to stop the stream."