Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion codex-rs/tui/src/streaming/render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ impl StreamingRender {
return;
}

if inline_visualization_context.is_some() || raw_source.contains(DIRECTIVE_PREFIX) {
if raw_source.contains(DIRECTIVE_PREFIX) {
self.recompute(
raw_source,
width,
Expand Down
34 changes: 34 additions & 0 deletions codex-rs/tui/src/streaming/render_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,40 @@ fn incremental_raw_render_preserves_blank_lines() {
);
}

#[test]
fn inline_visualization_context_without_directives_keeps_stable_prefix() {
let cwd = test_cwd();
let context = InlineVisualizationContext::new(&cwd, ThreadId::new())
.expect("UUIDv7 thread id should provide a timestamp");
let width = Some(80);
let mut source = String::new();
let mut render = StreamingRender::new();

for chunk in ["First paragraph.\n\n", "Second paragraph.\n\n"] {
source.push_str(chunk);
render.append(
&source,
chunk,
width,
&cwd,
HistoryRenderMode::Rich,
Some(&context),
);
assert_eq!(
render.lines,
render_source(
&source,
width,
&cwd,
HistoryRenderMode::Rich,
Some(&context),
),
);
}

assert!(render.stable_source_len > 0);
}

#[test]
fn inline_visualizations_use_canonical_full_render() {
let cwd = test_cwd();
Expand Down
Loading