Skip to content

Commit 2884b56

Browse files
authored
Merge pull request #10344 from schpet/fix-tooltip-copy
Fixes tooltip copy for pull-requests
2 parents ab8d9dc + 68f4ab7 commit 2884b56

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

apps/desktop/src/components/CommitMessageEditor.svelte

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@
191191
bind:this={composer}
192192
initialValue={description}
193193
placeholder="Commit message"
194+
messageType="commit"
194195
enableRuler
195196
{projectId}
196197
{onAiButtonClick}

apps/desktop/src/components/ReviewCreation.svelte

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,7 @@
422422
enableFileUpload
423423
enableSmiles
424424
placeholder="PR Description"
425+
messageType="pr"
425426
{onAiButtonClick}
426427
{canUseAI}
427428
{aiIsLoading}

apps/desktop/src/components/editor/MessageEditor.svelte

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
testId?: string;
5959
forceSansFont?: boolean;
6060
useRuler?: boolean;
61+
messageType: 'commit' | 'pr';
6162
}
6263
6364
let {
@@ -76,7 +77,8 @@
7677
suggestionsHandler,
7778
testId,
7879
forceSansFont,
79-
useRuler
80+
useRuler,
81+
messageType
8082
}: Props = $props();
8183
8284
const MIN_RULER_VALUE = 30;
@@ -224,12 +226,17 @@
224226
medium: 320
225227
};
226228
229+
const GENERATE_MESSAGES: Record<typeof messageType, string> = {
230+
commit: 'Generate commit message',
231+
pr: 'Generate PR description'
232+
};
233+
227234
function getTooltipText(): string | undefined {
228235
if (!canUseAI) {
229236
return 'You need to enable AI in the project settings to use this feature';
230237
}
231238
if (currentEditorWidth <= DROPDOWN_BTN_BREAKPOINTS.medium) {
232-
return 'Generate commit message';
239+
return GENERATE_MESSAGES[messageType];
233240
}
234241
return undefined;
235242
}

0 commit comments

Comments
 (0)