Problem
useCollaborationStatus (lib/hooks/useCollaborationStatus.ts) is a collaboration presence hook that currently connects to the lint WebSocket endpoint (/api/v1/projects/{id}/lint/ws) as a placeholder. This creates confusion:
- The hook name suggests collaboration/presence but connects to lint
- The
ConnectionStatus icon in the editor toolbar shows lint WS status labeled as collaboration
HealthCheckPanel independently creates its own lint WebSocket connection — so there are two connections to the same endpoint with different purposes
- The hardcoded "disabled" collab icon (
state="disabled", endpoint="/api/v1/collab/ws") sits next to the lint-backed "collab" icon
Proposed changes
useCollaborationStatus should connect to a future /api/v1/collab/ws endpoint for real-time presence (or be disabled until that endpoint exists)
- Lint WebSocket status should be managed solely by
HealthCheckPanel and only when the panel is open
- The editor toolbar should show:
- A collaboration presence icon (connected to
/collab/ws when available, disabled until then)
- A lint/index status icon (connected only when the health check panel is open)
- Remove the duplicate "disabled" hardcoded
ConnectionStatus icon from the editor toolbar
Current architecture
Editor toolbar:
[collab icon: disabled] [lint icon: useCollaborationStatus → /lint/ws]
HealthCheckPanel (when open):
creates its own WebSocket → /lint/ws (with token auth)
Target architecture
Editor toolbar:
[collab icon: useCollaborationStatus → /collab/ws (or disabled)]
[lint icon: reflects HealthCheckPanel WS status when open]
HealthCheckPanel (when open):
creates WebSocket → /lint/ws (with token auth)
exposes connection status to parent
🤖 Generated with Claude Code
Problem
useCollaborationStatus(lib/hooks/useCollaborationStatus.ts) is a collaboration presence hook that currently connects to the lint WebSocket endpoint (/api/v1/projects/{id}/lint/ws) as a placeholder. This creates confusion:ConnectionStatusicon in the editor toolbar shows lint WS status labeled as collaborationHealthCheckPanelindependently creates its own lint WebSocket connection — so there are two connections to the same endpoint with different purposesstate="disabled",endpoint="/api/v1/collab/ws") sits next to the lint-backed "collab" iconProposed changes
useCollaborationStatusshould connect to a future/api/v1/collab/wsendpoint for real-time presence (or be disabled until that endpoint exists)HealthCheckPaneland only when the panel is open/collab/wswhen available, disabled until then)ConnectionStatusicon from the editor toolbarCurrent architecture
Target architecture
🤖 Generated with Claude Code