Skip to content

Commit 8fa0498

Browse files
committed
Revert "tui: dock auto-accept after thinking and move Add file to bottom-left"
This reverts commit 69cb49f.
1 parent a5710ed commit 8fa0498

1 file changed

Lines changed: 54 additions & 68 deletions

File tree

packages/app/src/components/prompt-input.tsx

Lines changed: 54 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1214,15 +1214,15 @@ export const PromptInput: Component<PromptInputProps> = (props) => {
12141214
onKeyDown={handleKeyDown}
12151215
classList={{
12161216
"select-text": true,
1217-
"w-full pl-3 pr-2 pt-2 pb-[52px] text-14-regular text-text-strong focus:outline-none whitespace-pre-wrap": true,
1217+
"w-full pl-3 pr-2 pt-2 pb-11 text-14-regular text-text-strong focus:outline-none whitespace-pre-wrap": true,
12181218
"[&_[data-type=file]]:text-syntax-property": true,
12191219
"[&_[data-type=agent]]:text-syntax-type": true,
12201220
"font-mono!": store.mode === "shell",
12211221
}}
12221222
/>
12231223
<Show when={!prompt.dirty()}>
12241224
<div
1225-
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"
1225+
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"
12261226
classList={{ "font-mono!": store.mode === "shell" }}
12271227
>
12281228
{placeholder()}
@@ -1250,6 +1250,30 @@ export const PromptInput: Component<PromptInputProps> = (props) => {
12501250
"pointer-events": buttonsSpring() > 0.5 ? "auto" : "none",
12511251
}}
12521252
>
1253+
<TooltipKeybind
1254+
placement="top"
1255+
title={language.t("prompt.action.attachFile")}
1256+
keybind={command.keybind("file.attach")}
1257+
>
1258+
<Button
1259+
data-action="prompt-attach"
1260+
type="button"
1261+
variant="ghost"
1262+
class="size-8 p-0"
1263+
style={{
1264+
opacity: buttonsSpring(),
1265+
transform: `scale(${0.95 + buttonsSpring() * 0.05})`,
1266+
filter: `blur(${(1 - buttonsSpring()) * 2}px)`,
1267+
}}
1268+
onClick={pick}
1269+
disabled={store.mode !== "normal"}
1270+
tabIndex={store.mode === "normal" ? undefined : -1}
1271+
aria-label={language.t("prompt.action.attachFile")}
1272+
>
1273+
<Icon name="plus" class="size-4.5" />
1274+
</Button>
1275+
</TooltipKeybind>
1276+
12531277
<Tooltip
12541278
placement="top"
12551279
inactive={!prompt.dirty() && !working()}
@@ -1290,35 +1314,42 @@ export const PromptInput: Component<PromptInputProps> = (props) => {
12901314
</div>
12911315

12921316
<div class="pointer-events-none absolute bottom-2 left-2">
1293-
<div
1294-
aria-hidden={store.mode !== "normal"}
1295-
class="pointer-events-auto"
1296-
style={{
1297-
"pointer-events": buttonsSpring() > 0.5 ? "auto" : "none",
1298-
}}
1299-
>
1317+
<div class="pointer-events-auto">
13001318
<TooltipKeybind
13011319
placement="top"
13021320
gutter={8}
1303-
title={language.t("prompt.action.attachFile")}
1304-
keybind={command.keybind("file.attach")}
1321+
title={language.t(
1322+
accepting() ? "command.permissions.autoaccept.disable" : "command.permissions.autoaccept.enable",
1323+
)}
1324+
keybind={command.keybind("permissions.autoaccept")}
13051325
>
13061326
<Button
1307-
data-action="prompt-attach"
1308-
type="button"
1327+
data-action="prompt-permissions"
13091328
variant="ghost"
1310-
class="size-8 p-0"
1311-
style={{
1312-
opacity: buttonsSpring(),
1313-
transform: `scale(${0.95 + buttonsSpring() * 0.05})`,
1314-
filter: `blur(${(1 - buttonsSpring()) * 2}px)`,
1329+
onClick={() => {
1330+
if (!params.id) {
1331+
permission.toggleAutoAcceptDirectory(sdk.directory)
1332+
return
1333+
}
1334+
permission.toggleAutoAccept(params.id, sdk.directory)
13151335
}}
1316-
onClick={pick}
1317-
disabled={store.mode !== "normal"}
1318-
tabIndex={store.mode === "normal" ? undefined : -1}
1319-
aria-label={language.t("prompt.action.attachFile")}
1336+
classList={{
1337+
"size-6 flex items-center justify-center": true,
1338+
"text-text-base": !accepting(),
1339+
"hover:bg-surface-success-base": accepting(),
1340+
}}
1341+
aria-label={
1342+
accepting()
1343+
? language.t("command.permissions.autoaccept.disable")
1344+
: language.t("command.permissions.autoaccept.enable")
1345+
}
1346+
aria-pressed={accepting()}
13201347
>
1321-
<Icon name="plus" class="size-4.5" />
1348+
<Icon
1349+
name="chevron-double-right"
1350+
size="small"
1351+
classList={{ "text-icon-success-base": accepting() }}
1352+
/>
13221353
</Button>
13231354
</TooltipKeybind>
13241355
</div>
@@ -1463,51 +1494,6 @@ export const PromptInput: Component<PromptInputProps> = (props) => {
14631494
variant="ghost"
14641495
/>
14651496
</TooltipKeybind>
1466-
1467-
<TooltipKeybind
1468-
placement="top"
1469-
gutter={4}
1470-
title={language.t(
1471-
accepting() ? "command.permissions.autoaccept.disable" : "command.permissions.autoaccept.enable",
1472-
)}
1473-
keybind={command.keybind("permissions.autoaccept")}
1474-
>
1475-
<Button
1476-
data-action="prompt-permissions"
1477-
type="button"
1478-
variant="ghost"
1479-
class="size-7 p-0 flex items-center justify-center"
1480-
style={{
1481-
opacity: buttonsSpring(),
1482-
transform: `scale(${0.95 + buttonsSpring() * 0.05})`,
1483-
filter: `blur(${(1 - buttonsSpring()) * 2}px)`,
1484-
"pointer-events": buttonsSpring() > 0.5 ? "auto" : "none",
1485-
}}
1486-
onClick={() => {
1487-
if (!params.id) {
1488-
permission.toggleAutoAcceptDirectory(sdk.directory)
1489-
return
1490-
}
1491-
permission.toggleAutoAccept(params.id, sdk.directory)
1492-
}}
1493-
classList={{
1494-
"text-text-base": !accepting(),
1495-
"hover:bg-surface-success-base": accepting(),
1496-
}}
1497-
aria-label={
1498-
accepting()
1499-
? language.t("command.permissions.autoaccept.disable")
1500-
: language.t("command.permissions.autoaccept.enable")
1501-
}
1502-
aria-pressed={accepting()}
1503-
>
1504-
<Icon
1505-
name="chevron-double-right"
1506-
size="small"
1507-
classList={{ "text-icon-success-base": accepting() }}
1508-
/>
1509-
</Button>
1510-
</TooltipKeybind>
15111497
</div>
15121498
</div>
15131499
<div class="shrink-0">

0 commit comments

Comments
 (0)