Skip to content

armgit / codex

Public Imported from GitHub
0

Lightweight coding agent that runs in your terminal

Rust

Show loading state when @ search results are pending (#3061)

Jeremy Rose3baccba0ac20
diff --git a/codex-rs/tui/src/bottom_pane/command_popup.rs b/codex-rs/tui/src/bottom_pane/command_popup.rs
index 4a0f3c13ff..a5961e3188 100644
--- a/codex-rs/tui/src/bottom_pane/command_popup.rs
+++ b/codex-rs/tui/src/bottom_pane/command_popup.rs
@@ -195,7 +195,15 @@ impl WidgetRef for CommandPopup {
})
.collect()
};
- render_rows(area, buf, &rows_all, &self.state, MAX_POPUP_ROWS, false);
+ render_rows(
+ area,
+ buf,
+ &rows_all,
+ &self.state,
+ MAX_POPUP_ROWS,
+ false,
+ "no matches",
+ );
}
}
diff --git a/codex-rs/tui/src/bottom_pane/file_search_popup.rs b/codex-rs/tui/src/bottom_pane/file_search_popup.rs
index f046a2f144..65dfe6933b 100644
--- a/codex-rs/tui/src/bottom_pane/file_search_popup.rs
+++ b/codex-rs/tui/src/bottom_pane/file_search_popup.rs
@@ -132,11 +132,20 @@ impl WidgetRef for &FileSearchPopup {
.collect()
};
- if self.waiting && rows_all.is_empty() {
- // Render a minimal waiting stub using the shared renderer (no rows -> "no matches").
- render_rows(area, buf, &[], &self.state, MAX_POPUP_ROWS, false);
+ let empty_message = if self.waiting {
+ "loading..."
} else {
- render_rows(area, buf, &rows_all, &self.state, MAX_POPUP_ROWS, false);
- }
+ "no matches"
+ };
+
+ render_rows(
+ area,
+ buf,
+ &rows_all,
+ &self.state,
+ MAX_POPUP_ROWS,
+ false,
+ empty_message,
+ );
}
}
diff --git a/codex-rs/tui/src/bottom_pane/list_selection_view.rs b/codex-rs/tui/src/bottom_pane/list_selection_view.rs
index 6760b67ff7..357639693b 100644
--- a/codex-rs/tui/src/bottom_pane/list_selection_view.rs
+++ b/codex-rs/tui/src/bottom_pane/list_selection_view.rs
@@ -222,7 +222,15 @@ impl BottomPaneView for ListSelectionView {
})
.collect();
if rows_area.height > 0 {
- render_rows(rows_area, buf, &rows, &self.state, MAX_POPUP_ROWS, true);
+ render_rows(
+ rows_area,
+ buf,
+ &rows,
+ &self.state,
+ MAX_POPUP_ROWS,
+ true,
+ "no matches",
+ );
}
if let Some(hint) = &self.footer_hint {
diff --git a/codex-rs/tui/src/bottom_pane/selection_popup_common.rs b/codex-rs/tui/src/bottom_pane/selection_popup_common.rs
index c5de95104a..3852d10bc1 100644
--- a/codex-rs/tui/src/bottom_pane/selection_popup_common.rs
+++ b/codex-rs/tui/src/bottom_pane/selection_popup_common.rs
@@ -36,11 +36,12 @@ pub(crate) fn render_rows(
state: &ScrollState,
max_results: usize,
_dim_non_selected: bool,
+ empty_message: &str,
) {
let mut rows: Vec<Row> = Vec::new();
if rows_all.is_empty() {
rows.push(Row::new(vec![Cell::from(Line::from(
- "no matches".dim().italic(),
+ empty_message.dim().italic(),
))]));
} else {
let max_rows_from_area = area.height as usize;