@@ -104,11 +104,14 @@ function Chat:welcome()
104104 end
105105 end
106106
107- if # self .session .conversation == 0 or (# self .session .conversation == 1 and self .system_message ~= nil ) then
108- local lines = Utils .split_string_by_line (Config .options .chat .welcome_message )
109- self :set_lines (0 , 0 , false , lines )
110- for line_num = 0 , # lines do
111- self :add_highlight (" ChatGPTWelcome" , line_num , 0 , - 1 )
107+ -- Show welcome message only in non-compact mode
108+ if not self :is_compact () then
109+ if # self .session .conversation == 0 or (# self .session .conversation == 1 and self .system_message ~= nil ) then
110+ local lines = Utils .split_string_by_line (Config .options .chat .welcome_message )
111+ self :set_lines (0 , 0 , false , lines )
112+ for line_num = 0 , # lines do
113+ self :add_highlight (" ChatGPTWelcome" , line_num , 0 , - 1 )
114+ end
112115 end
113116 end
114117 self :render_role ()
@@ -186,6 +189,10 @@ function Chat:isBusy()
186189 return self .spinner :is_running () or self .is_streaming_response
187190end
188191
192+ function Chat :is_compact ()
193+ return self .display_mode == " right"
194+ end
195+
189196function Chat :add (type , text , usage )
190197 local idx = self .session :add_item ({
191198 type = type ,
@@ -204,7 +211,8 @@ function Chat:_add(type, text, usage, idx)
204211 local start_line = 0
205212 if self .selectedIndex > 0 then
206213 local prev = self .messages [self .selectedIndex ]
207- start_line = prev .end_line + (prev .type == ANSWER and 2 or 1 )
214+ local spacing = self :is_compact () and 1 or (prev .type == ANSWER and 2 or 1 )
215+ start_line = prev .end_line + spacing
208216 end
209217
210218 local lines = {}
@@ -266,7 +274,8 @@ function Chat:addAnswerPartial(text, state)
266274 local start_line = 0
267275 if self .selectedIndex > 0 then
268276 local prev = self .messages [self .selectedIndex ]
269- start_line = prev .end_line + (prev .type == ANSWER and 2 or 1 )
277+ local spacing = self :is_compact () and 1 or (prev .type == ANSWER and 2 or 1 )
278+ start_line = prev .end_line + spacing
270279 end
271280
272281 if state == " END" then
@@ -1203,9 +1212,9 @@ function Chat:get_layout_params()
12031212 }, { dir = " col" , grow = 1 })
12041213 end
12051214
1206- -- Build final layout with hints at full width bottom
1215+ -- Build final layout with hints at full width bottom (hidden in compact mode)
12071216 local box
1208- if self .hints_panel then
1217+ if self .hints_panel and not self : is_compact () then
12091218 box = Layout .Box ({
12101219 main_content ,
12111220 Layout .Box (self .hints_panel , { size = 1 }),
0 commit comments