mirror of
https://gitea.toothfairyai.com/ToothFairyAI/tf_code.git
synced 2026-04-14 12:44:36 +00:00
tui: dock auto-accept after thinking and move Add file to bottom-left
Auto-accept now lives in the footer dock beside the thinking control so it stays easy to find without crowding the text box. The Add file button moves to the bottom-left of the editor and the input gets a bit more bottom padding so the control row doesn’t overlap what you’re typing.
This commit is contained in:
@@ -1214,7 +1214,7 @@ export const PromptInput: Component<PromptInputProps> = (props) => {
|
|||||||
onKeyDown={handleKeyDown}
|
onKeyDown={handleKeyDown}
|
||||||
classList={{
|
classList={{
|
||||||
"select-text": true,
|
"select-text": true,
|
||||||
"w-full pl-3 pr-2 pt-2 pb-11 text-14-regular text-text-strong focus:outline-none whitespace-pre-wrap": true,
|
"w-full pl-3 pr-2 pt-2 pb-[52px] text-14-regular text-text-strong focus:outline-none whitespace-pre-wrap": true,
|
||||||
"[&_[data-type=file]]:text-syntax-property": true,
|
"[&_[data-type=file]]:text-syntax-property": true,
|
||||||
"[&_[data-type=agent]]:text-syntax-type": true,
|
"[&_[data-type=agent]]:text-syntax-type": true,
|
||||||
"font-mono!": store.mode === "shell",
|
"font-mono!": store.mode === "shell",
|
||||||
@@ -1222,7 +1222,7 @@ export const PromptInput: Component<PromptInputProps> = (props) => {
|
|||||||
/>
|
/>
|
||||||
<Show when={!prompt.dirty()}>
|
<Show when={!prompt.dirty()}>
|
||||||
<div
|
<div
|
||||||
class="absolute top-0 inset-x-0 pl-3 pr-2 pt-2 pb-11 text-14-regular text-text-weak pointer-events-none whitespace-nowrap truncate"
|
class="absolute top-0 inset-x-0 pl-3 pr-2 pt-2 pb-[52px] text-14-regular text-text-weak pointer-events-none whitespace-nowrap truncate"
|
||||||
classList={{ "font-mono!": store.mode === "shell" }}
|
classList={{ "font-mono!": store.mode === "shell" }}
|
||||||
>
|
>
|
||||||
{placeholder()}
|
{placeholder()}
|
||||||
@@ -1250,30 +1250,6 @@ export const PromptInput: Component<PromptInputProps> = (props) => {
|
|||||||
"pointer-events": buttonsSpring() > 0.5 ? "auto" : "none",
|
"pointer-events": buttonsSpring() > 0.5 ? "auto" : "none",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<TooltipKeybind
|
|
||||||
placement="top"
|
|
||||||
title={language.t("prompt.action.attachFile")}
|
|
||||||
keybind={command.keybind("file.attach")}
|
|
||||||
>
|
|
||||||
<Button
|
|
||||||
data-action="prompt-attach"
|
|
||||||
type="button"
|
|
||||||
variant="ghost"
|
|
||||||
class="size-8 p-0"
|
|
||||||
style={{
|
|
||||||
opacity: buttonsSpring(),
|
|
||||||
transform: `scale(${0.95 + buttonsSpring() * 0.05})`,
|
|
||||||
filter: `blur(${(1 - buttonsSpring()) * 2}px)`,
|
|
||||||
}}
|
|
||||||
onClick={pick}
|
|
||||||
disabled={store.mode !== "normal"}
|
|
||||||
tabIndex={store.mode === "normal" ? undefined : -1}
|
|
||||||
aria-label={language.t("prompt.action.attachFile")}
|
|
||||||
>
|
|
||||||
<Icon name="plus" class="size-4.5" />
|
|
||||||
</Button>
|
|
||||||
</TooltipKeybind>
|
|
||||||
|
|
||||||
<Tooltip
|
<Tooltip
|
||||||
placement="top"
|
placement="top"
|
||||||
inactive={!prompt.dirty() && !working()}
|
inactive={!prompt.dirty() && !working()}
|
||||||
@@ -1314,42 +1290,35 @@ export const PromptInput: Component<PromptInputProps> = (props) => {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="pointer-events-none absolute bottom-2 left-2">
|
<div class="pointer-events-none absolute bottom-2 left-2">
|
||||||
<div class="pointer-events-auto">
|
<div
|
||||||
|
aria-hidden={store.mode !== "normal"}
|
||||||
|
class="pointer-events-auto"
|
||||||
|
style={{
|
||||||
|
"pointer-events": buttonsSpring() > 0.5 ? "auto" : "none",
|
||||||
|
}}
|
||||||
|
>
|
||||||
<TooltipKeybind
|
<TooltipKeybind
|
||||||
placement="top"
|
placement="top"
|
||||||
gutter={8}
|
gutter={8}
|
||||||
title={language.t(
|
title={language.t("prompt.action.attachFile")}
|
||||||
accepting() ? "command.permissions.autoaccept.disable" : "command.permissions.autoaccept.enable",
|
keybind={command.keybind("file.attach")}
|
||||||
)}
|
|
||||||
keybind={command.keybind("permissions.autoaccept")}
|
|
||||||
>
|
>
|
||||||
<Button
|
<Button
|
||||||
data-action="prompt-permissions"
|
data-action="prompt-attach"
|
||||||
|
type="button"
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
onClick={() => {
|
class="size-8 p-0"
|
||||||
if (!params.id) {
|
style={{
|
||||||
permission.toggleAutoAcceptDirectory(sdk.directory)
|
opacity: buttonsSpring(),
|
||||||
return
|
transform: `scale(${0.95 + buttonsSpring() * 0.05})`,
|
||||||
}
|
filter: `blur(${(1 - buttonsSpring()) * 2}px)`,
|
||||||
permission.toggleAutoAccept(params.id, sdk.directory)
|
|
||||||
}}
|
}}
|
||||||
classList={{
|
onClick={pick}
|
||||||
"size-6 flex items-center justify-center": true,
|
disabled={store.mode !== "normal"}
|
||||||
"text-text-base": !accepting(),
|
tabIndex={store.mode === "normal" ? undefined : -1}
|
||||||
"hover:bg-surface-success-base": accepting(),
|
aria-label={language.t("prompt.action.attachFile")}
|
||||||
}}
|
|
||||||
aria-label={
|
|
||||||
accepting()
|
|
||||||
? language.t("command.permissions.autoaccept.disable")
|
|
||||||
: language.t("command.permissions.autoaccept.enable")
|
|
||||||
}
|
|
||||||
aria-pressed={accepting()}
|
|
||||||
>
|
>
|
||||||
<Icon
|
<Icon name="plus" class="size-4.5" />
|
||||||
name="chevron-double-right"
|
|
||||||
size="small"
|
|
||||||
classList={{ "text-icon-success-base": accepting() }}
|
|
||||||
/>
|
|
||||||
</Button>
|
</Button>
|
||||||
</TooltipKeybind>
|
</TooltipKeybind>
|
||||||
</div>
|
</div>
|
||||||
@@ -1494,6 +1463,51 @@ export const PromptInput: Component<PromptInputProps> = (props) => {
|
|||||||
variant="ghost"
|
variant="ghost"
|
||||||
/>
|
/>
|
||||||
</TooltipKeybind>
|
</TooltipKeybind>
|
||||||
|
|
||||||
|
<TooltipKeybind
|
||||||
|
placement="top"
|
||||||
|
gutter={4}
|
||||||
|
title={language.t(
|
||||||
|
accepting() ? "command.permissions.autoaccept.disable" : "command.permissions.autoaccept.enable",
|
||||||
|
)}
|
||||||
|
keybind={command.keybind("permissions.autoaccept")}
|
||||||
|
>
|
||||||
|
<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",
|
||||||
|
}}
|
||||||
|
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>
|
||||||
</div>
|
</div>
|
||||||
<div class="shrink-0">
|
<div class="shrink-0">
|
||||||
|
|||||||
Reference in New Issue
Block a user