Skip to content

Commit 6c433ae

Browse files
committed
fix(tui): polish background tasks empty state
1 parent 7954d02 commit 6c433ae

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

src/cortex-tui/src/views/tasks.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ use ratatui::widgets::{Block, Borders, Cell, Clear, Paragraph, Row, Table};
99
use cortex_agents::background::{AgentStatus, RunningAgentInfo};
1010
use cortex_common::{format_duration, truncate_first_line, truncate_id_default};
1111

12+
const EMPTY_TASKS_MESSAGE: &str =
13+
"No background tasks are running.\n\nPress Ctrl+B to run the current prompt in background.";
14+
1215
/// View for displaying background tasks/agents.
1316
pub struct TasksView {
1417
/// List of agents to display.
@@ -95,7 +98,7 @@ impl TasksView {
9598

9699
if self.agents.is_empty() {
97100
// Show empty state
98-
let empty_text = Paragraph::new("No background tasks running.\n\nPress Ctrl+B to run the current prompt in background.")
101+
let empty_text = Paragraph::new(EMPTY_TASKS_MESSAGE)
99102
.style(Style::default().fg(Color::DarkGray))
100103
.alignment(Alignment::Center);
101104

@@ -227,6 +230,11 @@ mod tests {
227230
assert_eq!(view.agent_count(), 0);
228231
}
229232

233+
#[test]
234+
fn test_empty_tasks_message_is_grammatical() {
235+
assert!(EMPTY_TASKS_MESSAGE.starts_with("No background tasks are running."));
236+
}
237+
230238
#[test]
231239
fn test_tasks_view_set_agents() {
232240
let mut view = TasksView::new();

0 commit comments

Comments
 (0)