diff --git a/apps/desktop/src/lib/pr/PrDetailsModal.svelte b/apps/desktop/src/lib/pr/PrDetailsModal.svelte index 2936dd5e7..250da6871 100644 --- a/apps/desktop/src/lib/pr/PrDetailsModal.svelte +++ b/apps/desktop/src/lib/pr/PrDetailsModal.svelte @@ -90,6 +90,7 @@ let isDraft = $state($preferredPRAction === PRAction.CreateDraft); let modal = $state>(); + let templateSelector = $state>(); let isEditing = $state(true); let isLoading = $state(false); let pullRequestTemplateBody = $state(undefined); @@ -98,10 +99,10 @@ let aiDescriptionDirective = $state(undefined); let showAiBox = $state(false); - let showPRTemplateSelect = $state(false); - - function handleToggleUseTemplate() { - showPRTemplateSelect = !showPRTemplateSelect; + async function handleToggleUseTemplate() { + if (!templateSelector) return; + const displaying = templateSelector.imports.showing; + await templateSelector.setUsePullRequestTemplate(!displaying); } const canUseAI = $derived.by(() => { @@ -350,8 +351,9 @@ - {#if showPRTemplateSelect} - - {/if} +
diff --git a/apps/desktop/src/lib/pr/PrTemplateSection.svelte b/apps/desktop/src/lib/pr/PrTemplateSection.svelte index 509e374e4..c551e35f9 100644 --- a/apps/desktop/src/lib/pr/PrTemplateSection.svelte +++ b/apps/desktop/src/lib/pr/PrTemplateSection.svelte @@ -1,6 +1,6 @@ -
- -
+{#if show} +
+ +
+{/if}