From 5960ccebb9acdbe3eb1911d85233f9542c219adb Mon Sep 17 00:00:00 2001 From: xintaofei Date: Tue, 10 Mar 2026 23:49:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=96=B0=E4=BC=9A=E8=AF=9D?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E6=98=BE=E7=A4=BA=E5=B8=83=E5=B1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/chat/conversation-shell.tsx | 40 ++++++------ .../conversation-detail-panel.tsx | 62 ++++++++++++++++++- src/components/message/message-list-view.tsx | 19 +++--- 3 files changed, 92 insertions(+), 29 deletions(-) diff --git a/src/components/chat/conversation-shell.tsx b/src/components/chat/conversation-shell.tsx index 455adc1..45e4663 100644 --- a/src/components/chat/conversation-shell.tsx +++ b/src/components/chat/conversation-shell.tsx @@ -32,6 +32,7 @@ interface ConversationShellProps { availableCommands?: AvailableCommandInfo[] | null attachmentTabId?: string | null draftStorageKey?: string | null + hideInput?: boolean } export function ConversationShell({ @@ -55,6 +56,7 @@ export function ConversationShell({ availableCommands, attachmentTabId, draftStorageKey, + hideInput = false, }: ConversationShellProps) { return (
@@ -65,24 +67,26 @@ export function ConversationShell({ onRespond={onRespondPermission} /> - + {!hideInput && ( + + )} {error && (
diff --git a/src/components/conversations/conversation-detail-panel.tsx b/src/components/conversations/conversation-detail-panel.tsx index 196cc3c..3454c73 100644 --- a/src/components/conversations/conversation-detail-panel.tsx +++ b/src/components/conversations/conversation-detail-panel.tsx @@ -11,6 +11,7 @@ import { useConnectionLifecycle } from "@/hooks/use-connection-lifecycle" import { MessageListView } from "@/components/message/message-list-view" import { ConversationShell } from "@/components/chat/conversation-shell" import { AgentSelector } from "@/components/chat/agent-selector" +import { ChatInput } from "@/components/chat/chat-input" import { createConversation, openSettingsWindow, @@ -151,6 +152,7 @@ const ConversationTabView = memo(function ConversationTabView({ const [agentConnectError, setAgentConnectError] = useState( null ) + const [hasSentMessage, setHasSentMessage] = useState(false) const hasPersistedConversation = dbConversationId != null const canAutoConnect = @@ -425,6 +427,7 @@ const ConversationTabView = memo(function ConversationTabView({ ) setSendSignal((prev) => prev + 1) setSyncState(effectiveConversationId, "awaiting_persist") + setHasSentMessage(true) lifecycleSend(draft, selectedModeIdArg) const persistedId = dbConvIdRef.current @@ -534,6 +537,9 @@ const ConversationTabView = memo(function ConversationTabView({ [connConnect, connDisconnect, workingDirForConnection] ) + const showDraftHeader = !hasPersistedConversation + const isWelcomeMode = showDraftHeader && !hasSentMessage + const messageListNode = ( ) - const showDraftHeader = !hasPersistedConversation - return ( - {showDraftHeader ? ( + {isWelcomeMode ? ( +
+
+ { + setAgentsLoaded(true) + setUsableAgentCount( + agents.filter((agent) => agent.enabled && agent.available) + .length + ) + }} + onOpenAgentsSettings={handleOpenAgentsSettings} + disabled={isConnecting || dbConversationId != null} + /> + {autoConnectError || agentConnectError ? ( + + ) : null} + +
+
+ ) : showDraftHeader ? (
( -
-

- {t("emptyConversation")} -

-
- ), - [t] + () => + hideEmptyState ? null : ( +
+

+ {t("emptyConversation")} +

+
+ ), + [hideEmptyState, t] ) const agentPlanOverlayKey = liveMessage?.id ?? `history-${conversationId}`