统一画布代理文本与附件输入约束
要求用户消息包含非空文本,附件仅作为消息上下文。 同步后端领域校验、接口错误和请求测试。 禁用前端纯附件发送并更新交互回归测试。 保留发送失败时的草稿与附件恢复行为。
This commit is contained in:
+2
-7
@@ -134,6 +134,7 @@ export function EditorAgentConversationPanelView({
|
||||
isWaiting ||
|
||||
isToolCallActionPending ||
|
||||
isPastingAttachment ||
|
||||
!draftText.trim() ||
|
||||
!hasProject;
|
||||
const currentConversationTitle = activeConversation?.title ?? '新对话';
|
||||
|
||||
@@ -147,9 +148,6 @@ export function EditorAgentConversationPanelView({
|
||||
return;
|
||||
}
|
||||
const text = draftText.trim();
|
||||
if (!text && !attachments.length) {
|
||||
return;
|
||||
}
|
||||
setDraftText('');
|
||||
const nextAttachments = consumeAttachments();
|
||||
void sendMessage(text, nextAttachments).catch(() => {
|
||||
@@ -366,10 +364,7 @@ export function EditorAgentConversationPanelView({
|
||||
<button
|
||||
type="submit"
|
||||
className="inline-flex h-10 min-w-16 shrink-0 items-center justify-center gap-1.5 rounded-full bg-slate-900 px-3 text-sm font-semibold text-white disabled:opacity-45"
|
||||
disabled={
|
||||
isMessageSubmissionBlocked ||
|
||||
(!draftText.trim() && !attachments.length)
|
||||
}
|
||||
disabled={isMessageSubmissionBlocked}
|
||||
>
|
||||
<Send className="h-3.5 w-3.5" aria-hidden="true" />
|
||||
发送
|
||||
|
||||
Reference in New Issue
Block a user