@@ -44,6 +44,8 @@ import ApplyButton from '../ai-assistant/apply-button';
44
44
import { type ApplyButtonState } from ' ../ai-assistant/apply-button' ;
45
45
import Preview from ' ../preview' ;
46
46
47
+ import PreparingRoomMessageCommand from ' ./preparing-room-message-command' ;
48
+
47
49
interface Signature {
48
50
Element: HTMLDivElement ;
49
51
Args: {
@@ -53,6 +55,7 @@ interface Signature {
53
55
runCommand: () => void ;
54
56
isError? : boolean ;
55
57
isPending? : boolean ;
58
+ isStreaming: boolean ;
56
59
monacoSDK: MonacoSDK ;
57
60
};
58
61
}
@@ -193,97 +196,101 @@ export default class RoomMessageCommand extends Component<Signature> {
193
196
{{#if @ messageCommand.description }}
194
197
<div class =' command-description' >{{@ messageCommand.description }} </div >
195
198
{{/if }}
196
- <div
197
- class =' command-button-bar'
198
- {{! In test, if we change this isIdle check to the task running locally on this component, it will fail because roomMessages get destroyed during re-indexing.
199
+ {{#if @ isStreaming }}
200
+ <PreparingRoomMessageCommand />
201
+ {{else }}
202
+ <div
203
+ class =' command-button-bar'
204
+ {{! In test, if we change this isIdle check to the task running locally on this component, it will fail because roomMessages get destroyed during re-indexing.
199
205
Since services are long-lived so it we will not have this issue. I think this will go away when we convert our room field into a room component }}
200
- {{! TODO : Convert to non-EC async method after fixing CS-6987 }}
201
- data-test-command-card-idle ={{this .commandService.run.isIdle }}
202
- >
203
- <Button
204
- class =' view-code-button'
205
- {{on ' click' this . toggleViewCode}}
206
- @ kind ={{if this . isDisplayingCode ' primary-dark' ' secondary-dark' }}
207
- @ size =' extra-small'
208
- data-test-view-code-button
206
+ {{! TODO : Convert to non-EC async method after fixing CS-6987 }}
207
+ data-test-command-card-idle ={{this .commandService.run.isIdle }}
209
208
>
210
- {{if this . isDisplayingCode ' Hide Code' ' View Code' }}
211
- </Button >
212
- <ApplyButton
213
- @ state ={{this .applyButtonState }}
214
- {{on ' click' @ runCommand}}
215
- data-test-command-apply ={{this .applyButtonState }}
216
- />
217
- </div >
218
- {{#if this . isDisplayingCode }}
219
- <div class =' preview-code' >
220
209
<Button
221
- class =' code-copy-button'
222
- @ kind =' text-only'
210
+ class =' view-code-button'
211
+ {{on ' click' this . toggleViewCode}}
212
+ @ kind ={{if this . isDisplayingCode ' primary-dark' ' secondary-dark' }}
223
213
@ size =' extra-small'
224
- {{on ' click' this . copyToClipboard}}
225
- data-test-copy-code
214
+ data-test-view-code-button
226
215
>
227
- <CopyIcon
228
- width =' 16'
229
- height =' 16'
230
- role =' presentation'
231
- aria-hidden =' true'
232
- />
233
- <span class =' copy-text' >Copy to clipboard</span >
216
+ {{if this . isDisplayingCode ' Hide Code' ' View Code' }}
234
217
</Button >
235
- <div
236
- class =' monaco-container'
237
- {{this .scrollBottomIntoView }}
238
- {{monacoModifier
239
- content =this . previewCommandCode
240
- contentChanged =undefined
241
- monacoSDK =@ monacoSDK
242
- language =' json'
243
- readOnly =true
244
- editorDisplayOptions =this . editorDisplayOptions
245
- }}
246
- data-test-editor
247
- data-test-percy-hide
218
+ <ApplyButton
219
+ @ state ={{this .applyButtonState }}
220
+ {{on ' click' @ runCommand}}
221
+ data-test-command-apply ={{this .applyButtonState }}
248
222
/>
249
223
</div >
250
- {{/if }}
251
- {{#if this . failedCommandState }}
252
- <div class =' failed-command-result' >
253
- <span class =' failed-command-text' >
254
- {{this .failedCommandState.message }}
255
- </span >
256
- <Button
257
- {{on ' click' @ runCommand}}
258
- class =' retry-button'
259
- @ size =' small'
260
- @ kind =' secondary-dark'
261
- data-test-retry-command-button
224
+ {{#if this . isDisplayingCode }}
225
+ <div class =' preview-code' >
226
+ <Button
227
+ class =' code-copy-button'
228
+ @ kind =' text-only'
229
+ @ size =' extra-small'
230
+ {{on ' click' this . copyToClipboard}}
231
+ data-test-copy-code
232
+ >
233
+ <CopyIcon
234
+ width =' 16'
235
+ height =' 16'
236
+ role =' presentation'
237
+ aria-hidden =' true'
238
+ />
239
+ <span class =' copy-text' >Copy to clipboard</span >
240
+ </Button >
241
+ <div
242
+ class =' monaco-container'
243
+ {{this .scrollBottomIntoView }}
244
+ {{monacoModifier
245
+ content =this . previewCommandCode
246
+ contentChanged =undefined
247
+ monacoSDK =@ monacoSDK
248
+ language =' json'
249
+ readOnly =true
250
+ editorDisplayOptions =this . editorDisplayOptions
251
+ }}
252
+ data-test-editor
253
+ data-test-percy-hide
254
+ />
255
+ </div >
256
+ {{/if }}
257
+ {{#if this . failedCommandState }}
258
+ <div class =' failed-command-result' >
259
+ <span class =' failed-command-text' >
260
+ {{this .failedCommandState.message }}
261
+ </span >
262
+ <Button
263
+ {{on ' click' @ runCommand}}
264
+ class =' retry-button'
265
+ @ size =' small'
266
+ @ kind =' secondary-dark'
267
+ data-test-retry-command-button
268
+ >
269
+ Retry
270
+ </Button >
271
+ </div >
272
+ {{/if }}
273
+ {{#if this . commandResultCard.card }}
274
+ <CardContainer
275
+ @ displayBoundaries ={{ false }}
276
+ class =' command-result-card-preview'
277
+ data-test-command-result-container
262
278
>
263
- Retry
264
- </Button >
265
- </div >
266
- {{/if }}
267
- {{#if this . commandResultCard.card }}
268
- <CardContainer
269
- @ displayBoundaries ={{ false }}
270
- class =' command-result-card-preview'
271
- data-test-command-result-container
272
- >
273
- <CardHeader
274
- @ cardTypeDisplayName ={{this .headerTitle }}
275
- @ cardTypeIcon ={{cardTypeIcon this . commandResultCard.card}}
276
- @ moreOptionsMenuItems ={{this .moreOptionsMenuItems }}
277
- class =' header'
278
- data-test-command-result-header
279
- />
280
- <Preview
281
- @ card ={{this .commandResultCard.card }}
282
- @ format =' embedded'
283
- @ displayContainer ={{ false }}
284
- data-test-boxel-command-result
285
- />
286
- </CardContainer >
279
+ <CardHeader
280
+ @ cardTypeDisplayName ={{this .headerTitle }}
281
+ @ cardTypeIcon ={{cardTypeIcon this . commandResultCard.card}}
282
+ @ moreOptionsMenuItems ={{this .moreOptionsMenuItems }}
283
+ class =' header'
284
+ data-test-command-result-header
285
+ />
286
+ <Preview
287
+ @ card ={{this .commandResultCard.card }}
288
+ @ format =' embedded'
289
+ @ displayContainer ={{ false }}
290
+ data-test-boxel-command-result
291
+ />
292
+ </CardContainer >
293
+ {{/if }}
287
294
{{/if }}
288
295
</div >
289
296
0 commit comments