diff --git a/frontend/src/components/console/task/chat-inputbox.tsx b/frontend/src/components/console/task/chat-inputbox.tsx index f09c31c6..764cfd70 100644 --- a/frontend/src/components/console/task/chat-inputbox.tsx +++ b/frontend/src/components/console/task/chat-inputbox.tsx @@ -1100,7 +1100,7 @@ export const TaskChatInputBox = React.forwardRef - -
-
+ +
+
- @@ -1168,7 +1168,7 @@ export const TaskChatInputBox = React.forwardRef setWhiteboardDialogOpen(true)} @@ -1212,16 +1212,20 @@ export const TaskChatInputBox = React.forwardRef ))}
-
+
{!IS_OFFLINE_EDITION && ( )} {queuedInput ? ( {autoSendingQueuedInput ? ( - t("taskDetail.chat.autoSending") + {t("taskDetail.chat.autoSending")} ) : ( <> - {t("taskDetail.chat.waitingAutoSend")} - {t("taskDetail.chat.cancelAutoSend")} + {t("taskDetail.chat.waitingAutoSend")} + {t("taskDetail.chat.cancelAutoSend")} )} ) : isExecuting ? ( - {t("taskDetail.common.send")} + {t("taskDetail.common.send")} ) : ( - {t("taskDetail.common.send")} + {t("taskDetail.common.send")} )}
diff --git a/frontend/test/task-chat-input-mobile-layout.test.mjs b/frontend/test/task-chat-input-mobile-layout.test.mjs new file mode 100644 index 00000000..6fa3d287 --- /dev/null +++ b/frontend/test/task-chat-input-mobile-layout.test.mjs @@ -0,0 +1,41 @@ +import assert from "node:assert/strict"; +import { readFileSync } from "node:fs"; +import test from "node:test"; + +const source = readFileSync( + new URL("../src/components/console/task/chat-inputbox.tsx", import.meta.url), + "utf8", +); + +test("任务对话输入栏在窄屏隔离输入区和操作区", () => { + assert.match( + source, + /className="min-h-8 min-w-0 w-full max-h-36 resize-none overflow-y-auto/, + ); + assert.match( + source, + /className="flex w-full min-w-0 flex-row items-center justify-between gap-2"/, + ); + assert.match( + source, + /className="no-scrollbar flex min-w-0 flex-1 flex-row items-center gap-2 overflow-x-auto"/, + ); + assert.match( + source, + /className="flex shrink-0 flex-row items-center gap-2"/, + ); +}); + +test("手机端操作保持 44px 触控区和发送可访问名称", () => { + const mobileTouchTargets = source.match(/max-sm:size-11/g) ?? []; + assert.ok(mobileTouchTargets.length >= 6); + assert.match(source, /aria-label=\{t\("taskDetail\.common\.send"\)\}/); + assert.match( + source, + /\{t\("taskDetail\.common\.send"\)\}<\/span>/, + ); + assert.match( + source, + /