ClaireDocs

Ask Claire

Search the project, not the web.

Answers are grounded in Claire’s published documentation and include the source pages used.

⌘/Ctrl + J opens Ask Claire anywhere in docs.

Unified AI messenger client plan

Client architecture and implementation plan for the unified messaging experience.

DraftReviewed 2026-08-17View source ↗

Overview#

Extend the Claire mobile client to support multiple messaging platforms (WhatsApp, Telegram, Instagram, iMessage) in a unified inbox. Users can connect each platform independently and view/send messages across all of them from a single interface.

Architecture#

text
┌─────────────────────────────────────────────────────────────┐
│                    React Native Client                       │
│                                                              │
│  ┌──────────────┐    ┌──────────────┐    ┌───────────────┐  │
│  │  Auth Flow   │    │   Dashboard  │    │   Settings    │  │
│  │              │    │              │    │               │  │
│  │ - Sign in    │    │ - Unified    │    │ - Platform    │  │
│  │ - Platform   │    │   Inbox      │    │   management  │  │
│  │   connection │    │ - Filtering  │    │ - Connect /   │  │
│  │   check      │    │   by platform│    │   disconnect  │  │
│  └──────────────┘    └──────────────┘    └───────────────┘  │
│           │                 │                   │            │
│           └─────────────────┴───────────────────┘           │
│                             │                                │
│                   ┌─────────▼─────────┐                     │
│                   │   platformStore   │                     │
│                   │  (Zustand state)  │                     │
│                   └─────────┬─────────┘                     │
│                             │                                │
│                   ┌─────────▼─────────┐                     │
│                   │  Platform Service │                     │
│                   │   (API calls)     │                     │
│                   └─────────┬─────────┘                     │
└─────────────────────────────┼───────────────────────────────┘
                              │
                    ┌─────────▼─────────┐
                    │   Claire Backend   │
                    │  /api/platforms/*  │
                    └───────────────────┘

Components#

New Components#

ComponentPathDescription
PlatformIconcomponents/PlatformIconPlatform logo with status indicator
PlatformSelectorcomponents/PlatformSelectorHorizontal scroll to filter by platform
PlatformAuthModalcomponents/PlatformAuthModalPlatform connection flow (QR, phone, cookie)
ConnectedPlatformsListcomponents/ConnectedPlatformsListList of connected platforms in settings

Modified Components / Screens#

FileChanges
components/MessageCardAdd platform badge (icon + color) to each message
screens/LoginScreenAdd platform connection step after sign-in
screens/DashboardScreenUnified inbox with platform filter tabs
screens/SettingsScreenPlatform management section
screens/SignInScreenCheck all platform connections on load

State Management#

platformStore (Zustand)#

typescript
interface PlatformStore {
  platforms: PlatformConnection[];       // All platforms with status
  activePlatformFilter: string | null;   // Current inbox filter
  isLoading: boolean;
  error: string | null;

  fetchPlatforms: () => Promise<void>;
  connectPlatform: (type: PlatformType) => Promise<void>;
  disconnectPlatform: (type: PlatformType) => Promise<void>;
  setFilter: (platform: string | null) => void;
}

Mobile-Side Types#

typescript
type PlatformType = 'whatsapp' | 'telegram' | 'instagram' | 'imessage';

interface PlatformConnection {
  type: PlatformType;
  status: 'connected' | 'connecting' | 'disconnected' | 'error';
  displayName: string;
  lastSeen?: Date;
}

interface UnifiedMessage extends Message {
  platform: PlatformType;
  platformChatId: string;
}

Platform Auth Flows#

PlatformMethodUser Action
WhatsAppQR CodeScan with WhatsApp mobile app
TelegramPhone + CodeEnter phone, then SMS code
InstagramSession cookieExtract from browser (advanced)
iMessageMac pairingPair with local macOS device

API Endpoints Used#

text
GET  /api/platforms              - List connected platforms + status
POST /api/platforms/:type/connect    - Start connection flow
POST /api/platforms/:type/disconnect - Disconnect platform
GET  /api/platforms/:type/status     - Poll connection status
GET  /api/messages?platform=all      - Unified inbox
GET  /api/messages?platform=whatsapp - Filtered inbox

Tasks#

#TaskStatus
1Create platform service layer for API callsDone
2Create platformStore for multi-platform state managementDone
3Create PlatformIcon componentDone
4Create PlatformSelector componentDone
5Create PlatformAuthModal componentDone
6Update MessageCard to show platform badgesDone
7Create ConnectedPlatformsList componentDone
8Update login screen for multi-platform connectionDone
9Update dashboard for unified inbox with platform filteringDone
10Update settings screen with platform managementDone
11Create type definitions for client-side platform typesDone
12Update signin flow to check all platform connectionsDone
13Add platform connection status pollingPending
14Create integration tests for platform flowsPending

Remaining Work#

Task 13: Platform Connection Status Polling#

Poll GET /api/platforms/:type/status while a connection is in progress (e.g. waiting for QR scan). Stop polling once connected or failed.

  • Interval: every 3 seconds
  • Timeout: 2 minutes
  • Trigger: when platform status is connecting
  • Update platformStore on each poll

Task 14: Integration Tests#

Cover the main platform flows end-to-end:

  • Connect WhatsApp (QR code flow)
  • Connect Telegram (phone + code flow)
  • Filter unified inbox by platform
  • Disconnect a platform
  • Sign-in with all platforms already connected