Skip to content

Commit c6b3af1

Browse files
committed
Revert "UX Fix for hard to distinguish between user and assistant responses (#130)"
This reverts commit e7ed28f.
1 parent fcb1092 commit c6b3af1

File tree

2 files changed

+9
-23
lines changed

2 files changed

+9
-23
lines changed

crates/chat-cli/src/cli/chat/mod.rs

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1399,9 +1399,10 @@ impl ChatContext {
13991399
self.send_tool_use_telemetry(telemetry).await;
14001400

14011401
if self.interactive {
1402-
// Print newlines before starting the assistant response
1403-
execute!(self.output, style::Print("\n\n"))?;
1402+
queue!(self.output, style::SetForegroundColor(Color::Magenta))?;
1403+
queue!(self.output, style::SetForegroundColor(Color::Reset))?;
14041404
queue!(self.output, cursor::Hide)?;
1405+
execute!(self.output, style::Print("\n"))?;
14051406
self.spinner = Some(Spinner::new(Spinners::Dots, "Thinking...".to_owned()));
14061407
}
14071408

@@ -3237,18 +3238,6 @@ impl ChatContext {
32373238
)?;
32383239
}
32393240

3240-
// Add assistant indicator at the beginning of the response
3241-
if self.interactive {
3242-
queue!(
3243-
self.output,
3244-
style::SetForegroundColor(Color::Yellow),
3245-
style::SetAttribute(Attribute::Bold),
3246-
style::Print("Amazon Q > "),
3247-
style::SetAttribute(Attribute::Reset),
3248-
style::SetForegroundColor(Color::Reset),
3249-
)?;
3250-
}
3251-
32523241
loop {
32533242
match parser.recv().await {
32543243
Ok(msg_event) => {

crates/chat-cli/src/cli/chat/prompt.rs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ pub fn generate_prompt(current_profile: Option<&str>, warning: bool) -> String {
8787
.map(|p| format!("[{p}] ").cyan().to_string())
8888
.unwrap_or_default();
8989

90-
format!("{profile_part}{warning_symbol}{}", "> ".cyan().bold())
90+
format!("{profile_part}{warning_symbol}{}", "> ".magenta())
9191
}
9292

9393
/// Complete commands that start with a slash
@@ -310,23 +310,20 @@ mod tests {
310310
#[test]
311311
fn test_generate_prompt() {
312312
// Test default prompt (no profile)
313-
assert_eq!(generate_prompt(None, false), "> ".cyan().bold().to_string());
313+
assert_eq!(generate_prompt(None, false), "> ".magenta().to_string());
314314
// Test default prompt with warning
315-
assert_eq!(
316-
generate_prompt(None, true),
317-
format!("{}{}", "!".red(), "> ".cyan().bold())
318-
);
315+
assert_eq!(generate_prompt(None, true), format!("{}{}", "!".red(), "> ".magenta()));
319316
// Test default profile (should be same as no profile)
320-
assert_eq!(generate_prompt(Some("default"), false), "> ".cyan().bold().to_string());
317+
assert_eq!(generate_prompt(Some("default"), false), "> ".magenta().to_string());
321318
// Test custom profile
322319
assert_eq!(
323320
generate_prompt(Some("test-profile"), false),
324-
format!("{}{}", "[test-profile] ".cyan(), "> ".cyan().bold())
321+
format!("{}{}", "[test-profile] ".cyan(), "> ".magenta())
325322
);
326323
// Test another custom profile with warning
327324
assert_eq!(
328325
generate_prompt(Some("dev"), true),
329-
format!("{}{}{}", "[dev] ".cyan(), "!".red(), "> ".cyan().bold())
326+
format!("{}{}{}", "[dev] ".cyan(), "!".red(), "> ".magenta())
330327
);
331328
}
332329

0 commit comments

Comments
 (0)