diff --git a/hive-ag3nt/src/web_ui.rs b/hive-ag3nt/src/web_ui.rs index bca27a4..549e831 100644 --- a/hive-ag3nt/src/web_ui.rs +++ b/hive-ag3nt/src/web_ui.rs @@ -90,15 +90,17 @@ const LIVE_PANEL: &str = r#" "#; @@ -194,7 +203,13 @@ fn render_login_in_progress(session: &Arc) -> String { async fn events_stream( State(state): State, ) -> Sse>> { + tracing::info!("sse: client subscribed"); let rx = state.bus.subscribe(); + // Drop a "hello" note into the bus so every new subscriber sees at + // least one event immediately and can clear the connecting placeholder. + state + .bus + .emit(crate::events::LiveEvent::Note("live stream attached".into())); let stream = BroadcastStream::new(rx).filter_map(|res| { let ev = res.ok()?; let json = serde_json::to_string(&ev).ok()?;