From 31dcae67dbb9f7941cf3a058ee050ad453cf42db Mon Sep 17 00:00:00 2001 From: aibrahim-oai Date: Tue, 5 Aug 2025 21:32:03 -0700 Subject: [PATCH] Remove Turndiff and Apply patch from the render (#1868) Make the tui more specific on what to render. Apply patch End and Turn diff needs special handling. Avoiding this issue: image --- codex-rs/tui/src/chatwidget.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/codex-rs/tui/src/chatwidget.rs b/codex-rs/tui/src/chatwidget.rs index 94bd2f12..7751404f 100644 --- a/codex-rs/tui/src/chatwidget.rs +++ b/codex-rs/tui/src/chatwidget.rs @@ -492,11 +492,13 @@ impl ChatWidget<'_> { EventMsg::ShutdownComplete => { self.app_event_tx.send(AppEvent::ExitRequest); } - event => { - let text = format!("{event:?}"); - self.add_to_history(HistoryCell::new_background_event(text.clone())); - self.update_latest_log(text); + EventMsg::BackgroundEvent(event) => { + let message = event.message; + self.add_to_history(HistoryCell::new_background_event(message.clone())); + self.update_latest_log(message); } + // TODO: Think of how are we going to render these events. + EventMsg::PatchApplyEnd(_) | EventMsg::TurnDiff(_) => {} } }