File tree Expand file tree Collapse file tree 3 files changed +11
-2
lines changed
apps/desktop/src/components Expand file tree Collapse file tree 3 files changed +11
-2
lines changed Original file line number Diff line number Diff line change 191
191
bind:this ={composer }
192
192
initialValue ={description }
193
193
placeholder =" Commit message"
194
+ messageType =" commit"
194
195
enableRuler
195
196
{projectId }
196
197
{onAiButtonClick }
Original file line number Diff line number Diff line change 422
422
enableFileUpload
423
423
enableSmiles
424
424
placeholder =" PR Description"
425
+ messageType =" pr"
425
426
{onAiButtonClick }
426
427
{canUseAI }
427
428
{aiIsLoading }
Original file line number Diff line number Diff line change 58
58
testId? : string ;
59
59
forceSansFont? : boolean ;
60
60
useRuler? : boolean ;
61
+ messageType: ' commit' | ' pr' ;
61
62
}
62
63
63
64
let {
76
77
suggestionsHandler,
77
78
testId,
78
79
forceSansFont,
79
- useRuler
80
+ useRuler,
81
+ messageType
80
82
}: Props = $props ();
81
83
82
84
const MIN_RULER_VALUE = 30 ;
224
226
medium: 320
225
227
};
226
228
229
+ const GENERATE_MESSAGES: Record <typeof messageType , string > = {
230
+ commit: ' Generate commit message' ,
231
+ pr: ' Generate PR description'
232
+ };
233
+
227
234
function getTooltipText(): string | undefined {
228
235
if (! canUseAI ) {
229
236
return ' You need to enable AI in the project settings to use this feature' ;
230
237
}
231
238
if (currentEditorWidth <= DROPDOWN_BTN_BREAKPOINTS .medium ) {
232
- return ' Generate commit message ' ;
239
+ return GENERATE_MESSAGES [ messageType ] ;
233
240
}
234
241
return undefined ;
235
242
}
You can’t perform that action at this time.
0 commit comments