@@ -23,23 +23,21 @@ export default class ModalDiffModal extends Component {
2323
2424 @tracked loading = false ;
2525 @tracked finalResult = " " ;
26+ @tracked showcasedDiff = " " ;
2627 @tracked diffStreamer = new DiffStreamer (this .args .model .selectedText );
2728 @tracked suggestion = " " ;
2829 @tracked
2930 smoothStreamer = new SmoothStreamer (
3031 () => this .suggestion ,
3132 (newValue ) => (this .suggestion = newValue)
3233 );
34+ @tracked isStreaming = false ;
3335
3436 constructor () {
3537 super (... arguments );
3638 this .suggestChanges ();
3739 }
3840
39- get isStreaming () {
40- return this .diffStreamer .isStreaming || this .smoothStreamer .isStreaming ;
41- }
42-
4341 get primaryBtnLabel () {
4442 return this .loading
4543 ? i18n (" discourse_ai.ai_helper.context_menu.loading" )
@@ -64,12 +62,25 @@ export default class ModalDiffModal extends Component {
6462
6563 @action
6664 async updateResult (result ) {
65+ // TODO(@keegan)
66+ // Temporarily we are removing the animation using the diff streamer
67+ // and simply showing the diff streamed without a proper animation
68+ // while we figure things out
69+ // so that things are not too janky in the meantime.
6770 this .loading = false ;
71+ this .isStreaming = true ;
6872
6973 if (result .done ) {
7074 this .finalResult = result .result ;
7175 }
7276
77+ this .showcasedDiff = result .diff ;
78+
79+ if (result .done ) {
80+ this .loading = false ;
81+ this .isStreaming = false ;
82+ }
83+
7384 if (this .args .model .showResultAsDiff ) {
7485 this .diffStreamer .updateResult (result, " result" );
7586 } else {
@@ -140,12 +151,11 @@ export default class ModalDiffModal extends Component {
140151 " composer-ai-helper-modal__suggestion"
141152 " streamable-content"
142153 ( if this . isStreaming " streaming" )
143- ( if this . diffStreamer.isThinking " thinking" )
144154 ( if @ model.showResultAsDiff " inline-diff" )
145155 }}
146156 >
147157 {{#if @ model.showResultAsDiff }}
148- {{htmlSafe this . diffStreamer.diff }}
158+ {{htmlSafe this . showcasedDiff }}
149159 {{else }}
150160 {{#if this . smoothStreamer.isStreaming }}
151161 <CookText
0 commit comments