@@ -252,93 +252,98 @@ function ProviderEnvironmentSection(props: {
252252 ] ) ;
253253
254254 return (
255- < div className = "mt-3 min-w-0 space-y-2" >
256- { rows . map ( ( variable , index ) => (
257- < div key = { variable . id } className = "flex min-w-0 items-center gap-1.5" >
258- < DraftInput
259- size = "sm"
260- className = "w-44 shrink-0 font-mono"
261- value = { variable . name }
262- onCommit = { ( name ) => updateVariable ( variable . id , { name : name . trim ( ) } ) }
263- placeholder = "VARIABLE_NAME"
264- spellCheck = { false }
265- aria-label = { `Environment variable name ${ index + 1 } ` }
266- />
267- < span className = "text-xs text-muted-foreground" aria-hidden >
268- =
269- </ span >
270- < DraftInput
271- size = "sm"
272- className = "min-w-0 flex-1 font-mono"
273- value = { variable . valueRedacted ? "" : variable . value }
274- onCommit = { ( value ) => updateVariable ( variable . id , { value } ) }
275- type = { variable . sensitive ? "password" : undefined }
276- autoComplete = "off"
277- placeholder = {
278- variable . valueRedacted ? "Stored secret, enter a new value to replace" : "value"
279- }
280- spellCheck = { false }
281- aria-label = { `Environment variable value ${ index + 1 } ` }
282- />
283- < Tooltip >
284- < TooltipTrigger
285- render = {
286- < Button
287- type = "button"
288- size = "icon-micro"
289- variant = "ghost-muted"
290- className = { cn (
291- "[--control-icon-color:currentColor]" ,
292- variable . sensitive && "text-foreground" ,
293- ) }
294- onClick = { ( ) => {
295- const sensitive = ! variable . sensitive ;
296- updateVariable ( variable . id , {
297- sensitive,
298- ...( sensitive && variable . valueRedacted === undefined
299- ? { }
300- : { valueRedacted : sensitive ? variable . valueRedacted : false } ) ,
301- } ) ;
302- } }
303- aria-pressed = { variable . sensitive }
304- aria-label = { `Mark environment variable ${ variable . name || index + 1 } as sensitive` }
305- >
306- { variable . sensitive ? (
307- < LockIcon className = "size-3" />
308- ) : (
309- < LockOpenIcon className = "size-3" />
310- ) }
311- </ Button >
312- }
313- />
314- < TooltipPopup side = "top" >
315- { variable . sensitive ? "Sensitive, stored separately" : "Plain text" }
316- </ TooltipPopup >
317- </ Tooltip >
318- < Button
319- type = "button"
320- size = "icon-micro"
321- variant = "ghost-muted"
322- className = "[--control-icon-color:currentColor] hover:text-destructive"
323- onClick = { ( ) => removeVariable ( variable . id ) }
324- aria-label = { `Remove environment variable ${ variable . name || index + 1 } ` }
325- >
326- < XIcon className = "size-3" />
327- </ Button >
328- </ div >
329- ) ) }
330- < div className = "flex min-h-[1.875rem] flex-wrap items-center justify-end gap-x-3 gap-y-1" >
331- { rows . length > 0 ? (
332- < span className = "mr-auto text-xs text-muted-foreground" >
333- Sensitive values are stored separately and never returned to the app.
334- </ span >
335- ) : null }
336- < Button type = "button" size = "xs" variant = "ghost-muted" onClick = { addVariable } >
255+ < SettingsRow
256+ title = "Variables"
257+ description = "API keys, base URLs, and other per-instance CLI settings."
258+ control = {
259+ < Button type = "button" size = "sm" variant = "outline" onClick = { addVariable } >
337260 < PlusIcon className = "size-3" />
338261 Add variable
339262 </ Button >
340- </ div >
341- </ div >
263+ }
264+ >
265+ { rows . length > 0 ? (
266+ < div className = "mt-3 min-w-0 space-y-2 pb-2" >
267+ { rows . map ( ( variable , index ) => (
268+ < div key = { variable . id } className = "flex min-w-0 flex-wrap items-center gap-1.5" >
269+ < DraftInput
270+ size = "sm"
271+ className = "w-full min-w-0 font-mono sm:w-44 sm:shrink-0"
272+ value = { variable . name }
273+ onCommit = { ( name ) => updateVariable ( variable . id , { name : name . trim ( ) } ) }
274+ placeholder = "VARIABLE_NAME"
275+ spellCheck = { false }
276+ aria-label = { `Environment variable name ${ index + 1 } ` }
277+ />
278+ < span className = "hidden text-xs text-muted-foreground sm:inline" aria-hidden >
279+ =
280+ </ span >
281+ < DraftInput
282+ size = "sm"
283+ className = "min-w-0 flex-1 font-mono"
284+ value = { variable . valueRedacted ? "" : variable . value }
285+ onCommit = { ( value ) => updateVariable ( variable . id , { value } ) }
286+ type = { variable . sensitive ? "password" : undefined }
287+ autoComplete = "off"
288+ placeholder = {
289+ variable . valueRedacted ? "Stored secret, enter a new value to replace" : "value"
290+ }
291+ spellCheck = { false }
292+ aria-label = { `Environment variable value ${ index + 1 } ` }
293+ />
294+ < Tooltip >
295+ < TooltipTrigger
296+ render = {
297+ < Button
298+ type = "button"
299+ size = "icon-micro"
300+ variant = "ghost-muted"
301+ className = { cn (
302+ "[--control-icon-color:currentColor]" ,
303+ variable . sensitive && "text-foreground" ,
304+ ) }
305+ onClick = { ( ) => {
306+ const sensitive = ! variable . sensitive ;
307+ updateVariable ( variable . id , {
308+ sensitive,
309+ ...( sensitive && variable . valueRedacted === undefined
310+ ? { }
311+ : { valueRedacted : sensitive ? variable . valueRedacted : false } ) ,
312+ } ) ;
313+ } }
314+ aria-pressed = { variable . sensitive }
315+ aria-label = { `Mark environment variable ${ variable . name || index + 1 } as sensitive` }
316+ >
317+ { variable . sensitive ? (
318+ < LockIcon className = "size-3" />
319+ ) : (
320+ < LockOpenIcon className = "size-3" />
321+ ) }
322+ </ Button >
323+ }
324+ />
325+ < TooltipPopup side = "top" >
326+ { variable . sensitive ? "Sensitive, stored separately" : "Plain text" }
327+ </ TooltipPopup >
328+ </ Tooltip >
329+ < Button
330+ type = "button"
331+ size = "icon-micro"
332+ variant = "ghost-muted"
333+ className = "[--control-icon-color:currentColor] hover:text-destructive"
334+ onClick = { ( ) => removeVariable ( variable . id ) }
335+ aria-label = { `Remove environment variable ${ variable . name || index + 1 } ` }
336+ >
337+ < XIcon className = "size-3" />
338+ </ Button >
339+ </ div >
340+ ) ) }
341+ < p className = "text-xs text-muted-foreground" >
342+ Sensitive values are stored separately and never returned to the app.
343+ </ p >
344+ </ div >
345+ ) : null }
346+ </ SettingsRow >
342347 ) ;
343348}
344349
@@ -837,11 +842,7 @@ export function ProviderInstanceCard({
837842 />
838843 </ SettingsSection >
839844
840- { setup ? (
841- < SettingsSection title = "Setup" >
842- < div className = "px-3 py-3 sm:px-4" > { setup } </ div >
843- </ SettingsSection >
844- ) : null }
845+ { setup ? < SettingsSection title = "Setup" > { setup } </ SettingsSection > : null }
845846
846847 < SettingsSection
847848 title = "Runtime"
@@ -877,15 +878,10 @@ export function ProviderInstanceCard({
877878 aria-disabled = { readOnly || undefined }
878879 className = { readOnly ? "opacity-50 select-none" : undefined }
879880 >
880- < SettingsRow
881- title = "Variables"
882- description = "API keys, base URLs, and other per-instance CLI settings."
883- >
884- < ProviderEnvironmentSection
885- environment = { instance . environment ?? [ ] }
886- onChange = { updateEnvironment }
887- />
888- </ SettingsRow >
881+ < ProviderEnvironmentSection
882+ environment = { instance . environment ?? [ ] }
883+ onChange = { updateEnvironment }
884+ />
889885 </ SettingsSection >
890886
891887 { driverOption !== undefined ? (
0 commit comments