Bold tool names in compact mode output

Switch compact tool display to use bold ANSI colors (TOOL_COLOR_*_BOLD)
for tool names, matching the non-compact tool header style.

Affected: print_tool_compact, print_todo_compact, print_plan_compact,
and the streaming hint indicator (ParsingHintState::handle_hint).

Remove now-unused non-bold constants TOOL_COLOR_NORMAL and TOOL_COLOR_AGENT.
This commit is contained in:
Dhanji R. Prasanna
2026-02-18 20:40:28 +11:00
parent 78f846e3c4
commit f074d2c1f4

View File

@@ -34,9 +34,7 @@ fn colorize_str_replace_summary(summary: &str) -> String {
} }
/// ANSI color codes for tool names /// ANSI color codes for tool names
const TOOL_COLOR_NORMAL: &str = "\x1b[32m";
const TOOL_COLOR_NORMAL_BOLD: &str = "\x1b[1;32m"; const TOOL_COLOR_NORMAL_BOLD: &str = "\x1b[1;32m";
const TOOL_COLOR_AGENT: &str = "\x1b[38;5;250m";
const TOOL_COLOR_AGENT_BOLD: &str = "\x1b[1;38;5;250m"; const TOOL_COLOR_AGENT_BOLD: &str = "\x1b[1;38;5;250m";
/// Blink state values for the streaming indicator /// Blink state values for the streaming indicator
@@ -96,9 +94,9 @@ impl ParsingHintState {
// Get color based on agent mode // Get color based on agent mode
let tool_color = if self.is_agent_mode.load(Ordering::Relaxed) { let tool_color = if self.is_agent_mode.load(Ordering::Relaxed) {
TOOL_COLOR_AGENT TOOL_COLOR_AGENT_BOLD
} else { } else {
TOOL_COLOR_NORMAL TOOL_COLOR_NORMAL_BOLD
}; };
// Print the indicator: " ● tool_name |" // Print the indicator: " ● tool_name |"
@@ -593,7 +591,7 @@ impl UiWriter for ConsoleUiWriter {
}; };
// Color for tool name // Color for tool name
let tool_color = if is_agent_mode { TOOL_COLOR_AGENT } else { TOOL_COLOR_NORMAL }; let tool_color = if is_agent_mode { TOOL_COLOR_AGENT_BOLD } else { TOOL_COLOR_NORMAL_BOLD };
// Colorize summary for str_replace (green insertions, red deletions) // Colorize summary for str_replace (green insertions, red deletions)
let display_summary = if tool_name == "str_replace" { let display_summary = if tool_name == "str_replace" {
@@ -666,7 +664,7 @@ impl UiWriter for ConsoleUiWriter {
self.hint_state.handle_hint(ToolParsingHint::Complete); self.hint_state.handle_hint(ToolParsingHint::Complete);
let is_agent_mode = self.hint_state.is_agent_mode.load(Ordering::Relaxed); let is_agent_mode = self.hint_state.is_agent_mode.load(Ordering::Relaxed);
let tool_color = if is_agent_mode { TOOL_COLOR_AGENT } else { TOOL_COLOR_NORMAL }; let tool_color = if is_agent_mode { TOOL_COLOR_AGENT_BOLD } else { TOOL_COLOR_NORMAL_BOLD };
// Add blank line if last output was text (for visual separation) // Add blank line if last output was text (for visual separation)
if self.hint_state.last_output_was_text.load(Ordering::Relaxed) { if self.hint_state.last_output_was_text.load(Ordering::Relaxed) {
@@ -730,7 +728,7 @@ impl UiWriter for ConsoleUiWriter {
self.hint_state.handle_hint(ToolParsingHint::Complete); self.hint_state.handle_hint(ToolParsingHint::Complete);
let is_agent_mode = self.hint_state.is_agent_mode.load(Ordering::Relaxed); let is_agent_mode = self.hint_state.is_agent_mode.load(Ordering::Relaxed);
let tool_color = if is_agent_mode { TOOL_COLOR_AGENT } else { TOOL_COLOR_NORMAL }; let tool_color = if is_agent_mode { TOOL_COLOR_AGENT_BOLD } else { TOOL_COLOR_NORMAL_BOLD };
// Add blank line if last output was text (for visual separation) // Add blank line if last output was text (for visual separation)
if self.hint_state.last_output_was_text.load(Ordering::Relaxed) { if self.hint_state.last_output_was_text.load(Ordering::Relaxed) {