Skip to content

Commit 8719597

Browse files
authored
feat: show helper text for saved permissions (#11256)
Helper text appears when project or global choice is picked shows where they are saved
1 parent 4a20bed commit 8719597

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

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

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,20 @@
3737
let selectedDenyDecision = $state<DenyDecision>('denyOnce');
3838
let selectedWildcardDecision = $state<WildcardDecision>('precise');
3939
40+
const helperText = $derived.by(() => {
41+
const isProject =
42+
selectedAllowDecision === 'allowProject' || selectedDenyDecision === 'denyProject';
43+
const isAlways =
44+
selectedAllowDecision === 'allowAlways' || selectedDenyDecision === 'denyAlways';
45+
46+
if (isProject) {
47+
return 'Permissions will be saved to .claude/settings.local.json';
48+
} else if (isAlways) {
49+
return 'Permissions will be saved to ~/.claude/settings.json';
50+
}
51+
return null;
52+
});
53+
4054
const allowLabels: Record<AllowDecision, string> = {
4155
allowOnce: 'Allow once',
4256
allowProject: 'Allow this project',
@@ -87,6 +101,15 @@
87101
<Codeblock content={formatToolCall(toolCall)} />
88102
</div>
89103

104+
{#if helperText}
105+
<div class="tool-call__helper-text">
106+
<Icon name="info-small-outline" />
107+
<p class="text-12">
108+
{helperText}
109+
</p>
110+
</div>
111+
{/if}
112+
90113
<div class="tool-call__actions">
91114
{#if wildcardSelector.show}
92115
<Button
@@ -241,6 +264,16 @@
241264
gap: 8px;
242265
}
243266
267+
.tool-call__helper-text {
268+
display: flex;
269+
align-items: center;
270+
padding: 10px 12px;
271+
gap: 8px;
272+
border-top: 1px solid var(--clr-border-2);
273+
background-color: var(--clr-bg-1);
274+
color: var(--clr-text-2);
275+
}
276+
244277
.tool-call__actions {
245278
display: flex;
246279
align-items: center;

0 commit comments

Comments
 (0)