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