feat: standalone web UI (React + Vite)
React + TypeScript UI on port 5274. Connects to local daemon via WebSocket IPC (DaemonAdapter). Full chat layout with sidebar, message pane, and peer list. Mirrors the TUI feature set. - src/types.ts — IPC types mirroring proto.go - src/adapter/daemon — WebSocket IPC adapter with auto-reconnect - src/store/index.ts — Zustand store; handles all daemon events - src/pages/ — Onboarding (connect + join) and Chat - src/components/ — Sidebar, MessagePane, PeerList Dev: cd web && npm run dev (port 5274) Build: cd web && npm run build Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
22
web/src/App.tsx
Normal file
22
web/src/App.tsx
Normal file
@@ -0,0 +1,22 @@
|
||||
import { useEffect } from 'react'
|
||||
import { useWaste } from './store'
|
||||
import { Onboarding } from './pages/Onboarding'
|
||||
import { Chat } from './pages/Chat'
|
||||
import './App.css'
|
||||
|
||||
// Default to local daemon WS IPC. Override with VITE_DAEMON_WS env var.
|
||||
const DAEMON_WS = import.meta.env.VITE_DAEMON_WS ?? 'ws://127.0.0.1:17338'
|
||||
|
||||
export default function App() {
|
||||
const { connect, daemonStatus, localPeer } = useWaste()
|
||||
|
||||
useEffect(() => {
|
||||
connect(DAEMON_WS)
|
||||
}, [connect])
|
||||
|
||||
if (daemonStatus !== 'connected' || !localPeer) {
|
||||
return <Onboarding status={daemonStatus} />
|
||||
}
|
||||
|
||||
return <Chat />
|
||||
}
|
||||
Reference in New Issue
Block a user