feat: Add streaming pipe support for async loading in.

This commit is contained in:
2026-03-15 01:33:38 -04:00
parent 3b574e89ab
commit e77ecb447e
8 changed files with 271 additions and 31 deletions

View File

@@ -374,7 +374,10 @@ fn render_menu(
),
Span::raw(filter_text),
Span::styled(
format!(" {filtered_count}/{total_count}"),
format!(
" {filtered_count}/{total_count}{}",
if vs.streaming { "..." } else { "" }
),
Style::default().fg(Color::DarkGray),
),
];
@@ -691,6 +694,7 @@ mod tests {
mode: Mode::Insert,
selection_count: 0,
multi_enabled: false,
streaming: false,
columns: None,
generation: 1,
}
@@ -1166,6 +1170,7 @@ mod tests {
mode: Mode::Insert,
selection_count: 0,
multi_enabled: false,
streaming: false,
columns: None,
generation: 1,
};
@@ -1175,6 +1180,29 @@ mod tests {
assert!(prompt.contains("0/0"));
}
#[test]
fn streaming_indicator_shows_ellipsis() {
let mut vs = sample_view_state();
vs.streaming = true;
let backend = render_to_backend(40, 5, &vs, "");
let prompt = line_text(&backend, 0);
assert!(
prompt.contains("..."),
"streaming indicator should show '...': {prompt}"
);
}
#[test]
fn no_streaming_indicator_when_done() {
let vs = sample_view_state();
let backend = render_to_backend(40, 5, &vs, "");
let prompt = line_text(&backend, 0);
assert!(
!prompt.contains("..."),
"should not show '...' when not streaming: {prompt}"
);
}
#[test]
fn narrow_viewport_truncates() {
let vs = sample_view_state();
@@ -1269,6 +1297,7 @@ mod tests {
mode: Mode::Insert,
selection_count: 0,
multi_enabled: false,
streaming: false,
columns: Some(vec![
ColumnHeader {
display_name: "name".into(),