diff --git a/src-tauri/src/commands.rs b/src-tauri/src/commands.rs index 01f1884..400844b 100644 --- a/src-tauri/src/commands.rs +++ b/src-tauri/src/commands.rs @@ -1497,18 +1497,30 @@ pub async fn generate_summary( Ok(()) } -/// Persist reviewed/edited action items as confirmed tasks (T5.6, FR-LLM-3). +/// Persist reviewed/edited action items as confirmed tasks (T5.6, FR-LLM-3), +/// then schedule or cancel each one's local reminder to match (Phase 8, +/// T8.6, FR-CAL-5). #[tauri::command] pub async fn confirm_action_items( state: State<'_, AppState>, meeting_id: MeetingId, items: Vec, ) -> WaResult<()> { - state + let saved = state .store .save_action_items(&meeting_id, &items) .await - .map_err(|e| WaError::new("storage", e.to_string())) + .map_err(|e| WaError::new("storage", e.to_string()))?; + for item in &saved { + let Some(id) = &item.id else { continue }; + match (item.reminder_set, item.due_at) { + (true, Some(due_at)) => { + crate::reminders::schedule(id, &item.text, item.owner.as_deref(), due_at) + } + _ => crate::reminders::cancel(id), + } + } + Ok(()) } // ---- Calendar / .pst (Phase 6) ----