feat: add session status indicator and connection badge to UI#153
feat: add session status indicator and connection badge to UI#153vrutank14t7 wants to merge 2 commits intoc2siorg:mainfrom
Conversation
- Add SessionBadge component with color-coded connection states (green/yellow/red) - Add useSession hook with real backend health check polling every 5s - Add /health endpoint to backend for connection status checks - Add sessionId and connectionStatus to DataContext for future multiuser work - Closes c2siorg#143
|
Thanks for adding a visible session status badge and wiring A few technical issues worth addressing before merge: 1. Hardcoded backend URL breaks non-localhost deployments File: The hook calls 2. Client-generated session ID does not align with File: The hook generates a random session ID on the client side The correct approach is to call 3. No tests for the new polling behavior or state Files: Seven files changed, zero test files added. The new Adding hook tests with mocked fetch and fake timers would The most critical fix is item 2 , moving from a |
|
Thanks for the detailed review — really helpful! You're right about the session lifecycle. I’ll update the implementation to:
I’ll push an updated version shortly. |
- added /create_session endpoint - moved session ownership to backend - added health polling with cleanup - added minimal tests for hook and UI
|
Merged session status indicator and backend-driven session handling.
Verified via local testing and network inspection. |
Closes #143
Changes
SessionBadge.jsx— color-coded badge (🟢 Connected / 🟡 Connecting / 🔴 Disconnected)useSession.js— real backend health check polling every 5 secondsDataContext.jsx— sessionId + connectionStatus added for future multiuser workmain.py— /health GET endpoint added for clean connection status checksTesting