Skip to content

Commit bf92c26

Browse files
authored
fix(icons): correct connect-github path (#11114)
Old path floats shift, small coordinate tweak settles — icon renders true.
1 parent 8fad61a commit bf92c26

File tree

3 files changed

+98
-7
lines changed

3 files changed

+98
-7
lines changed

apps/desktop/src/components/codegen/CodegenMessages.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -775,7 +775,7 @@
775775
</ContextMenuSection>
776776
<ContextMenuSection>
777777
<ContextMenuItem
778-
label="Edit templates"
778+
label="Edit templates"
779779
icon="edit"
780780
onclick={() => {
781781
promptConfigModal?.show();

apps/desktop/src/components/codegen/CodegenPromptConfigModal.svelte

Lines changed: 95 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<script lang="ts">
2-
import { Button, Modal, SectionCard } from '@gitbutler/ui';
2+
import { Modal, Segment, SegmentControl, Icon, Button } from '@gitbutler/ui';
3+
import { copyToClipboard } from '@gitbutler/ui/utils/clipboard';
34
import type { PromptDir } from '$lib/codegen/types';
45
56
type Props = {
@@ -14,11 +15,65 @@
1415
}
1516
1617
const { promptDirs, openPromptConfigDir }: Props = $props();
18+
19+
let selectedSegment = $state<string>(promptDirs[0]?.label || '');
1720
</script>
1821

19-
<Modal bind:this={modal} title="Configure prompt templates">
20-
<div class="flex flex-col gap-16">
21-
<p class="text-13">
22+
{#snippet pathContent({ path, caption }: { path: string; caption: string })}
23+
<div class="prompt-path">
24+
<button type="button" class="prompt-path__copy" onclick={() => copyToClipboard(path)}>
25+
<Icon name="copy" />
26+
</button>
27+
28+
<span class="prompt-path__label"> Location: </span>
29+
<span class="prompt-path__path">{path}</span>
30+
</div>
31+
32+
<p class="text-13 text-body clr-text-2">{caption}</p>
33+
{/snippet}
34+
35+
<Modal bind:this={modal} width={420} title="Configure prompt templates">
36+
<div class="stack-v gap-16">
37+
<p class="text-13 text-body clr-text-2">
38+
Prompts are searched in two locations. Project prompts override global prompts. Files ending
39+
in <code class="code-string">.local.md</code> override regular project prompts.
40+
</p>
41+
42+
<SegmentControl defaultIndex={0}>
43+
{#each promptDirs as dir}
44+
<Segment
45+
onselect={() => (selectedSegment = dir.label)}
46+
id={dir.label}
47+
icon={dir.label === 'Global' ? 'global-small' : 'folder'}
48+
>
49+
{dir.label}
50+
</Segment>
51+
{/each}
52+
</SegmentControl>
53+
54+
{#if selectedSegment === 'Global'}
55+
{@render pathContent({
56+
path: promptDirs.find((d) => d.label === 'Global')?.path || '',
57+
caption: 'Contains global prompt templates available to all projects.'
58+
})}
59+
{:else if selectedSegment === 'Project'}
60+
{@render pathContent({
61+
path: promptDirs.find((d) => d.label === 'Project')?.path || '',
62+
caption: 'Contains project-specific prompt templates that override global prompts.'
63+
})}
64+
{/if}
65+
66+
<Button
67+
icon="open-editor-small"
68+
onclick={() => {
69+
const dir = promptDirs.find((d) => d.label === selectedSegment);
70+
if (dir) {
71+
openPromptConfigDir(dir.path);
72+
}
73+
}}>Open in editor</Button
74+
>
75+
76+
<!-- <p class="text-13">
2277
We have a tierd prompt configuration setup. Prompts are expected to be found in the following
2378
locations.
2479
</p>
@@ -54,6 +109,41 @@
54109
{/snippet}
55110
</SectionCard>
56111
{/each}
57-
</div>
112+
</div> -->
58113
</div>
59114
</Modal>
115+
116+
<style lang="postcss">
117+
.prompt-path {
118+
display: flex;
119+
position: relative;
120+
flex-direction: column;
121+
padding: 10px;
122+
gap: 4px;
123+
border-radius: var(--radius-m);
124+
background-color: var(--clr-bg-2);
125+
font-family: var(--font-mono);
126+
}
127+
128+
.prompt-path__copy {
129+
position: absolute;
130+
top: 12px;
131+
right: 12px;
132+
color: var(--clr-text-3);
133+
transition: color var(--transition-fast);
134+
135+
&:hover {
136+
color: var(--clr-text-2);
137+
}
138+
}
139+
140+
.prompt-path__label {
141+
color: var(--clr-text-2);
142+
font-size: 12px;
143+
}
144+
145+
.prompt-path__path {
146+
color: var(--clr-text-1);
147+
font-size: 13px;
148+
}
149+
</style>

packages/ui/src/lib/data/icons.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,5 +262,6 @@
262262
"time": "M8 0.25C12.2802 0.25 15.75 3.71979 15.75 8C15.75 12.2802 12.2802 15.75 8 15.75C3.71979 15.75 0.25 12.2802 0.25 8C0.25 3.71979 3.71979 0.25 8 0.25ZM8 1.75C4.54822 1.75 1.75 4.54822 1.75 8C1.75 11.4518 4.54822 14.25 8 14.25C11.4518 14.25 14.25 11.4518 14.25 8C14.25 4.54822 11.4518 1.75 8 1.75ZM7.75 8.25H12V9.75H6.25V4H7.75V8.25Z",
263263
"enterprise": "M10 1.25C11.5188 1.25 12.75 2.48122 12.75 4V5.25H13C13.9665 5.25 14.75 6.0335 14.75 7V14.75H1.25V4C1.25 2.48122 2.48122 1.25 4 1.25H10ZM4 2.75C3.30964 2.75 2.75 3.30964 2.75 4V13.25H4V10H6V13.25H11.25V4C11.25 3.30964 10.6904 2.75 10 2.75H4ZM10 12H7V10H10V12ZM6 9H4V7H6V9ZM10 9H7V7H10V9ZM6 6H4V4H6V6ZM10 6H7V4H10V6Z",
264264
"token-lock": "M6 0.25C8.07107 0.25 9.75 1.92893 9.75 4V4.25H10C10.9665 4.25 11.75 5.0335 11.75 6V7.25H14C14.9665 7.25 15.75 8.0335 15.75 9V14C15.75 14.9665 14.9665 15.75 14 15.75H5C4.0335 15.75 3.25 14.9665 3.25 14V12.75H2C1.0335 12.75 0.25 11.9665 0.25 11V6C0.25 5.0335 1.0335 4.25 2 4.25H2.25V4C2.25 1.92893 3.92893 0.25 6 0.25ZM5 8.75C4.86193 8.75 4.75 8.86193 4.75 9V14C4.75 14.1381 4.86193 14.25 5 14.25H14C14.1381 14.25 14.25 14.1381 14.25 14V9C14.25 8.86193 14.1381 8.75 14 8.75H5ZM7 10.5C7.55228 10.5 8 10.9477 8 11.5C8 12.0523 7.55228 12.5 7 12.5C6.44772 12.5 6 12.0523 6 11.5C6 10.9477 6.44772 10.5 7 10.5ZM9.5 10.5C10.0523 10.5 10.5 10.9477 10.5 11.5C10.5 12.0523 10.0523 12.5 9.5 12.5C8.94772 12.5 8.5 12.0523 8.5 11.5C8.5 10.9477 8.94772 10.5 9.5 10.5ZM12 10.5C12.5523 10.5 13 10.9477 13 11.5C13 12.0523 12.5523 12.5 12 12.5C11.4477 12.5 11 12.0523 11 11.5C11 10.9477 11.4477 10.5 12 10.5ZM2 5.75C1.86193 5.75 1.75 5.86193 1.75 6V11C1.75 11.1381 1.86193 11.25 2 11.25H3.25V9C3.25 8.0335 4.0335 7.25 5 7.25H10.25V6C10.25 5.86193 10.1381 5.75 10 5.75H2ZM6 1.75C4.75736 1.75 3.75 2.75736 3.75 4V4.25H8.25V4C8.25 2.75736 7.24264 1.75 6 1.75Z",
265-
"connect-github": "M10.5002 10.4166H9.66718C8.60864 10.4166 7.7502 11.2751 7.75018 12.3336C7.75036 13.392 8.60874 14.2496 9.66718 14.2496H10.5002V15.7496H9.66718C7.78031 15.7496 6.25036 14.2204 6.25018 12.3336C6.2502 10.4467 7.78021 8.91663 9.66718 8.91663H10.5002V10.4166ZM12.3332 8.91663C14.2201 8.91672 15.7502 10.4467 15.7502 12.3336C15.75 14.2204 14.22 15.7495 12.3332 15.7496H11.5002V14.2496H12.3332C13.3915 14.2495 14.25 13.392 14.2502 12.3336C14.2502 11.2752 13.3916 10.4167 12.3332 10.4166H11.5002V8.91663H12.3332ZM2.13593 0.609009C2.981 0.554263 3.66587 0.809512 4.13007 1.07092C4.29112 1.16164 4.42625 1.25728 4.53729 1.34045C5.69497 1.09077 6.9056 1.08747 8.06561 1.33655C8.1664 1.25848 8.28655 1.17123 8.42987 1.0885C8.89261 0.821468 9.57055 0.576949 10.4592 0.607056L10.9474 0.623657L11.1301 1.07776C11.4976 1.99392 11.4452 2.76348 11.341 3.2467C11.8039 3.87098 12.0685 4.63263 12.0685 5.51038C12.0685 5.9927 12.0604 7.01969 11.0519 8.06897L10.5119 7.54846L9.97089 7.02893C10.5752 6.40006 10.5685 5.85891 10.5685 5.51038C10.5685 4.85135 10.3422 4.33795 9.96405 3.9342L9.6369 3.58459L9.81561 3.14026C9.84325 3.07164 9.98147 2.6974 9.88202 2.14124C9.57842 2.19273 9.3459 2.29252 9.17987 2.38831C9.0525 2.46185 8.96075 2.53424 8.90546 2.58362C8.87822 2.60797 8.85963 2.62702 8.85077 2.63635L8.84784 2.63831H8.84882L8.84784 2.64026H8.84686C8.84597 2.64114 8.84532 2.6418 8.84491 2.64221L8.84589 2.64026L8.54706 3.00647L8.07928 2.88147C6.9279 2.57246 5.69179 2.57418 4.53729 2.88147L4.10468 2.9967L3.80292 2.67542L3.79022 2.66272C3.77609 2.64933 3.75107 2.62629 3.716 2.59729C3.64512 2.53869 3.53529 2.45828 3.39374 2.37854C3.21599 2.27843 2.99446 2.1839 2.73553 2.13538C2.63406 2.69486 2.77431 3.07169 2.80194 3.14026L2.9787 3.57776L2.66034 3.92639C2.28334 4.33938 2.05006 4.85884 2.04999 5.51038C2.04999 6.72768 2.47042 7.39969 2.99237 7.81311C3.55407 8.2579 4.32547 8.4753 5.12421 8.57971C5.87978 8.67873 6.15107 9.67712 5.49042 10.1237C4.90558 10.5185 4.55494 11.1778 4.55487 11.8834V13.3619H3.05487V12.7321C2.71441 12.6681 2.4192 12.5593 2.16034 12.4078C1.73221 12.1572 1.4664 11.8281 1.2785 11.569C1.06263 11.2712 0.998353 11.1557 0.884949 11.0533C0.830528 11.0042 0.767438 10.9596 0.587097 10.9596C0.172884 10.9596 -0.162903 10.6238 -0.162903 10.2096C-0.162838 9.79544 0.172924 9.45959 0.587097 9.45959C1.14196 9.45962 1.56225 9.6445 1.88983 9.94006C2.1581 10.1822 2.37501 10.5261 2.49237 10.6881C2.63768 10.8885 2.75747 11.0198 2.91815 11.1139C2.9717 11.1452 3.03825 11.1739 3.1203 11.2018C3.21616 10.6999 3.41565 10.2256 3.70526 9.81018C3.13819 9.64081 2.56339 9.387 2.06073 8.98889C1.14362 8.26244 0.549988 7.13787 0.549988 5.51038C0.550047 4.62725 0.827249 3.86988 1.2785 3.25256C1.17342 2.76969 1.11937 1.99777 1.48846 1.07776L1.66425 0.639282L2.13593 0.609009ZM12.5002 13.0836H9.50018V11.5836H12.5002V13.0836Z"
265+
"connect-github": "M10.5002 10.4164H9.66718C8.60873 10.4164 7.75035 11.275 7.75018 12.3334C7.75036 13.3918 8.60874 14.2494 9.66718 14.2494H10.5002V15.7494H9.66718C7.78031 15.7494 6.25036 14.2202 6.25018 12.3334C6.25035 10.4465 7.78031 8.91638 9.66718 8.91638H10.5002V10.4164ZM12.3332 8.91638C14.22 8.91648 15.75 10.4466 15.7502 12.3334C15.75 14.2201 14.22 15.7493 12.3332 15.7494H11.5002V14.2494H12.3332C13.3915 14.2493 14.25 13.3917 14.2502 12.3334C14.25 11.275 13.3915 10.4165 12.3332 10.4164H11.5002V8.91638H12.3332ZM2.13593 0.608765C2.981 0.554024 3.66588 0.809269 4.13007 1.07068C4.29117 1.16142 4.42623 1.25702 4.53729 1.34021C5.69495 1.09054 6.90562 1.08723 8.06561 1.3363C8.16637 1.25826 8.28662 1.17095 8.42987 1.08826C8.89261 0.82125 9.57062 0.576707 10.4592 0.606812L10.9474 0.623413L11.1301 1.07751C11.4975 1.99351 11.4452 2.76322 11.341 3.24646C11.8039 3.87068 12.0684 4.63249 12.0685 5.51013C12.0685 5.99243 12.0603 7.0195 11.0519 8.06873L10.5119 7.54822L9.97089 7.02869C10.5751 6.39988 10.5685 5.85864 10.5685 5.51013C10.5684 4.8512 10.3422 4.33766 9.96405 3.93396L9.6369 3.58435L9.81561 3.14001C9.84347 3.07078 9.98136 2.69652 9.88202 2.14099C9.57849 2.19247 9.34589 2.29229 9.17987 2.38806C9.05261 2.46155 8.96077 2.534 8.90546 2.58337C8.87836 2.6076 8.85968 2.62672 8.85077 2.63611L8.84784 2.63806H8.84882L8.84784 2.64001H8.84686C8.846 2.64088 8.84535 2.64154 8.84491 2.64197L8.84589 2.64001L8.54706 3.00623L8.07928 2.88123C6.92792 2.57222 5.69177 2.57395 4.53729 2.88123L4.10468 2.99646L3.80292 2.67517L3.79022 2.66248C3.77607 2.64906 3.75109 2.62606 3.716 2.59705C3.6451 2.53843 3.53533 2.45805 3.39374 2.3783C3.21597 2.27818 2.99448 2.18365 2.73553 2.13513C2.63418 2.69398 2.77409 3.07082 2.80194 3.14001L2.9787 3.57751L2.66034 3.92615C2.2834 4.33908 2.05012 4.85872 2.04999 5.51013C2.04999 6.72743 2.47042 7.39944 2.99237 7.81287C3.55408 8.25772 4.32541 8.47505 5.12421 8.57947C5.87975 8.67845 6.15092 9.67683 5.49042 10.1234C4.90566 10.5182 4.55503 11.1777 4.55487 11.8832V13.3617H3.05487V12.6683C2.74758 12.6067 2.47809 12.5067 2.24042 12.3676C1.83109 12.1279 1.57688 11.8133 1.3996 11.5687C1.19483 11.2863 1.13926 11.1854 1.03827 11.0941C0.996024 11.056 0.948006 11.0179 0.791199 11.0179C0.377083 11.0178 0.0411987 10.6821 0.0411987 10.2679C0.0413095 9.8539 0.377152 9.51806 0.791199 9.51794C1.32263 9.51794 1.72772 9.69534 2.04315 9.97986C2.29947 10.2112 2.50767 10.5415 2.61444 10.6888C2.74898 10.8744 2.85645 10.9906 2.99823 11.0736C3.03528 11.0953 3.07995 11.1165 3.133 11.1371C3.23332 10.6592 3.42812 10.2074 3.70526 9.80994C3.13814 9.64056 2.56341 9.38681 2.06073 8.98865C1.14363 8.26219 0.549988 7.13762 0.549988 5.51013C0.550104 4.62712 0.827295 3.86957 1.2785 3.25232C1.17345 2.76943 1.11943 1.99736 1.48846 1.07751L1.66425 0.639038L2.13593 0.608765ZM12.5002 13.0834H9.50018V11.5834H12.5002V13.0834Z",
266+
"global-small": "M8.36053 2.00812C12.059 2.16896 15.0002 4.79025 15.0002 8.00031C15 11.3138 11.866 14.0002 8.00018 14.0003C4.13431 14.0003 1.00038 11.3139 1.00018 8.00031C1.00018 4.6866 4.13419 2.00031 8.00018 2.00031L8.36053 2.00812ZM6.52948 8.75031C6.61185 9.90106 6.8755 10.8818 7.22089 11.5726C7.42953 11.9896 7.63939 12.2463 7.80096 12.3831C7.87822 12.4484 7.93446 12.4784 7.96405 12.4905C7.97827 12.4963 7.98801 12.4984 7.99237 12.4993L8.00018 12.5003C8.00172 12.5003 8.00411 12.5001 8.008 12.4993C8.01243 12.4984 8.02207 12.4963 8.03632 12.4905C8.06594 12.4784 8.12208 12.4485 8.1994 12.3831C8.361 12.2463 8.57081 11.9897 8.77948 11.5726C9.12487 10.8818 9.38852 9.90107 9.47089 8.75031H6.52948ZM2.58221 8.75031C2.89307 10.1994 4.08416 11.5247 5.82928 12.139C5.39733 11.2328 5.10611 10.057 5.0246 8.75031H2.58221ZM10.9758 8.75031C10.8942 10.0571 10.6021 11.2327 10.1701 12.139C11.9156 11.5247 13.1073 10.1996 13.4182 8.75031H10.9758ZM5.82928 3.85968C4.08369 4.47402 2.8929 5.80085 2.58221 7.25031H5.0246C5.10609 5.94285 5.39698 4.76616 5.82928 3.85968ZM7.99237 3.50128C7.98799 3.50217 7.97839 3.50423 7.96405 3.51007C7.93443 3.52219 7.87835 3.55203 7.80096 3.61749C7.63935 3.75434 7.42956 4.01082 7.22089 4.42804C6.87548 5.11893 6.61179 6.09938 6.52948 7.25031H9.47089C9.38858 6.09945 9.12485 5.11892 8.77948 4.42804C8.57089 4.011 8.36098 3.75438 8.1994 3.61749C8.12224 3.55222 8.066 3.52226 8.03632 3.51007C8.0222 3.50432 8.01248 3.5022 8.008 3.50128C8.00412 3.50051 8.00172 3.50032 8.00018 3.50031C7.99865 3.50031 7.99633 3.5005 7.99237 3.50128ZM10.1701 3.86066C10.6023 4.76707 10.8943 5.94311 10.9758 7.25031H13.4182C13.1075 5.80075 11.9159 4.47497 10.1701 3.86066Z"
266267
}

0 commit comments

Comments
 (0)