Skip to content

Implement WebSocket client hook #25

@superposition

Description

@superposition

Description

Create React hook for WebSocket connection to server.

Tasks

  • Create hooks/useWebSocket.ts
  • Implement auto-reconnect with exponential backoff
  • Parse binary frames using protocol from @marigraph/core
  • Dispatch updates to Zustand store
  • Track connection status (connecting, connected, disconnected)
  • Add connection status indicator component
  • Handle SURFACE_FULL and SURFACE_DELTA messages
  • Add manual reconnect button

Acceptance Criteria

  • Connects to server automatically
  • Reconnects on disconnect
  • UI shows connection status

Labels

web-app, frontend, real-time

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions