|
16 | 16 | import { AI_SERVICE } from '$lib/ai/service';
|
17 | 17 | import { BASE_BRANCH_SERVICE } from '$lib/baseBranch/baseBranchService.svelte';
|
18 | 18 | import { type Commit } from '$lib/branches/v3';
|
| 19 | + import { SETTINGS_SERVICE } from '$lib/config/appSettingsV2'; |
19 | 20 | import { projectAiGenEnabled, projectRunCommitHooks } from '$lib/config/config';
|
20 | 21 | import { DEFAULT_FORGE_FACTORY } from '$lib/forge/forgeFactory.svelte';
|
21 | 22 | import { mapErrorToToast } from '$lib/forge/github/errorMap';
|
|
61 | 62 | const aiService = inject(AI_SERVICE);
|
62 | 63 | const remotesService = inject(REMOTES_SERVICE);
|
63 | 64 | const uiState = inject(UI_STATE);
|
| 65 | + const settingsService = inject(SETTINGS_SERVICE); |
| 66 | + const appSettings = settingsService.appSettings; |
64 | 67 |
|
65 | 68 | const user = userService.user;
|
66 | 69 |
|
|
111 | 114 | const isSubmittingReview = $derived(stackPush.current.isLoading || isCreatingReview);
|
112 | 115 |
|
113 | 116 | async function getDefaultTitle(commits: Commit[]): Promise<string> {
|
114 |
| - if (commits.length === 1) { |
| 117 | + const autoFill = $appSettings?.reviews.autoFillPrDescriptionFromCommit ?? true; |
| 118 | + if (autoFill && commits.length === 1) { |
115 | 119 | const commitMessage = commits[0]!.message;
|
116 | 120 | const { title } = splitMessage(commitMessage);
|
117 | 121 | return title;
|
|
126 | 130 | if ($templateEnabled && $templatePath) {
|
127 | 131 | return await stackService.template(projectId, forge.current.name, $templatePath);
|
128 | 132 | }
|
129 |
| - if (commits.length === 1) { |
| 133 | + const autoFill = $appSettings?.reviews.autoFillPrDescriptionFromCommit ?? true; |
| 134 | + if (autoFill && commits.length === 1) { |
130 | 135 | return splitMessage(commits[0]!.message).description;
|
131 | 136 | }
|
132 | 137 | return '';
|
|
0 commit comments