Skip to content

Commit 51ea250

Browse files
committed
ux changes
1 parent 665e97e commit 51ea250

File tree

14 files changed

+240
-115
lines changed

14 files changed

+240
-115
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,9 @@ impl CheckpointSubcommand {
9191
execute!(
9292
session.stderr,
9393
StyledText::error_fg(),
94-
style::Print("\nCheckpoint is disabled. Enable it with: kiro-cli settings chat.enableCheckpoint true\n"),
94+
style::Print(
95+
"\nCheckpoint is disabled. Enable it with: kiro-cli settings chat.enableCheckpoint true\n"
96+
),
9597
StyledText::reset(),
9698
)?;
9799
return Ok(ChatState::PromptUser {

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ use crate::cli::chat::{
1919
ChatSession,
2020
ChatState,
2121
};
22+
use crate::constants::context_text;
2223
use crate::constants::help_text::{
2324
CONTEXT_DESCRIPTION,
2425
context_long_help,
@@ -238,7 +239,8 @@ impl ContextSubcommand {
238239
session.stderr,
239240
StyledText::warning_fg(),
240241
style::Print(format!(
241-
"Total token count exceeds limit: {context_files_max_size}. The following files will be automatically dropped when interacting with Kiro. Consider removing them. \n\n"
242+
"{} \n\n",
243+
context_text::context_limit_warning(context_files_max_size)
242244
)),
243245
StyledText::reset(),
244246
)?;

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,11 @@ use crate::cli::issue;
5656
use crate::constants::ui_text;
5757
use crate::os::Os;
5858

59-
/// q (Kiro Chat)
59+
/// Use any of these commands to manage your Kiro session. All commands start with '/'.
6060
#[derive(Debug, PartialEq, Parser)]
61-
#[command(color = clap::ColorChoice::Always, term_width = 0, after_long_help = &ui_text::extra_help())]
61+
#[command(
62+
color = clap::ColorChoice::Always, term_width = 0, after_long_help = &ui_text::extra_help(), override_usage = "/<COMMAND>",
63+
)]
6264
pub enum SlashCommand {
6365
/// Quit the application
6466
#[command(aliases = ["q", "exit"])]

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

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,20 +109,36 @@ pub async fn select_model(os: &Os, session: &mut ChatSession) -> Result<Option<C
109109
let description = model.description();
110110
if Some(model.model_id.as_str()) == active_model_id {
111111
if let Some(desc) = description {
112-
format!("{display_name} (active) | {desc}")
112+
if desc.to_lowercase().contains("experimental") {
113+
format!(
114+
"{display_name} {} {}",
115+
StyledText::current_item("(current)"),
116+
StyledText::secondary("-- experimental")
117+
)
118+
} else {
119+
format!("{display_name} {} | {desc}", StyledText::current_item("(current)"))
120+
}
113121
} else {
114-
format!("{display_name} (active)")
122+
format!("{display_name} {}", StyledText::current_item("(current)"))
115123
}
116124
} else if let Some(desc) = description {
117-
format!("{display_name} | {desc}")
125+
if desc.to_lowercase().contains("experimental") {
126+
format!("{display_name} {}", StyledText::secondary("-- experimental"))
127+
} else {
128+
format!("{display_name} | {desc}")
129+
}
118130
} else {
119131
display_name.to_string()
120132
}
121133
})
122134
.collect();
123135

124136
let selection: Option<_> = match Select::with_theme(&crate::util::dialoguer_theme())
125-
.with_prompt("Select a model for this chat session")
137+
.with_prompt(format!(
138+
"Press ({}) to navigate · Enter({}) to select model",
139+
StyledText::current_item("↑↓"),
140+
StyledText::current_item("⏎")
141+
))
126142
.items(&labels)
127143
.default(0)
128144
.interact_on_opt(&dialoguer::console::Term::stdout())

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

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,12 @@ use crate::cli::chat::{
1616
get_subscription_status_with_spinner,
1717
with_spinner,
1818
};
19+
use crate::constants::subscription_text;
1920
use crate::os::Os;
2021
use crate::theme::StyledText;
2122
use crate::util::system_info::is_remote;
2223

23-
const SUBSCRIBE_TITLE_TEXT: &str = color_print::cstr! { "<white!,bold>Subscribe to Kiro Developer Pro</white!,bold>" };
24-
25-
const SUBSCRIBE_TEXT: &str = color_print::cstr! { "During the upgrade, you'll be asked to link your Builder ID to the AWS account that will be billed the monthly subscription fee.
26-
27-
Need help? Visit our subscription support page> <blue!>https://docs.aws.amazon.com/console/amazonq/upgrade-builder-id</blue!>" };
28-
29-
/// Arguments for the subscribe command to manage Kiro Developer Pro subscriptions
24+
/// Arguments for the subscribe command to manage Developer Pro subscriptions
3025
#[deny(missing_docs)]
3126
#[derive(Debug, PartialEq, Args)]
3227
pub struct SubscribeArgs {
@@ -41,7 +36,7 @@ impl SubscribeArgs {
4136
execute!(
4237
session.stderr,
4338
StyledText::warning_fg(),
44-
style::Print("\nYour Kiro Developer Pro subscription is managed through IAM Identity Center.\n\n"),
39+
style::Print(format!("\n{}\n\n", subscription_text::idc_subscription_message())),
4540
StyledText::reset(),
4641
)?;
4742
} else if self.manage {
@@ -52,7 +47,7 @@ impl SubscribeArgs {
5247
queue!(
5348
session.stderr,
5449
StyledText::warning_fg(),
55-
style::Print("You don't seem to have a Kiro Developer Pro subscription. "),
50+
style::Print(format!("{}. ", subscription_text::no_subscription_message())),
5651
StyledText::secondary_fg(),
5752
style::Print("Use "),
5853
StyledText::success_fg(),
@@ -109,7 +104,7 @@ async fn upgrade_to_pro(os: &mut Os, session: &mut ChatSession) -> Result<(), Ch
109104
queue!(
110105
session.stderr,
111106
StyledText::warning_fg(),
112-
style::Print("Your Builder ID already has a Kiro Developer Pro subscription.\n\n"),
107+
style::Print(format!("{}\n\n", subscription_text::already_subscribed_message())),
113108
StyledText::reset(),
114109
)?;
115110
return Ok(());
@@ -129,9 +124,10 @@ async fn upgrade_to_pro(os: &mut Os, session: &mut ChatSession) -> Result<(), Ch
129124
// Upgrade information
130125
queue!(
131126
session.stderr,
132-
style::Print(SUBSCRIBE_TITLE_TEXT),
127+
StyledText::primary_fg(),
128+
style::Print(subscription_text::subscribe_title()),
133129
StyledText::secondary_fg(),
134-
style::Print(format!("\n\n{SUBSCRIBE_TEXT}\n\n")),
130+
style::Print(format!("\n\n{}\n\n", subscription_text::SUBSCRIBE_INFO)),
135131
StyledText::reset(),
136132
cursor::Show
137133
)?;

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@ impl TangentArgs {
5353
execute!(
5454
session.stderr,
5555
StyledText::error_fg(),
56-
style::Print("\nTangent mode is disabled. Enable it with: kiro-cli settings chat.enableTangentMode true\n"),
56+
style::Print(
57+
"\nTangent mode is disabled. Enable it with: kiro-cli settings chat.enableTangentMode true\n"
58+
),
5759
StyledText::reset(),
5860
)?;
5961
return Ok(ChatState::PromptUser {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3447,7 +3447,7 @@ impl ChatSession {
34473447
self.stderr,
34483448
style::Print(format!(
34493449
"\n(To exit the CLI, press Ctrl+C or Ctrl+D again or type {})\n\n",
3450-
"/quit".green()
3450+
StyledText::brand("/quit")
34513451
))
34523452
)
34533453
.unwrap_or_default();

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

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,19 @@ pub fn get_available_commands(os: &Os) -> Vec<String> {
6767
/// Format commands for skim display
6868
/// Create a standard set of skim options with consistent styling
6969
fn create_skim_options(prompt: &str, multi: bool) -> Result<SkimOptions> {
70+
use crate::theme::{
71+
BRAND_COLOR_ANSI,
72+
SECONDARY_COLOR_ANSI,
73+
};
74+
7075
SkimOptionsBuilder::default()
7176
.height("100%".to_string())
7277
.prompt(prompt.to_string())
7378
.reverse(true)
7479
.multi(multi)
80+
.color(Some(format!(
81+
"current:{BRAND_COLOR_ANSI}:bold,pointer:{BRAND_COLOR_ANSI},prompt:{SECONDARY_COLOR_ANSI}"
82+
)))
7583
.build()
7684
.map_err(|e| eyre!("Failed to build skim options: {}", e))
7785
}
@@ -210,7 +218,11 @@ pub fn select_context_paths_with_skim(context_manager: &ContextManager) -> Resul
210218
pub fn select_command(os: &Os, context_manager: &ContextManager, tools: &[String]) -> Result<Option<String>> {
211219
let commands = get_available_commands(os);
212220

213-
match launch_skim_selector(&commands, "Select command: ", false)? {
221+
match launch_skim_selector(
222+
&commands,
223+
"Commands: Press (↑↓) to navigate · Enter(⏎) to select command",
224+
false,
225+
)? {
214226
Some(selections) if !selections.is_empty() => {
215227
let selected_command = &selections[0];
216228

0 commit comments

Comments
 (0)