|
21 | 21 | import { VirtualBranch, LocalFile } from '$lib/vbranches/types'; |
22 | 22 | import Checkbox from '@gitbutler/ui/Checkbox.svelte'; |
23 | 23 | import Icon from '@gitbutler/ui/Icon.svelte'; |
24 | | - import { tooltip } from '@gitbutler/ui/utils/tooltip'; |
| 24 | + import Tooltip from '@gitbutler/ui/Tooltip.svelte'; |
25 | 25 | import { createEventDispatcher, onMount } from 'svelte'; |
26 | 26 | import { fly } from 'svelte/transition'; |
27 | 27 |
|
|
179 | 179 | {/if} |
180 | 180 |
|
181 | 181 | {#if title.length > 50} |
182 | | - <div |
183 | | - transition:fly={{ y: 2, duration: 150 }} |
184 | | - class="commit-box__textarea-tooltip" |
185 | | - use:tooltip={{ |
186 | | - text: '50 characters or less is best. Extra info can be added in the description.', |
187 | | - delay: 200 |
188 | | - }} |
189 | | - > |
190 | | - <Icon name="idea" /> |
191 | | - </div> |
| 182 | + <Tooltip text={'50 characters or less is best.\nUse description for more details'}> |
| 183 | + <div transition:fly={{ y: 2, duration: 150 }} class="commit-box__textarea-tooltip"> |
| 184 | + <Icon name="idea" /> |
| 185 | + </div> |
| 186 | + </Tooltip> |
192 | 187 | {/if} |
193 | 188 |
|
194 | | - <div |
195 | | - class="commit-box__texarea-actions" |
196 | | - class:commit-box-actions_expanded={isExpanded} |
197 | | - use:tooltip={!aiConfigurationValid |
198 | | - ? 'You must be logged in or have provided your own API key to use this feature' |
| 189 | + <Tooltip |
| 190 | + text={!aiConfigurationValid |
| 191 | + ? 'You must be logged in or have provided your own API key' |
199 | 192 | : !$aiGenEnabled |
200 | | - ? 'You must have summary generation enabled to use this feature' |
201 | | - : ''} |
| 193 | + ? 'You must have summary generation enabled' |
| 194 | + : undefined} |
202 | 195 | > |
203 | | - <DropDownButton |
204 | | - style="ghost" |
205 | | - outline |
206 | | - icon="ai-small" |
207 | | - disabled={!($aiGenEnabled && aiConfigurationValid)} |
208 | | - loading={aiLoading} |
209 | | - menuPosition="top" |
210 | | - onclick={async () => await generateCommitMessage($branch.files)} |
211 | | - > |
212 | | - Generate message |
213 | | - |
214 | | - {#snippet contextMenuSlot()} |
215 | | - <ContextMenuSection> |
216 | | - <ContextMenuItem |
217 | | - label="Extra concise" |
218 | | - on:click={() => ($commitGenerationExtraConcise = !$commitGenerationExtraConcise)} |
219 | | - > |
220 | | - <Checkbox small slot="control" bind:checked={$commitGenerationExtraConcise} /> |
221 | | - </ContextMenuItem> |
222 | | - |
223 | | - <ContextMenuItem |
224 | | - label="Use emojis 😎" |
225 | | - on:click={() => ($commitGenerationUseEmojis = !$commitGenerationUseEmojis)} |
226 | | - > |
227 | | - <Checkbox small slot="control" bind:checked={$commitGenerationUseEmojis} /> |
228 | | - </ContextMenuItem> |
229 | | - </ContextMenuSection> |
230 | | - {/snippet} |
231 | | - </DropDownButton> |
232 | | - </div> |
| 196 | + <div class="commit-box__texarea-actions" class:commit-box-actions_expanded={isExpanded}> |
| 197 | + <DropDownButton |
| 198 | + style="ghost" |
| 199 | + outline |
| 200 | + icon="ai-small" |
| 201 | + disabled={!($aiGenEnabled && aiConfigurationValid)} |
| 202 | + loading={aiLoading} |
| 203 | + menuPosition="top" |
| 204 | + onclick={async () => await generateCommitMessage($branch.files)} |
| 205 | + > |
| 206 | + Generate message |
| 207 | + |
| 208 | + {#snippet contextMenuSlot()} |
| 209 | + <ContextMenuSection> |
| 210 | + <ContextMenuItem |
| 211 | + label="Extra concise" |
| 212 | + on:click={() => ($commitGenerationExtraConcise = !$commitGenerationExtraConcise)} |
| 213 | + > |
| 214 | + <Checkbox small slot="control" bind:checked={$commitGenerationExtraConcise} /> |
| 215 | + </ContextMenuItem> |
| 216 | + |
| 217 | + <ContextMenuItem |
| 218 | + label="Use emojis 😎" |
| 219 | + on:click={() => ($commitGenerationUseEmojis = !$commitGenerationUseEmojis)} |
| 220 | + > |
| 221 | + <Checkbox small slot="control" bind:checked={$commitGenerationUseEmojis} /> |
| 222 | + </ContextMenuItem> |
| 223 | + </ContextMenuSection> |
| 224 | + {/snippet} |
| 225 | + </DropDownButton> |
| 226 | + </div> |
| 227 | + </Tooltip> |
233 | 228 | </div> |
234 | 229 | {/if} |
235 | 230 |
|
|
0 commit comments