Skip to content

Commit 18fbc43

Browse files
Restore user query history highlighting
Port the 0.130.x UserHistoryCell framing back onto the post-merge history-cell split so resumed and rewind-visible user prompts keep the highlighted User › label and divider rows. Focused verification: cargo test -p codex-tui user_history_cell. Co-authored-by: Open Codex <hff582580@gmail.com>
1 parent 8451384 commit 18fbc43

6 files changed

Lines changed: 45 additions & 16 deletions

FEATURES.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Open Codex Feature Inventory
22

3-
Last updated: 2026-05-19
3+
Last updated: 2026-05-21
44

55
This file tracks fork-specific features and fixes that should remain visible during README, release-note, and roadmap updates. It is an engineering inventory, not a marketing page. Keep it scoped to behavior implemented in this fork.
66

@@ -96,6 +96,7 @@ Fast-moving prompt packs, hooks, setup flows, and project policies are better ha
9696
- Preserve Open Codex fork behavior across the merge, including memory overlay/browser, rewind/revoke UX, persistent `Shift+Tab` speed toggle, `/btw`, `/effort`, subagent tracking, and git attribution.
9797
- Reconcile upstream ThreadSettings, `Op::UserInput`, MCP runtime environment, permission profile, rate-limit, status-surface, and package-layout changes with fork-specific runtime state.
9898
- Keep stale-turn output guards, foreground/background task state, and fork-correct package/update identity intact after the upstream merge.
99+
- Restore the 0.130.x user-query history highlighting with visible divider rows and the cyan `User ›` label after the upstream history-cell split.
99100
- Restore the Rust workspace release version so built binaries report `0.131.3` instead of upstream source-build `0.0.0`.
100101

101102
### 0.131.2 - 2026-05-20

codex-rs/tui/src/history_cell/messages.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,10 @@ fn trim_trailing_blank_lines(mut lines: Vec<Line<'static>>) -> Vec<Line<'static>
9191
lines
9292
}
9393

94+
fn user_message_divider_line(width: u16, style: Style) -> Line<'static> {
95+
Line::from("─".repeat(usize::from(width))).style(style)
96+
}
97+
9498
impl HistoryCell for UserHistoryCell {
9599
fn display_lines(&self, width: u16) -> Vec<Line<'static>> {
96100
let wrap_width = width
@@ -151,7 +155,7 @@ impl HistoryCell for UserHistoryCell {
151155
return Vec::new();
152156
}
153157

154-
let mut lines: Vec<Line<'static>> = vec![Line::from("").style(style)];
158+
let mut lines: Vec<Line<'static>> = vec![user_message_divider_line(width, style)];
155159

156160
if let Some(wrapped_remote_images) = wrapped_remote_images {
157161
lines.extend(prefix_lines(
@@ -167,12 +171,12 @@ impl HistoryCell for UserHistoryCell {
167171
if let Some(wrapped_message) = wrapped_message {
168172
lines.extend(prefix_lines(
169173
wrapped_message,
170-
"› ".bold().dim(),
171-
" ".into(),
174+
"User › ".bold().cyan(),
175+
" ".into(),
172176
));
173177
}
174178

175-
lines.push(Line::from("").style(style));
179+
lines.push(user_message_divider_line(width, style));
176180
lines
177181
}
178182

Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
---
22
source: tui/src/history_cell/tests.rs
3+
assertion_line: 1954
34
expression: rendered
45
---
5-
6+
────────────────────────────────────────────────────────────────────────────────
67
[Image #1]
78
[Image #2]
89

9-
describe both
10+
Userdescribe both
11+
────────────────────────────────────────────────────────────────────────────────
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
---
22
source: tui/src/history_cell/tests.rs
3+
assertion_line: 1920
34
expression: rendered
45
---
5-
6+
────────────────────────────────────────────────────────────────────────────────
67
[Image #1]
78

8-
describe these
9+
Userdescribe these
10+
────────────────────────────────────────────────────────────────────────────────
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
---
22
source: tui/src/history_cell/tests.rs
3+
assertion_line: 1886
34
expression: rendered
45
---
5-
6-
one two
7-
three
8-
four five
9-
six seven
6+
────────────
7+
Userone two
8+
three
9+
four five
10+
six seven
11+
────────────

codex-rs/tui/src/history_cell/tests.rs

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1886,6 +1886,24 @@ fn user_history_cell_wraps_and_prefixes_each_line_snapshot() {
18861886
insta::assert_snapshot!(rendered);
18871887
}
18881888

1889+
#[test]
1890+
fn user_history_cell_uses_highlighted_user_label_and_dividers() {
1891+
let cell = UserHistoryCell {
1892+
message: "hello".to_string(),
1893+
text_elements: Vec::new(),
1894+
local_image_paths: Vec::new(),
1895+
remote_image_urls: Vec::new(),
1896+
};
1897+
1898+
let width: u16 = 12;
1899+
let rendered = render_lines(&cell.display_lines(width));
1900+
let divider = "─".repeat(usize::from(width));
1901+
1902+
assert_eq!(rendered.first(), Some(&divider));
1903+
assert_eq!(rendered.get(1).map(String::as_str), Some("User › hello"));
1904+
assert_eq!(rendered.last(), Some(&divider));
1905+
}
1906+
18891907
#[test]
18901908
fn user_history_cell_renders_remote_image_urls() {
18911909
let cell = UserHistoryCell {
@@ -1973,7 +1991,7 @@ fn user_history_cell_trims_trailing_blank_message_lines() {
19731991
.rev()
19741992
.take_while(|line| line.trim().is_empty())
19751993
.count();
1976-
assert_eq!(trailing_blank_count, 1);
1994+
assert_eq!(trailing_blank_count, 0);
19771995
assert!(rendered.iter().any(|line| line.contains("line one")));
19781996
}
19791997

@@ -1996,7 +2014,7 @@ fn user_history_cell_trims_trailing_blank_message_lines_with_text_elements() {
19962014
.rev()
19972015
.take_while(|line| line.trim().is_empty())
19982016
.count();
1999-
assert_eq!(trailing_blank_count, 1);
2017+
assert_eq!(trailing_blank_count, 0);
20002018
assert!(rendered.iter().any(|line| line.contains("tokenized")));
20012019
}
20022020

0 commit comments

Comments
 (0)