Skip to content

Commit 52bed68

Browse files
committed
final copy
1 parent 9213904 commit 52bed68

File tree

2 files changed

+41
-30
lines changed

2 files changed

+41
-30
lines changed

crates/chat-cli/src/cli/chat/util/ui.rs

Lines changed: 38 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -27,42 +27,52 @@ pub fn draw_box(
2727

2828
// wrap the single line into multiple lines respecting inner width
2929
// Manually wrap the text by splitting at word boundaries, using visible length for styled text
30+
// First split by newlines to preserve explicit line breaks
3031
let mut wrapped_lines = Vec::new();
31-
let mut line = String::new();
3232

33-
for word in content.split_whitespace() {
34-
let test_line = if line.is_empty() {
35-
word.to_string()
36-
} else {
37-
format!("{} {}", line, word)
38-
};
33+
for paragraph in content.split('\n') {
34+
if paragraph.is_empty() {
35+
// Preserve empty lines
36+
wrapped_lines.push(String::new());
37+
continue;
38+
}
3939

40-
let visible_len = strip_str(&test_line).len();
41-
42-
if visible_len <= inner_width {
43-
line = test_line;
44-
} else {
45-
// Check if the word alone is too long
46-
let word_visible_len = strip_str(word).len();
47-
if word_visible_len >= inner_width {
48-
// Word is too long, we need to break it (but this is rare with styled text)
49-
if !line.is_empty() {
50-
wrapped_lines.push(line);
51-
}
52-
wrapped_lines.push(word.to_string());
53-
line = String::new();
40+
let mut line = String::new();
41+
42+
for word in paragraph.split_whitespace() {
43+
let test_line = if line.is_empty() {
44+
word.to_string()
5445
} else {
55-
// Start a new line with this word
56-
if !line.is_empty() {
57-
wrapped_lines.push(line);
46+
format!("{} {}", line, word)
47+
};
48+
49+
let visible_len = strip_str(&test_line).len();
50+
51+
if visible_len <= inner_width {
52+
line = test_line;
53+
} else {
54+
// Check if the word alone is too long
55+
let word_visible_len = strip_str(word).len();
56+
if word_visible_len >= inner_width {
57+
// Word is too long, we need to break it (but this is rare with styled text)
58+
if !line.is_empty() {
59+
wrapped_lines.push(line);
60+
}
61+
wrapped_lines.push(word.to_string());
62+
line = String::new();
63+
} else {
64+
// Start a new line with this word
65+
if !line.is_empty() {
66+
wrapped_lines.push(line);
67+
}
68+
line = word.to_string();
5869
}
59-
line = word.to_string();
6070
}
6171
}
62-
}
6372

64-
if !line.is_empty() {
65-
wrapped_lines.push(line);
73+
if !line.is_empty() {
74+
wrapped_lines.push(line);
75+
}
6676
}
6777

6878
let top_border = if title.is_empty() {

crates/chat-cli/src/constants.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,9 +223,10 @@ Notes:
223223
/// Announcement text for Kiro CLI upgrade
224224
pub fn kiro_upgrade_announcement() -> String {
225225
format!(
226-
"Q CLI users can now upgrade to the Kiro CLI. Type {} to update today. The Kiro CLI leverages the agentic features of Q CLI and can be used with your existing Q Developer subscription. If you have auto updates enabled for the Q CLI, unless you disable that setting, Q CLI will auto update to Kiro CLI on 11/24. Kiro CLI is licensed as AWS Content under your Agreement and the AWS Intellectual Property License ({}). By updating to Kiro CLI, you agree to the AWS Intellectual Property License.",
226+
"Kiro CLI is the next update of the Q CLI. Your existing Q Developer CLI workflows and subscription continue to work without any changes. You can update to Kiro CLI manually with {} today, or wait for the auto-update on 11/24 to apply the change. To learn more, go to {}.\n\nKiro CLI is licensed under, and by updating to it you agree to, the AWS Intellectual Property License ({}).",
227227
StyledText::command("q update"),
228-
StyledText::command("https://aws.amazon.com/legal/aws-ip-license-terms/")
228+
StyledText::command("kiro.dev/cli/upgrade"),
229+
StyledText::command("kiro.dev/license")
229230
)
230231
}
231232

0 commit comments

Comments
 (0)