mirror of
https://gitea.toothfairyai.com/ToothFairyAI/tf_code.git
synced 2026-03-30 05:43:55 +00:00
Revert "tui: expose auto-accept as a permissions select"
This reverts commit 12d862dbd3ec0cea6da7daa8e53ec71183480a9b.
This commit is contained in:
parent
f03288b411
commit
0c245886fe
@ -957,14 +957,6 @@ export const PromptInput: Component<PromptInputProps> = (props) => {
|
||||
return permission.isAutoAccepting(id, sdk.directory)
|
||||
})
|
||||
|
||||
const flip = () => {
|
||||
if (!params.id) {
|
||||
permission.toggleAutoAcceptDirectory(sdk.directory)
|
||||
return
|
||||
}
|
||||
permission.toggleAutoAccept(params.id, sdk.directory)
|
||||
}
|
||||
|
||||
const { abort, handleSubmit } = createPromptSubmit({
|
||||
info,
|
||||
imageAttachments,
|
||||
@ -1475,32 +1467,41 @@ export const PromptInput: Component<PromptInputProps> = (props) => {
|
||||
)}
|
||||
keybind={command.keybind("permissions.autoaccept")}
|
||||
>
|
||||
<Select
|
||||
size="normal"
|
||||
options={["default", "autoaccept"] as const}
|
||||
current={accepting() ? "autoaccept" : "default"}
|
||||
label={(x) =>
|
||||
x === "autoaccept"
|
||||
? language.t("command.permissions.autoaccept.enable")
|
||||
: `${language.t("common.default")} ${language.t("command.category.permissions")}`
|
||||
}
|
||||
onSelect={(x) => {
|
||||
if (!x) return
|
||||
if (x === "autoaccept" && accepting()) return
|
||||
if (x === "default" && !accepting()) return
|
||||
flip()
|
||||
}}
|
||||
class="max-w-[220px]"
|
||||
valueClass="truncate text-13-regular"
|
||||
triggerStyle={{
|
||||
height: "28px",
|
||||
<Button
|
||||
data-action="prompt-permissions"
|
||||
type="button"
|
||||
variant="ghost"
|
||||
class="size-7 p-0 flex items-center justify-center"
|
||||
style={{
|
||||
opacity: buttonsSpring(),
|
||||
transform: `scale(${0.95 + buttonsSpring() * 0.05})`,
|
||||
filter: `blur(${(1 - buttonsSpring()) * 2}px)`,
|
||||
"pointer-events": buttonsSpring() > 0.5 ? "auto" : "none",
|
||||
}}
|
||||
variant="ghost"
|
||||
/>
|
||||
onClick={() => {
|
||||
if (!params.id) {
|
||||
permission.toggleAutoAcceptDirectory(sdk.directory)
|
||||
return
|
||||
}
|
||||
permission.toggleAutoAccept(params.id, sdk.directory)
|
||||
}}
|
||||
classList={{
|
||||
"text-text-base": !accepting(),
|
||||
"hover:bg-surface-success-base": accepting(),
|
||||
}}
|
||||
aria-label={
|
||||
accepting()
|
||||
? language.t("command.permissions.autoaccept.disable")
|
||||
: language.t("command.permissions.autoaccept.enable")
|
||||
}
|
||||
aria-pressed={accepting()}
|
||||
>
|
||||
<Icon
|
||||
name="chevron-double-right"
|
||||
size="small"
|
||||
classList={{ "text-icon-success-base": accepting() }}
|
||||
/>
|
||||
</Button>
|
||||
</TooltipKeybind>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user