docs: update progress.md — Phase 1.5 relay fix and Phase 2.5 bug fixes complete

This commit is contained in:
Butterfly Dev 2026-04-07 04:04:38 +00:00
parent dd70696b13
commit cbc02d444b

View File

@ -18,27 +18,49 @@ A remote desktop environment with a Rust (Actix) backend and Angular 21 frontend
- [x] `server/Cargo.toml` — Dependencies: actix-web 4, actix-ws 0.4, actix-cors, dashmap, parking_lot, serde, uuid, chrono - [x] `server/Cargo.toml` — Dependencies: actix-web 4, actix-ws 0.4, actix-cors, dashmap, parking_lot, serde, uuid, chrono
- [x] `server/src/main.rs` — Actix HTTP server with CORS, compression, static file serving, SPA fallback - [x] `server/src/main.rs` — Actix HTTP server with CORS, compression, static file serving, SPA fallback
- [x] `server/src/config.rs` — Env-based config (BUTTERFLY_HOST, BUTTERFLY_PORT, etc.) - [x] `server/src/config.rs` — Env-based config (BUTTERFLY_HOST, BUTTERFLY_PORT, etc.)
- [x] `server/src/models.rs` — Session, AgentConnection, WsMessage enum (serde-tagged), ApiResponse, HealthInfo - [x] `server/src/models.rs` — Session, AgentConnection, WsMessage enum (serde-tagged), ApiResponse, HealthInfo (with connected_viewers)
- [x] `server/src/state.rs` — AppState with DashMap sessions/agents, FrameBuffer ring buffer for late-joiners - [x] `server/src/state.rs` — AppState with DashMap sessions/agents/viewers/agent_channels, FrameBuffer ring buffer, broadcast/forward methods
- [x] `server/src/api/` — REST endpoints: GET/POST/DELETE /api/sessions, GET /api/health, POST /api/sessions/{id}/hud - [x] `server/src/api/` — REST endpoints: GET/POST/DELETE /api/sessions, GET /api/health, POST /api/sessions/{id}/hud (wired to agent channel)
- [x] `server/src/ws/` — WebSocket handler: agent/viewer connect, display/audio frame relay, HUD forwarding, heartbeat timeout - [x] `server/src/ws/` — WebSocket handler: agent/viewer connect, per-instance mpsc channels, real bidirectional relay, viewer catch-up, heartbeat timeout
- [x] `server/src/stream/` — StreamStats tracker (frame count, byte relay, uptime) - [x] `server/src/stream/` — StreamStats tracker (frame count, byte relay, uptime)
- [x] `server/static/index.html` — Placeholder loading page - [x] `server/static/index.html` — Placeholder loading page
- [x] `cargo build` succeeds, `cargo check` clean (only dead_code warnings for future-use types) - [x] `cargo build` succeeds
### Phase 1.5: Backend Relay Fix ✅
- [x] Replaced stub `broadcast_to_viewers()` with real mpsc channel-based broadcast to all connected viewers
- [x] Replaced stub `forward_to_agent()` with real mpsc channel send to agent WS task
- [x] Added viewer registry (DashMap<String, Vec<ViewerEntry>>) per session
- [x] Added agent channel registry (DashMap<String, Mutex<Sender>>) per session
- [x] New viewers receive the latest buffered frame immediately on connect
- [x] HUD command REST endpoint now forwards through agent channel
- [x] Refactored WS handler to use `tokio::select!` for multiplexed read/write with resettable idle timeout
- [x] Fixed `stats()` to count only active sessions (not all sessions)
- [x] Added `connected_viewers` to HealthInfo
- [x] Removed unused dependencies (rand, tokio-stream)
### Phase 2: Angular 21 Frontend ✅ (builds & serves) ### Phase 2: Angular 21 Frontend ✅ (builds & serves)
- [x] Project scaffold with Angular CLI 21 - [x] Project scaffold with Angular CLI 21
- [x] Windows-like desktop shell (taskbar, start menu, window manager) - [x] Windows-like desktop shell (taskbar, start menu, window manager)
- [x] Remote display component (WebSocket canvas frame rendering, FPS counter) - [x] Remote display component (per-instance WebSocket, canvas frame rendering, FPS counter)
- [x] HUD overlay (mouse click/move/wheel, keyboard down/up forwarding) - [x] HUD overlay (mouse click/move/wheel, keyboard down/up forwarding)
- [x] Window Manager service (open, close, focus, minimize, maximize, drag, resize) - [x] Window Manager service (open, close, focus, minimize, maximize, drag, resize)
- [x] WebSocket service (typed message streams, heartbeat, auto-reconnect) - [x] WebSocket service (typed message streams, heartbeat)
- [x] API service (health, sessions CRUD, HUD command forwarding) - [x] API service (health, sessions CRUD, HUD command forwarding)
- [x] Built-in apps: File Explorer, Terminal, Text Editor, Settings, Web Browser - [x] Built-in apps: File Explorer, Terminal, Text Editor, Settings, Web Browser
- [x] Session picker dialog (create/connect to remote sessions) - [x] Session picker dialog (create/connect to remote sessions)
- [x] Production build: 328KB total (85KB gzipped), output to `dist/browser/` - [x] Production build: 322KB total (84KB gzipped), output to `dist/browser/`
- [x] Dark theme with animated gradient desktop background - [x] Dark theme with animated gradient desktop background
### Phase 2.5: Frontend Bug Fixes ✅
- [x] Taskbar clock now updates every second (was static computed signal)
- [x] Terminal auto-scrolls on output (added AfterViewChecked hook)
- [x] Remote display uses per-instance WebSocket (was shared singleton — broke multi-session)
- [x] Remote display canvas resizes with container via ResizeObserver
- [x] Browser iframe uses DomSanitizer for safe URL binding
- [x] Browser refresh uses key-based reload instead of URL hack
- [x] Removed unused imports (RouterModule, ViewChild, etc.)
- [x] HealthInfo interface updated with connected_viewers
### Phase 3: VM Agent Executable 🔲 (next) ### Phase 3: VM Agent Executable 🔲 (next)
- [ ] Rust desktop agent that captures display and audio - [ ] Rust desktop agent that captures display and audio
- [ ] Streams display frames (JPEG/PNG) and audio (Opus/PCM) via WebSocket - [ ] Streams display frames (JPEG/PNG) and audio (Opus/PCM) via WebSocket
@ -48,26 +70,25 @@ A remote desktop environment with a Rust (Actix) backend and Angular 21 frontend
### Phase 4: Integration & Polish 🔲 ### Phase 4: Integration & Polish 🔲
- [ ] End-to-end testing (agent → server → browser) - [ ] End-to-end testing (agent → server → browser)
- [ ] Session management UI - [ ] Session management UI
- [ ] Multi-session support - [ ] Multi-session support (frontend done, backend ready)
- [ ] Authentication (JWT) - [ ] Authentication (JWT)
- [ ] Performance optimization - [ ] Performance optimization
- [ ] Audio playback (frontend plumbing exists, needs Web Audio integration)
- [ ] Start menu search filtering
- [ ] Window snap/edge-docking
## Recent Commits ## Recent Commits
- `dd70696` api: add connected_viewers to HealthInfo interface
- `fb2323f` fix: remove signal type annotation for safeUrl (TS2749)
- `6f07a1b` fix: move sanitizer call to constructor (was used before init)
- `cecca9f` fix: browser uses DomSanitizer for iframe, key-based reload
- `ef1b8df` fix: remote display now uses per-instance WebSocket
- `b7d6c95` fix: terminal now auto-scrolls on output
- `f3da41d` fix: taskbar clock now updates every second
- `d096d20` cleanup: remove unused currentTime computed, RouterModule
- `5ea4cdf` cargo: remove unused rand and tokio-stream dependencies
- `4bc5e09` api: wire up real agent channel for HUD commands
- `2344060` ws/handler: implement real bidirectional relay
- `29eda76` state: add viewer/agent channel registries
- `dcfaceb` desktop: production build works (328KB, 85KB gzip) - `dcfaceb` desktop: production build works (328KB, 85KB gzip)
- `f4b7e25` desktop: fix build errors (FormsModule, nativeWindow, provideHttpClient)
- `8a9429c` desktop: components/desktop — main shell
- `eea8197` desktop: components/apps/browser
- `6beb93b` desktop: components/apps/settings
- `0048eab` desktop: components/apps/file-explorer
- `283e53d` desktop: components/apps/text-editor
- `7496fbe` desktop: components/apps/terminal
- `6b4c641` desktop: components/remote-display
- `8ad129e` desktop: components/start-menu
- `490317b` desktop: components/taskbar
- `b5e23e1` desktop: components/window
- `9d8aaa5` desktop: services/window-manager.service
- `4041625` desktop: services/api.service
- `710560d` desktop: services/websocket.service
- `7991237` desktop: app root component
- `2b05373` desktop: scaffold Angular 21 project
- `bae17ae` server: fix pong bytes — backend compiles - `bae17ae` server: fix pong bytes — backend compiles