@@ -418,6 +418,7 @@ enum State {
418
418
Unknown ,
419
419
NoModelsAvailable ,
420
420
NoModelSelected ,
421
+ ModelLoading ,
421
422
ModelSelectedWithEmptyChat ,
422
423
ModelSelectedWithChat {
423
424
sticked_to_bottom : bool ,
@@ -573,9 +574,12 @@ impl WidgetMatchEvent for ChatPanel {
573
574
impl ChatPanel {
574
575
fn update_state ( & mut self , scope : & mut Scope ) {
575
576
let store = scope. data . get_mut :: < Store > ( ) . unwrap ( ) ;
577
+ let loader = & store. chats . model_loader ;
576
578
577
579
self . state = if store. downloads . downloaded_files . is_empty ( ) {
578
580
State :: NoModelsAvailable
581
+ } else if loader. as_ref ( ) . map_or ( false , |l| !l. complete ) {
582
+ State :: ModelLoading
579
583
} else if store. chats . loaded_model . is_none ( ) {
580
584
State :: NoModelSelected
581
585
} else {
@@ -618,6 +622,18 @@ impl ChatPanel {
618
622
) ;
619
623
self . show_prompt_input_stop_button ( cx) ;
620
624
}
625
+ State :: ModelLoading => {
626
+ self . show_prompt_send_button ( cx) ;
627
+ self . disable_prompt_buttons ( cx) ;
628
+
629
+ let prompt_input = self . text_input ( id ! ( main_prompt_input. prompt) ) ;
630
+ prompt_input. apply_over (
631
+ cx,
632
+ live ! {
633
+ draw_text: { prompt_enabled: 0.0 }
634
+ } ,
635
+ ) ;
636
+ }
621
637
_ => { }
622
638
}
623
639
}
@@ -689,7 +705,7 @@ impl ChatPanel {
689
705
fn disable_prompt_buttons ( & mut self , cx : & mut Cx ) {
690
706
let disabled_color = vec3 ( 0.816 , 0.835 , 0.867 ) ; // #D0D5DD
691
707
let send_button = self . button ( id ! ( main_prompt_input. prompt_send_button) ) ;
692
- send_button. set_enabled ( true ) ;
708
+ send_button. set_enabled ( false ) ;
693
709
send_button. apply_over (
694
710
cx,
695
711
live ! {
0 commit comments