|
22 | 22 | import Textarea from '@gitbutler/ui/Textarea.svelte'; |
23 | 23 | import Tooltip from '@gitbutler/ui/Tooltip.svelte'; |
24 | 24 | import { isWhiteSpaceString } from '@gitbutler/ui/utils/string'; |
25 | | - import { createEventDispatcher, onMount, tick } from 'svelte'; |
| 25 | + import { onMount, tick } from 'svelte'; |
26 | 26 |
|
27 | 27 | interface Props { |
28 | 28 | existingCommit?: DetailedCommit | Commit; |
|
48 | 48 | const project = getContext(Project); |
49 | 49 | const promptService = getContext(PromptService); |
50 | 50 |
|
51 | | - const dispatch = createEventDispatcher<{ |
52 | | - action: 'generate-branch-name'; |
53 | | - }>(); |
54 | | -
|
55 | 51 | const aiGenEnabled = projectAiGenEnabled(project.id); |
56 | 52 | const commitGenerationExtraConcise = projectCommitGenerationExtraConcise(project.id); |
57 | 53 | const commitGenerationUseEmojis = projectCommitGenerationUseEmojis(project.id); |
|
62 | 58 | let titleTextArea: HTMLTextAreaElement | undefined = $state(); |
63 | 59 | let descriptionTextArea: HTMLTextAreaElement | undefined = $state(); |
64 | 60 |
|
65 | | - let { title, description } = $derived(splitMessage(commitMessage)); |
| 61 | + const { title, description } = $derived(splitMessage(commitMessage)); |
66 | 62 | $effect(() => { |
67 | 63 | valid = !!title; |
68 | 64 | }); |
|
95 | 91 | async function generateCommitMessage() { |
96 | 92 | const diffInput = await getDiffInput(); |
97 | 93 |
|
98 | | - // Branches get their names generated only if there are at least 4 lines of code |
99 | | - // If the change is a 'one-liner', the branch name is either left as "virtual branch" |
100 | | - // or the user has to manually trigger the name generation from the meatball menu |
101 | | - // This saves people this extra click |
102 | | - if ($branch.name.toLowerCase().includes('lane')) { |
103 | | - dispatch('action', 'generate-branch-name'); |
104 | | - } |
105 | | -
|
106 | 94 | aiLoading = true; |
107 | 95 |
|
108 | 96 | const prompt = promptService.selectedCommitPrompt(project.id); |
|
0 commit comments