@@ -2,27 +2,17 @@ import { createSignal, onMount, For } from "solid-js";
22import { appStore } from "../../stores/app-store" ;
33import * as ipc from "../../ipc" ;
44
5- const PERMISSION_MODES = [
6- { value : "auto" , label : "Auto" , description : "AI decides when to ask (recommended)" } ,
7- { value : "acceptEdits" , label : "Accept Edits" , description : "Auto-approve file operations" } ,
8- { value : "bypassPermissions" , label : "Bypass All" , description : "Auto-approve everything" } ,
9- { value : "plan" , label : "Plan Mode" , description : "Only plans, doesn't execute" } ,
10- { value : "default" , label : "Default" , description : "Ask for everything (requires TTY, may hang)" } ,
11- ] as const ;
125
136export function SettingsOverlay ( ) {
147 const { store, setStore } = appStore ;
158 const [ claudePath , setClaudePath ] = createSignal ( "claude" ) ;
169 const [ codexPath , setCodexPath ] = createSignal ( "codex" ) ;
17- const [ permissionMode , setPermissionMode ] = createSignal ( "bypassPermissions" ) ;
1810
1911 onMount ( async ( ) => {
2012 const cp = await ipc . getSetting ( "claude_path" ) ;
2113 const cx = await ipc . getSetting ( "codex_path" ) ;
22- const pm = await ipc . getSetting ( "permission_mode" ) ;
2314 if ( cp ) setClaudePath ( cp ) ;
2415 if ( cx ) setCodexPath ( cx ) ;
25- if ( pm ) setPermissionMode ( pm ) ;
2616 } ) ;
2717
2818 function close ( ) {
@@ -59,27 +49,6 @@ export function SettingsOverlay() {
5949 />
6050 </ div >
6151
62- < div class = "settings-section" >
63- < label > Permission Mode</ label >
64- < div class = "settings-perm-list" >
65- < For each = { PERMISSION_MODES } >
66- { ( mode ) => (
67- < button
68- class = "settings-perm-option"
69- classList = { { "settings-perm-option--active" : permissionMode ( ) === mode . value } }
70- onClick = { ( ) => {
71- setPermissionMode ( mode . value ) ;
72- ipc . setSetting ( "permission_mode" , mode . value ) ;
73- } }
74- >
75- < span class = "settings-perm-label" > { mode . label } </ span >
76- < span class = "settings-perm-desc" > { mode . description } </ span >
77- </ button >
78- ) }
79- </ For >
80- </ div >
81- < span class = "settings-hint" > Takes effect on next session.</ span >
82- </ div >
8352
8453 < div class = "settings-section" >
8554 < label > Auto-name Threads</ label >
@@ -148,38 +117,6 @@ export function SettingsOverlay() {
148117 font-family: var(--font-mono);
149118 font-size: 12px;
150119 }
151- .settings-perm-list {
152- display: flex;
153- flex-direction: column;
154- gap: 3px;
155- background: var(--bg-muted);
156- border-radius: var(--radius-md);
157- padding: 3px;
158- }
159- .settings-perm-option {
160- display: flex;
161- flex-direction: column;
162- gap: 1px;
163- padding: 7px 10px;
164- border-radius: var(--radius-sm);
165- text-align: left;
166- transition: background 0.1s;
167- }
168- .settings-perm-option:hover { background: var(--bg-hover); }
169- .settings-perm-option--active {
170- background: var(--bg-accent);
171- box-shadow: 0 1px 3px rgba(0,0,0,0.15);
172- }
173- .settings-perm-label {
174- font-size: 12px;
175- font-weight: 600;
176- color: var(--text);
177- }
178- .settings-perm-option--active .settings-perm-label { color: var(--primary); }
179- .settings-perm-desc {
180- font-size: 10px;
181- color: var(--text-tertiary);
182- }
183120 .settings-hint {
184121 display: block;
185122 font-size: 10px;
0 commit comments