@@ -14,14 +14,7 @@ mod prompt;
1414mod prompt_parser;
1515pub mod server_messenger;
1616use crate :: cli:: chat:: checkpoint:: CHECKPOINT_MESSAGE_MAX_LENGTH ;
17- use crate :: constants:: ui_text:: {
18- LIMIT_REACHED_TEXT ,
19- POPULAR_SHORTCUTS ,
20- RESUME_TEXT ,
21- SMALL_SCREEN_POPULAR_SHORTCUTS ,
22- SMALL_SCREEN_WELCOME ,
23- WELCOME_TEXT ,
24- } ;
17+ use crate :: constants:: ui_text;
2518#[ cfg( unix) ]
2619mod skim_integration;
2720mod token_counter;
@@ -172,7 +165,6 @@ use crate::cli::experiment::experiment_manager::{
172165use crate :: constants:: {
173166 error_messages,
174167 tips,
175- ui_text,
176168} ;
177169use crate :: database:: settings:: Setting ;
178170use crate :: os:: Os ;
@@ -446,9 +438,6 @@ impl ChatArgs {
446438// Maximum number of times to show the changelog announcement per version
447439const CHANGELOG_MAX_SHOW_COUNT : i64 = 2 ;
448440
449- // Only show the model-related tip for now to make users aware of this feature.
450- const ROTATING_TIPS : [ & str ; 20 ] = tips:: ROTATING_TIPS ;
451-
452441const GREETING_BREAK_POINT : usize = 80 ;
453442
454443const RESPONSE_TIMEOUT_CONTENT : & str = "Response timed out - message took too long to generate" ;
@@ -997,7 +986,7 @@ impl ChatSession {
997986 {
998987 execute ! (
999988 self . stderr,
1000- style:: Print ( format!( "\n \n {LIMIT_REACHED_TEXT } {limits_text}" ) ) ,
989+ style:: Print ( format!( "\n \n {} {limits_text}" , ui_text :: limit_reached_text ( ) ) ) ,
1001990 StyledText :: secondary_fg( ) ,
1002991 style:: Print ( "\n \n Use " ) ,
1003992 StyledText :: success_fg( ) ,
@@ -1193,16 +1182,17 @@ impl ChatSession {
11931182 . unwrap_or ( true )
11941183 {
11951184 let welcome_text = match self . existing_conversation {
1196- true => RESUME_TEXT ,
1185+ true => ui_text :: resume_text ( ) ,
11971186 false => match is_small_screen {
1198- true => SMALL_SCREEN_WELCOME ,
1199- false => WELCOME_TEXT ,
1187+ true => ui_text :: small_screen_welcome ( ) ,
1188+ false => ui_text :: welcome_text ( ) ,
12001189 } ,
12011190 } ;
12021191
1203- execute ! ( self . stderr, style:: Print ( welcome_text) , style:: Print ( "\n \n " ) , ) ?;
1192+ execute ! ( self . stderr, style:: Print ( & welcome_text) , style:: Print ( "\n \n " ) , ) ?;
12041193
1205- let tip = ROTATING_TIPS [ usize:: try_from ( rand:: random :: < u32 > ( ) ) . unwrap_or ( 0 ) % ROTATING_TIPS . len ( ) ] ;
1194+ let rotating_tips = tips:: get_rotating_tips ( ) ;
1195+ let tip = & rotating_tips[ usize:: try_from ( rand:: random :: < u32 > ( ) ) . unwrap_or ( 0 ) % rotating_tips. len ( ) ] ;
12061196 if is_small_screen {
12071197 // If the screen is small, print the tip in a single line
12081198 execute ! (
@@ -1224,9 +1214,9 @@ impl ChatSession {
12241214 execute ! (
12251215 self . stderr,
12261216 style:: Print ( "\n " ) ,
1227- style:: Print ( match is_small_screen {
1228- true => SMALL_SCREEN_POPULAR_SHORTCUTS ,
1229- false => POPULAR_SHORTCUTS ,
1217+ style:: Print ( & match is_small_screen {
1218+ true => ui_text :: small_screen_popular_shortcuts ( ) ,
1219+ false => ui_text :: popular_shortcuts ( ) ,
12301220 } ) ,
12311221 style:: Print ( "\n " ) ,
12321222 style:: Print (
0 commit comments