Skip to content

Commit 28a05c3

Browse files
committed
update to help and model on welcome screen
1 parent 99fe832 commit 28a05c3

File tree

3 files changed

+31
-33
lines changed

3 files changed

+31
-33
lines changed

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

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1407,14 +1407,32 @@ impl ChatSession {
14071407
}
14081408
}
14091409

1410+
// Show model information
1411+
if let Some(ref model_info) = self.conversation.model_info {
1412+
let (models, _default_model) = get_available_models(os).await?;
1413+
if let Some(model_option) = models.iter().find(|option| option.model_id == model_info.model_id) {
1414+
let display_name = model_option.model_name.as_deref().unwrap_or(&model_option.model_id);
1415+
execute!(
1416+
self.stderr,
1417+
style::Print("\n"),
1418+
StyledText::secondary_fg(),
1419+
style::Print("Model: "),
1420+
StyledText::reset(),
1421+
style::Print(display_name),
1422+
StyledText::secondary_fg(),
1423+
style::Print(" ("),
1424+
StyledText::reset(),
1425+
style::Print(&StyledText::command("/model")),
1426+
StyledText::secondary_fg(),
1427+
style::Print(" to change)\n"),
1428+
StyledText::reset(),
1429+
)?;
1430+
}
1431+
}
1432+
14101433
execute!(
14111434
self.stderr,
14121435
style::Print("\n"),
1413-
style::Print(&match is_small_screen {
1414-
true => ui_text::small_screen_popular_shortcuts(),
1415-
false => ui_text::popular_shortcuts(),
1416-
}),
1417-
style::Print("\n"),
14181436
style::Print(
14191437
"━"
14201438
.repeat(if is_small_screen { 0 } else { GREETING_BREAK_POINT })
@@ -1441,20 +1459,6 @@ impl ChatSession {
14411459

14421460
self.stderr.flush()?;
14431461

1444-
if let Some(ref model_info) = self.conversation.model_info {
1445-
let (models, _default_model) = get_available_models(os).await?;
1446-
if let Some(model_option) = models.iter().find(|option| option.model_id == model_info.model_id) {
1447-
let display_name = model_option.model_name.as_deref().unwrap_or(&model_option.model_id);
1448-
execute!(
1449-
self.stderr,
1450-
StyledText::brand_fg(),
1451-
style::Print(format!("🤖 You are chatting with {display_name}\n")),
1452-
StyledText::reset(),
1453-
style::Print("\n")
1454-
)?;
1455-
}
1456-
}
1457-
14581462
// Initialize capturing if possible
14591463
if ExperimentManager::is_enabled(os, ExperimentName::Checkpoint) {
14601464
let path = get_shadow_repo_dir(os, self.conversation.conversation_id().to_string())?;

crates/chat-cli/src/constants.rs

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -159,23 +159,14 @@ pub mod ui_text {
159159
"Picking up where we left off...".to_string()
160160
}
161161

162-
/// Popular shortcuts text for large screens
162+
/// Popular shortcuts text
163163
pub fn popular_shortcuts() -> String {
164164
format!(
165-
"{} all commands • {} new lines • {} fuzzy search",
165+
"{}Use {}{} for more information and happy coding!{}",
166+
StyledText::secondary_fg(),
166167
StyledText::command("/help"),
167-
StyledText::command("ctrl + j"),
168-
StyledText::command("ctrl + s")
169-
)
170-
}
171-
172-
/// Popular shortcuts text for small screens
173-
pub fn small_screen_popular_shortcuts() -> String {
174-
format!(
175-
"{} all commands\n{} new lines\n{} fuzzy search",
176-
StyledText::command("/help"),
177-
StyledText::command("ctrl + j"),
178-
StyledText::command("ctrl + s")
168+
StyledText::secondary_fg(),
169+
StyledText::reset()
179170
)
180171
}
181172
}

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ pub fn render_new_user_welcome(output: &mut impl Write) -> Result<()> {
4949
)),
5050
)?;
5151

52+
// Add the help message
53+
execute!(output, style::Print(&ui_text::popular_shortcuts()), style::Print("\n"),)?;
54+
5255
Ok(())
5356
}
5457

0 commit comments

Comments
 (0)