From 4b0f19d6f983c63a09ee0763e49d81ba5554d1b8 Mon Sep 17 00:00:00 2001 From: Eric Traut Date: Thu, 17 Sep 2026 04:37:06 +0000 Subject: [PATCH] Make TUI web and image activity summaries compact and descriptive (#46116) ## What changed - Render web activity on one line with width-aware truncation and labels for searches, opened pages, and in-page searches. Preserve all batched queries in full details. - Show viewed images by filename in chat while retaining their original paths in expanded transcripts and raw output. Use these activity renderers for persisted transcripts and exports. - Display code-mode tool titles without the `Calling` or `Called` prefix and truncate headers to the available width while preserving full transcript titles and failure details. - Keep `Returned image` markers inside the originating MCP call, alongside result text, and use the same wording in transcript exports. ## Testing Add regression tests and snapshots for narrow displays, missing web action details, batched queries, image paths, MCP image results, matching live and replay rendering, and complete web and image details in persisted exports. GitOrigin-RevId: 5d3f0a0031818c985378ad3ee4b24084d3868c98 --- ...image_activity_preserves_full_details.snap | 17 +++ codex-rs/tui/src/app/transcript_export.rs | 2 +- .../tui/src/app/transcript_export_tests.rs | 27 ++++- ...ign_image_attachment_history_snapshot.snap | 4 +- ...cal_image_attachment_history_snapshot.snap | 5 +- codex-rs/tui/src/chatwidget/tests.rs | 2 + .../src/chatwidget/tests/history_replay.rs | 4 +- ..._and_replay_render_in_the_owning_call.snap | 7 ++ .../chatwidget/tests/tool_activity_tests.rs | 34 ++++++ codex-rs/tui/src/chatwidget/tool_lifecycle.rs | 13 +- .../tui/src/history_cell/computer_activity.rs | 4 +- codex-rs/tui/src/history_cell/mcp.rs | 97 +++++++++------ codex-rs/tui/src/history_cell/mcp_result.rs | 11 +- codex-rs/tui/src/history_cell/mcp_tests.rs | 80 +++++++++++-- codex-rs/tui/src/history_cell/mod.rs | 1 - codex-rs/tui/src/history_cell/patches.rs | 59 +++++++-- .../tui/src/history_cell/patches_tests.rs | 38 ++++++ codex-rs/tui/src/history_cell/search.rs | 113 +++++++++++------- codex-rs/tui/src/history_cell/search_tests.rs | 97 +++++++++++++++ ...ty__tests__computer_activity_expanded.snap | 2 +- ...eeps_error_and_full_title_when_narrow.snap | 7 ++ ...s__tests__viewed_image_narrow_summary.snap | 5 + ..._preserves_transcript_and_raw_details.snap | 5 + ...web_action_labels_and_missing_details.snap | 10 ++ ...ol_call_accepts_data_url_image_blocks.snap | 6 + ...p_tool_call_image_after_text_snapshot.snap | 7 ++ ...l_call_multiple_image_blocks_snapshot.snap | 7 ++ ...sts__web_search_history_cell_snapshot.snap | 5 +- codex-rs/tui/src/history_cell/tests.rs | 89 +++++--------- codex-rs/tui/src/thread_transcript.rs | 22 ++-- 30 files changed, 578 insertions(+), 202 deletions(-) create mode 100644 codex-rs/tui/src/app/snapshots/codex_tui__app__transcript_export__tests__persisted_web_and_image_activity_preserves_full_details.snap create mode 100644 codex-rs/tui/src/chatwidget/tests/snapshots/codex_tui__chatwidget__tests__tool_activity_tests__image_result_live_and_replay_render_in_the_owning_call.snap create mode 100644 codex-rs/tui/src/chatwidget/tests/tool_activity_tests.rs create mode 100644 codex-rs/tui/src/history_cell/patches_tests.rs create mode 100644 codex-rs/tui/src/history_cell/search_tests.rs create mode 100644 codex-rs/tui/src/history_cell/snapshots/codex_tui__history_cell__mcp__tests__titled_image_call_keeps_error_and_full_title_when_narrow.snap create mode 100644 codex-rs/tui/src/history_cell/snapshots/codex_tui__history_cell__patches__tests__viewed_image_narrow_summary.snap create mode 100644 codex-rs/tui/src/history_cell/snapshots/codex_tui__history_cell__search__tests__web_action_compact_display_preserves_transcript_and_raw_details.snap create mode 100644 codex-rs/tui/src/history_cell/snapshots/codex_tui__history_cell__search__tests__web_action_labels_and_missing_details.snap create mode 100644 codex-rs/tui/src/history_cell/snapshots/codex_tui__history_cell__tests__completed_mcp_tool_call_accepts_data_url_image_blocks.snap create mode 100644 codex-rs/tui/src/history_cell/snapshots/codex_tui__history_cell__tests__completed_mcp_tool_call_image_after_text_snapshot.snap create mode 100644 codex-rs/tui/src/history_cell/snapshots/codex_tui__history_cell__tests__completed_mcp_tool_call_multiple_image_blocks_snapshot.snap diff --git a/codex-rs/tui/src/app/snapshots/codex_tui__app__transcript_export__tests__persisted_web_and_image_activity_preserves_full_details.snap b/codex-rs/tui/src/app/snapshots/codex_tui__app__transcript_export__tests__persisted_web_and_image_activity_preserves_full_details.snap new file mode 100644 index 0000000000..b50b91c2db --- /dev/null +++ b/codex-rs/tui/src/app/snapshots/codex_tui__app__transcript_export__tests__persisted_web_and_image_activity_preserves_full_details.snap @@ -0,0 +1,17 @@ +--- +source: tui/src/app/transcript_export_tests.rs +expression: "render_markdown_transcript(&cells).expect(\"exported transcript\")" +--- +# Codex conversation + +## Activity + + Opened https://example.com/long/path?query=full#details + +## Activity + + Searched for 'needle' in https://example.com/long/path + +## Activity + + Viewed image C:\workspace\assets\screenshot.png diff --git a/codex-rs/tui/src/app/transcript_export.rs b/codex-rs/tui/src/app/transcript_export.rs index 67365721cc..06528e2036 100644 --- a/codex-rs/tui/src/app/transcript_export.rs +++ b/codex-rs/tui/src/app/transcript_export.rs @@ -162,7 +162,7 @@ fn export_activity_cell(item: &ThreadItem) -> Option { lines.extend(raw_lines_from_source(&text.text)); } Ok(rmcp::model::ContentBlock::Image(_)) => { - lines.push("".into()); + lines.push("Returned image".into()); } Ok(rmcp::model::ContentBlock::Audio(_)) => { lines.push("