YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context
Rust agentsagiaiai-memoryaudio-recordingcomputer-visionhermeshermes-agentllmlocal-ailocal-firstmachine-learningmcpmultimodalopenclawprivacyrewindscreen-recordingspeech-to-textycombinator
fix(meeting): open live note from "join and take notes" + suppress silence-only stall
Louis Beaumont97c1107e6f81
diff --git a/apps/screenpipe-app-tauri/components/meeting-notes/index.tsx b/apps/screenpipe-app-tauri/components/meeting-notes/index.tsxindex 6aa105782..cd3cb9f30 100644--- a/apps/screenpipe-app-tauri/components/meeting-notes/index.tsx+++ b/apps/screenpipe-app-tauri/components/meeting-notes/index.tsx@@ -103,6 +103,13 @@ export function MeetingNotesSection({void fetchPage(0, false);}, [fetchPage]);+ // Track an in-flight open-meeting-note request so the "selection+ // vanished" effect below doesn't reset selectedId during the brief+ // window where the row hasn't been inserted into `meetings` yet.+ // The Rust side retries the emit 4× to survive cold window startup,+ // so this also dedupes the burst — same meeting within 5s is a no-op.+ const pendingOpenRef = useRef<{ id: number; at: number } | null>(null);+useEffect(() => {const unlisten = listen<{ meetingId: number; transcript?: boolean }>("open-meeting-note",@@ -110,11 +117,23 @@ export function MeetingNotesSection({const id = Number(event.payload.meetingId);if (!Number.isFinite(id)) return;- if (event.payload.transcript !== false) {- setOpenTranscriptRequest({ id, token: Date.now() });+ const now = Date.now();+ if (+ pendingOpenRef.current?.id === id &&+ now - pendingOpenRef.current.at < 5000+ ) {+ return;}-- setSelectedId(id);+ pendingOpenRef.current = { id, at: now };++ // Fetch and insert into `meetings` BEFORE selecting. The+ // "selection vanished" effect below resets selectedId to null+ // whenever the id isn't in the list — if we set selectedId first+ // and await the fetch after, that effect fires in the gap and+ // drops the selection, leaving the user on the list view instead+ // of the note. Notification-triggered opens (a freshly-started+ // meeting) hit this every time because the new row isn't in the+ // initial page yet.try {const res = await localFetch(`/meetings/${id}`);if (res.ok) {@@ -126,15 +145,20 @@ export function MeetingNotesSection({: [meeting, ...prev];});} else {- void fetchPage(0, false);+ await fetchPage(0, false);}} catch (err) {console.warn("meeting notes: failed to open deep-linked meeting",err,);- void fetchPage(0, false);+ await fetchPage(0, false);}++ if (event.payload.transcript !== false) {+ setOpenTranscriptRequest({ id, token: Date.now() });+ }+ setSelectedId(id);},);return () => {@@ -256,10 +280,19 @@ export function MeetingNotesSection({};}, []);- // If selection vanishes (deleted elsewhere), drop selection+ // If selection vanishes (deleted elsewhere), drop selection.+ // Skip while a notification-triggered open for this id is in flight —+ // the row hasn't been inserted yet, and resetting here strands the+ // user on the list view instead of the note they asked to open.useEffect(() => {if (selectedId === null) return;- if (meetings.some((m) => m.id === selectedId)) return;+ if (meetings.some((m) => m.id === selectedId)) {+ if (pendingOpenRef.current?.id === selectedId) {+ pendingOpenRef.current = null;+ }+ return;+ }+ if (pendingOpenRef.current?.id === selectedId) return;setSelectedId(null);}, [meetings, selectedId]);diff --git a/apps/screenpipe-app-tauri/src-tauri/src/meeting_live_notes.rs b/apps/screenpipe-app-tauri/src-tauri/src/meeting_live_notes.rsindex 95d8589d4..2724e0894 100644--- a/apps/screenpipe-app-tauri/src-tauri/src/meeting_live_notes.rs+++ b/apps/screenpipe-app-tauri/src-tauri/src/meeting_live_notes.rs@@ -172,7 +172,11 @@ pub fn start(app: AppHandle) {continue;}- let url = format!("screenpipe://meeting/{meeting_id}?live=0");+ // Default (no ?live=0) opens the transcript panel alongside the+ // note — this notification fires at meeting start and the user+ // clicked "join and take notes", so they want the live view, not+ // a static note pane.+ let url = format!("screenpipe://meeting/{meeting_id}");let mut calendar_match = {let events = calendar_events.read().await;find_calendar_match(&events, &event.data)diff --git a/crates/screenpipe-audio/src/meeting_streaming/controller.rs b/crates/screenpipe-audio/src/meeting_streaming/controller.rsindex 2dbeb1dbb..7c20b6332 100644--- a/crates/screenpipe-audio/src/meeting_streaming/controller.rs+++ b/crates/screenpipe-audio/src/meeting_streaming/controller.rs@@ -47,6 +47,12 @@ struct ActiveMeetingStream {audio_frames_seen: u64,audio_samples_seen: u64,last_audio_activity_at: Instant,+ // Latched true the first time a frame's RMS clears the voice-activity+ // threshold. Used to suppress the "transcript not flowing" notification+ // when the room is just silent (e.g. user alone waiting for others to+ // join) — no transcript is expected from silence, so warning the user is+ // a false positive.+ voiced_audio_seen: bool,live_transcript_seen: bool,last_live_transcript_at: Option<Instant>,notified_audio_stall: bool,@@ -207,6 +213,7 @@ pub fn start_meeting_streaming_loop(session.audio_samples_seen += frame.samples.len() as u64;if frame_has_audio_activity(&frame) {session.last_audio_activity_at = Instant::now();+ session.voiced_audio_seen = true;}if session.live_transcription_enabled {route_frame_to_provider(@@ -298,6 +305,7 @@ async fn start_streaming_session(audio_frames_seen: 0,audio_samples_seen: 0,last_audio_activity_at: Instant::now(),+ voiced_audio_seen: false,live_transcript_seen: false,last_live_transcript_at: None,notified_audio_stall: false,@@ -618,6 +626,7 @@ fn check_and_emit_stall_notifications(session: &mut ActiveMeetingStream, now: In);} else if !session.notified_transcript_stall&& session.audio_frames_seen > 0+ && session.voiced_audio_seen&& !session.live_transcript_seen{session.notified_transcript_stall = true;@@ -787,6 +796,7 @@ mod tests {audio_frames_seen: 0,audio_samples_seen: 0,last_audio_activity_at: now,+ voiced_audio_seen: false,live_transcript_seen: false,last_live_transcript_at: None,notified_audio_stall: false,@@ -825,6 +835,7 @@ mod tests {// is the field itself, not a flag we manage from outside).let mut session = test_session(now, true);session.audio_frames_seen = 42;+ session.voiced_audio_seen = true;check_and_emit_stall_notifications(&mut session, now + STALL_NOTIFY_THRESHOLD);assert!(!session.notified_audio_stall);assert!(session.notified_transcript_stall);@@ -833,6 +844,16 @@ mod tests {check_and_emit_stall_notifications(&mut session, now + STALL_NOTIFY_THRESHOLD * 5);assert!(session.notified_transcript_stall);+ // Frames flowing but only silence (no voiced audio) — do NOT fire+ // transcript stall. User is alone in the room waiting for others;+ // there is nothing to transcribe, so warning them is a false positive.+ let mut session = test_session(now, true);+ session.audio_frames_seen = 200;+ // voiced_audio_seen stays false+ check_and_emit_stall_notifications(&mut session, now + STALL_NOTIFY_THRESHOLD * 3);+ assert!(!session.notified_audio_stall);+ assert!(!session.notified_transcript_stall);+// Pure background sessions (no live transcription) never fire — their// audio tap is intentionally inactive so audio_frames_seen=0 is// expected.