docs/mobile-chat/00-index.md
Status: active · Task: mobile-chat · Approach: C — Hybrid Seams
Port the Onyx web chat experience to the React Native + Expo mobile app, delivered as independently-mergeable phases. Backend is unchanged. Pre-production (no backwards-compat / feature flags).
Decision (2026-06-26, revised): no shared chat code. The chat pure layer — NDJSON parser, message tree,
processRawChatHistory, and all chat/streaming/file contracts — is written natively in mobile (PR 2), with web keeping its own existing copies. Nothing chat-related enters@onyx-ai/shared. We considered sharing the whole pure layer, then just the ~40-line parser, then dropped even that — the shared-package machinery (util + web re-point + jest mapper + dist coupling) is more moving parts than the ~200 lines of duplication it removes. Pre-production the backend protocol is stable, so drift risk is low and cheap to re-extract later if it bites. Web is untouched by the mobile chat port. Full rationale in the PR 2 section of05-pr-roadmap.md.
Each PR is its own session. Before coding a PR: open its entry in 05-pr-roadmap.md, run the "Before you start (grill on)" checklist with the owner, re-read the cited web/mobile files, then implement. The deep per-slice detail is produced in that session — this spec is deliberately high-level so it doesn't go stale.
Hard gate before PR 3 (two-step): the expo/fetch streaming spike is DONE — PASS (getReader() works on the iOS sim; recorded in 05-pr-roadmap.md). The react-native-streamdown build/render check on RN 0.85 was deferred to PR 3 pre-work and is still outstanding — it must pass before PR 3 locks the markdown component (fallback react-native-marked).
Core chat (send → stream → markdown → sessions/history) · agent selection only · projects (select + chat-within + file management; no project CRUD) · input-bar attachments (documents + photo library; no camera). Deferred to PR 9: citations, agentic timeline, regenerate/edit/feedback, follow-ups, image-gen.