From a3f305f3916280f7311ae003a686476d6965f7c2 Mon Sep 17 00:00:00 2001 From: Felipe Coury Date: Sat, 30 May 2026 17:01:42 -0300 Subject: [PATCH] test(tui): preserve normalized handoff box width --- .../src/chatwidget/tests/status_and_layout.rs | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/codex-rs/tui/src/chatwidget/tests/status_and_layout.rs b/codex-rs/tui/src/chatwidget/tests/status_and_layout.rs index 8241e798f2..6383aa6ace 100644 --- a/codex-rs/tui/src/chatwidget/tests/status_and_layout.rs +++ b/codex-rs/tui/src/chatwidget/tests/status_and_layout.rs @@ -1648,7 +1648,25 @@ async fn startup_header_handoff_visible_states_snapshot() { Ok(AppEvent::InsertHistoryCell(cell)) if cell.as_any().is::() => { - break normalize_snapshot_paths(lines_to_single_string(&cell.display_lines(width))); + let rendered = lines_to_single_string(&cell.display_lines(width)); + let normalized = normalize_snapshot_paths(&rendered); + // Keep box alignment after shortening Windows test paths. + break normalized + .lines() + .zip(rendered.lines()) + .map(|(normalized, rendered)| { + let padding = rendered + .chars() + .count() + .saturating_sub(normalized.chars().count()); + if let Some(content) = normalized.strip_suffix('│') { + format!("{content}{}│", " ".repeat(padding)) + } else { + normalized.to_string() + } + }) + .collect::>() + .join("\n"); } Ok(_) => continue, other => panic!("expected queued configured header, got {other:?}"),