@@ -957,14 +957,6 @@ export const PromptInput: Component<PromptInputProps> = (props) => {
957957 return permission . isAutoAccepting ( id , sdk . directory )
958958 } )
959959
960- const flip = ( ) => {
961- if ( ! params . id ) {
962- permission . toggleAutoAcceptDirectory ( sdk . directory )
963- return
964- }
965- permission . toggleAutoAccept ( params . id , sdk . directory )
966- }
967-
968960 const { abort, handleSubmit } = createPromptSubmit ( {
969961 info,
970962 imageAttachments,
@@ -1475,32 +1467,41 @@ export const PromptInput: Component<PromptInputProps> = (props) => {
14751467 ) }
14761468 keybind = { command . keybind ( "permissions.autoaccept" ) }
14771469 >
1478- < Select
1479- size = "normal"
1480- options = { [ "default" , "autoaccept" ] as const }
1481- current = { accepting ( ) ? "autoaccept" : "default" }
1482- label = { ( x ) =>
1483- x === "autoaccept"
1484- ? language . t ( "command.permissions.autoaccept.enable" )
1485- : `${ language . t ( "common.default" ) } ${ language . t ( "command.category.permissions" ) } `
1486- }
1487- onSelect = { ( x ) => {
1488- if ( ! x ) return
1489- if ( x === "autoaccept" && accepting ( ) ) return
1490- if ( x === "default" && ! accepting ( ) ) return
1491- flip ( )
1492- } }
1493- class = "max-w-[220px]"
1494- valueClass = "truncate text-13-regular"
1495- triggerStyle = { {
1496- height : "28px" ,
1470+ < Button
1471+ data-action = "prompt-permissions"
1472+ type = "button"
1473+ variant = "ghost"
1474+ class = "size-7 p-0 flex items-center justify-center"
1475+ style = { {
14971476 opacity : buttonsSpring ( ) ,
14981477 transform : `scale(${ 0.95 + buttonsSpring ( ) * 0.05 } )` ,
14991478 filter : `blur(${ ( 1 - buttonsSpring ( ) ) * 2 } px)` ,
15001479 "pointer-events" : buttonsSpring ( ) > 0.5 ? "auto" : "none" ,
15011480 } }
1502- variant = "ghost"
1503- />
1481+ onClick = { ( ) => {
1482+ if ( ! params . id ) {
1483+ permission . toggleAutoAcceptDirectory ( sdk . directory )
1484+ return
1485+ }
1486+ permission . toggleAutoAccept ( params . id , sdk . directory )
1487+ } }
1488+ classList = { {
1489+ "text-text-base" : ! accepting ( ) ,
1490+ "hover:bg-surface-success-base" : accepting ( ) ,
1491+ } }
1492+ aria-label = {
1493+ accepting ( )
1494+ ? language . t ( "command.permissions.autoaccept.disable" )
1495+ : language . t ( "command.permissions.autoaccept.enable" )
1496+ }
1497+ aria-pressed = { accepting ( ) }
1498+ >
1499+ < Icon
1500+ name = "chevron-double-right"
1501+ size = "small"
1502+ classList = { { "text-icon-success-base" : accepting ( ) } }
1503+ />
1504+ </ Button >
15041505 </ TooltipKeybind >
15051506 </ div >
15061507 </ div >
0 commit comments