Skip to content

Commit 8122390

Browse files
feat(tui): Add padding to task names and icons (#11104)
### Description Rework spacing now that #10726 gave us a full background highlight. ### Testing Instructions <img width="720" height="684" alt="CleanShot 2025-11-11 at 14 04 19@2x" src="https://github.com/user-attachments/assets/4ca48c2d-a219-4a1c-83ff-d2ce99e334d3" /> --------- Co-authored-by: Vercel <vercel[bot]@users.noreply.github.com> Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>
1 parent 47023f4 commit 8122390

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

crates/turborepo-ui/src/tui/table.rs

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,9 @@ impl<'b> TaskTable<'b> {
4444
.max()
4545
.unwrap_or_default()
4646
.clamp(min_width, 40) as u16;
47-
// Add space for status emoji and space
48-
task_name_width + 2
47+
// Add space for leading space, status emoji, trailing space, and space before
48+
// task name
49+
task_name_width + 4
4950
}
5051

5152
/// Update the current time of the table
@@ -83,23 +84,23 @@ impl<'b> TaskTable<'b> {
8384
} else {
8485
Style::default().green().bold()
8586
};
86-
Span::styled("✓ ", style)
87+
Span::styled(" ✓ ", style)
8788
}
8889
TaskResult::CacheHit => {
8990
let style = if self.should_dim_task(task.name()) {
9091
Style::default().magenta().add_modifier(Modifier::DIM)
9192
} else {
9293
Style::default().magenta()
9394
};
94-
Span::styled("⊙ ", style)
95+
Span::styled(" ⊙ ", style)
9596
}
9697
TaskResult::Failure => {
9798
let style = if self.should_dim_task(task.name()) {
9899
Style::default().red().add_modifier(Modifier::DIM)
99100
} else {
100101
Style::default().red().bold()
101102
};
102-
Span::styled("⨯ ", style)
103+
Span::styled(" ⨯ ", style)
103104
}
104105
};
105106

@@ -110,7 +111,7 @@ impl<'b> TaskTable<'b> {
110111
};
111112

112113
let mut content = vec![icon];
113-
content.push(Span::styled(task.name(), name_style));
114+
content.push(Span::styled(format!(" {}", task.name()), name_style));
114115

115116
Row::new(vec![Cell::new(Line::from(content))])
116117
})
@@ -121,8 +122,8 @@ impl<'b> TaskTable<'b> {
121122
self.tasks_by_type.running.iter().map(move |task| {
122123
let style = self.task_style(task.name());
123124
let content = vec![
124-
Span::styled(format!("{} ", spinner), style),
125-
Span::styled(task.name(), style),
125+
Span::styled(format!(" {} ", spinner), style),
126+
Span::styled(format!(" {}", task.name()), style),
126127
];
127128
Row::new(vec![Cell::new(Line::from(content))])
128129
})
@@ -131,7 +132,10 @@ impl<'b> TaskTable<'b> {
131132
fn planned_rows(&self) -> impl Iterator<Item = Row<'_>> + '_ {
132133
self.tasks_by_type.planned.iter().map(move |task| {
133134
let style = self.task_style(task.name());
134-
let content = vec![Span::raw(" "), Span::styled(task.name(), style)];
135+
let content = vec![
136+
Span::raw(" "),
137+
Span::styled(format!(" {}", task.name()), style),
138+
];
135139
Row::new(vec![Cell::new(Line::from(content))])
136140
})
137141
}
@@ -145,7 +149,7 @@ impl<'a> StatefulWidget for &'a TaskTable<'a> {
145149
self.running_rows()
146150
.chain(self.planned_rows())
147151
.chain(self.finished_rows()),
148-
[Constraint::Min(15)],
152+
[Constraint::Min(18)],
149153
)
150154
.highlight_style(Style::default().add_modifier(Modifier::REVERSED))
151155
.column_spacing(0)

0 commit comments

Comments
 (0)