File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -184,6 +184,18 @@ impl Widget for &mut App<'_> {
184
184
}
185
185
let chat_len = messages. len ( ) ;
186
186
187
+ if self
188
+ . ui
189
+ . history_state
190
+ . selected
191
+ . is_some_and ( |idx| idx >= chat_len)
192
+ && chat_len >= 1
193
+ {
194
+ self . ui . history_state . selected = Some ( chat_len - 1 ) ;
195
+ } else if chat_len == 0 {
196
+ self . ui . history_state . selected = None ;
197
+ }
198
+
187
199
let builder = ListBuilder :: new ( |context| {
188
200
if let Some ( mut item) = messages. get ( context. index ) . cloned ( ) {
189
201
item. is_selected = context. is_selected ;
@@ -204,7 +216,7 @@ impl Widget for &mut App<'_> {
204
216
. thumb_symbol ( "▐" ) ,
205
217
)
206
218
. infinite_scrolling ( false )
207
- . scroll_padding ( 2 ) ;
219
+ . scroll_padding ( 0 ) ;
208
220
209
221
list. render ( layout. chat_area , buf, & mut self . ui . history_state ) ;
210
222
You can’t perform that action at this time.
0 commit comments