mirror of
https://github.com/openai/codex.git
synced 2026-11-18 23:02:23 +00:00
Show full patches and terminal input in TUI history (#42107)
## What changed - Render complete patch contents directly in TUI history cells. - Render all input sent to background terminals inline. - Remove the preview row and byte limits and their transcript hints so inline and transcript views contain the same content. ## Testing Update snapshots to cover patches and terminal input longer than the former 12-row preview limit. GitOrigin-RevId: 9960818a9b51fc0c7f84d9def77b9b1bd8acad6c
This commit is contained in:
1 parent
f40e08478c
commit
6a479e1813
7 files changed
+77
-708
No files matched your search
@@ -1628,7 +1628,7 @@ async fn apply_patch_events_emit_history_cells() {
|
||||
changes.insert(
|
||||
PathBuf::from("foo.txt"),
|
||||
FileChange::Add {
|
||||
content: "hello\n".to_string(),
|
||||
content: (1..=16).map(|line| format!("line {line}\n")).collect(),
|
||||
},
|
||||
);
|
||||
let ev = ApplyPatchApprovalRequestEvent {
|
||||
@@ -1649,24 +1649,39 @@ async fn apply_patch_events_emit_history_cells() {
|
||||
changes2.insert(
|
||||
PathBuf::from("foo.txt"),
|
||||
FileChange::Add {
|
||||
content: "hello\n".to_string(),
|
||||
content: (1..=16).map(|line| format!("line {line}\n")).collect(),
|
||||
},
|
||||
);
|
||||
handle_patch_apply_begin(&mut chat, "c1", "turn-c1", changes2);
|
||||
let cells = drain_insert_history(&mut rx);
|
||||
assert!(!cells.is_empty(), "expected apply block cell to be sent");
|
||||
let blob = lines_to_single_string(cells.last().unwrap());
|
||||
assert!(
|
||||
blob.contains("Added foo.txt") || blob.contains("Edited foo.txt"),
|
||||
"expected single-file header with filename (Added/Edited): {blob:?}"
|
||||
);
|
||||
insta::assert_snapshot!(blob, @"
|
||||
• Added foo.txt (+16 -0)
|
||||
1 +line 1
|
||||
2 +line 2
|
||||
3 +line 3
|
||||
4 +line 4
|
||||
5 +line 5
|
||||
6 +line 6
|
||||
7 +line 7
|
||||
8 +line 8
|
||||
9 +line 9
|
||||
10 +line 10
|
||||
11 +line 11
|
||||
12 +line 12
|
||||
13 +line 13
|
||||
14 +line 14
|
||||
15 +line 15
|
||||
16 +line 16
|
||||
");
|
||||
|
||||
// 3) End apply success -> success cell
|
||||
let mut end_changes = HashMap::new();
|
||||
end_changes.insert(
|
||||
PathBuf::from("foo.txt"),
|
||||
FileChange::Add {
|
||||
content: "hello\n".to_string(),
|
||||
content: (1..=16).map(|line| format!("line {line}\n")).collect(),
|
||||
},
|
||||
);
|
||||
handle_patch_apply_end(
|
||||
|
||||
Reference in new issue
Block a user