From 32d2fdc55fa14b989a3742ff54f1f3374c0b7a1f Mon Sep 17 00:00:00 2001 From: James Magahern Date: Mon, 15 Jun 2026 01:29:09 -0700 Subject: [PATCH] kptui: update for new events --- core/kptui/src/main.rs | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/core/kptui/src/main.rs b/core/kptui/src/main.rs index 783818b..64e411d 100644 --- a/core/kptui/src/main.rs +++ b/core/kptui/src/main.rs @@ -394,12 +394,38 @@ fn run_app( app.refresh_messages_in_flight = true; } } - daemon::Event::MarkedRead => {} + daemon::Event::MarkedRead + | daemon::Event::ConversationListSyncTriggered + | daemon::Event::AllConversationsSyncTriggered + | daemon::Event::AttachmentDownloadQueued { .. } + | daemon::Event::AttachmentUploadQueued { .. } + | daemon::Event::AttachmentUploaded { .. } + | daemon::Event::AttachmentInfo { .. } + | daemon::Event::SettingsLoaded(_) + | daemon::Event::SettingsSaved => {} daemon::Event::ConversationSyncTriggered { conversation_id } => { if app.active_conversation_id.as_deref() == Some(conversation_id.as_str()) { app.status = "Syncing…".to_string(); } } + daemon::Event::AttachmentDownloaded { .. } => { + if let Some(cid) = app.active_conversation_id.clone() { + if !app.refresh_messages_in_flight { + request_tx + .send(daemon::Request::RefreshMessages { + conversation_id: cid, + }) + .ok(); + app.refresh_messages_in_flight = true; + } + } + } + daemon::Event::AttachmentDownloadFailed { + attachment_guid, + error, + } => { + app.status = format!("Attachment {attachment_guid} failed: {error}"); + } daemon::Event::ConversationsUpdated => { if !app.refresh_conversations_in_flight { request_tx.send(daemon::Request::RefreshConversations).ok();