diff --git a/frontend/src/app/workspace/agents/[agent_name]/chats/[thread_id]/page.tsx b/frontend/src/app/workspace/agents/[agent_name]/chats/[thread_id]/page.tsx index 9b9cb59f..b7ed7305 100644 --- a/frontend/src/app/workspace/agents/[agent_name]/chats/[thread_id]/page.tsx +++ b/frontend/src/app/workspace/agents/[agent_name]/chats/[thread_id]/page.tsx @@ -166,7 +166,6 @@ export default function AgentChatPage() { threadId={threadId} autoFocus={isNewThread} showWelcomeStyle={isNewThread} - hasSubmitted={!isNewThread} status={ thread.error ? "error" diff --git a/frontend/src/app/workspace/chats/[thread_id]/page.tsx b/frontend/src/app/workspace/chats/[thread_id]/page.tsx index ad95d9f2..82d7f2cb 100644 --- a/frontend/src/app/workspace/chats/[thread_id]/page.tsx +++ b/frontend/src/app/workspace/chats/[thread_id]/page.tsx @@ -233,7 +233,6 @@ export default function ChatPage() { [thread.values.artifacts], ); - const [hasSubmitted, setHasSubmitted] = useState(false); const [historyCutoff, setHistoryCutoff] = useState(null); useEffect(() => { @@ -241,7 +240,6 @@ export default function ChatPage() { setHistoryCutoff(null); return; } - if (hasSubmitted) return; // Welcome 态下、未提交前,把当前已有消息都当作“历史”切掉。 // 这样即使历史消息是后续异步补齐,也不会重新露出。 setHistoryCutoff((prev) => { @@ -250,7 +248,6 @@ export default function ChatPage() { return next > prev ? next : prev; }); }, [ - hasSubmitted, historyCutoff, shouldRenderHistory, thread.isThreadLoading, @@ -322,7 +319,6 @@ export default function ChatPage() { if (isNewThread && safeThreadId && !isThreadInitReady) { return; } - setHasSubmitted(true); if (safeThreadId && (isNewThread || showWelcomeStyle)) { router.replace(`/workspace/chats/${safeThreadId}?is_chatting=true`); } @@ -343,22 +339,6 @@ export default function ChatPage() { await thread.stop(); }, [thread]); - const resetNewSessionState = useCallback(() => { - setIsNewThread(true); - setHasSubmitted(false); - setHistoryCutoff(null); - setArtifacts([]); - deselectArtifact(); - setArtifactsOpen(false); - setArtifactsFullscreen(false); - }, [ - deselectArtifact, - setArtifacts, - setArtifactsFullscreen, - setArtifactsOpen, - setIsNewThread, - ]); - return (
@@ -466,16 +446,14 @@ export default function ChatPage() {
@@ -570,9 +548,7 @@ export default function ChatPage() {
{!(showWelcomeStyle && thread.isThreadLoading) ? ( @@ -581,7 +557,6 @@ export default function ChatPage() { className={cn("w-full rounded-[20px] bg-ws-surface-elevated")} threadId={threadId} showWelcomeStyle={showWelcomeStyle} - hasSubmitted={hasSubmitted} autoFocus={showWelcomeStyle} status={ thread.error @@ -593,9 +568,7 @@ export default function ChatPage() { context={settings.context} extraHeader={
- {showWelcomeStyle && !hasSubmitted && ( - - )} + {showWelcomeStyle && }
} disabled={ diff --git a/frontend/src/components/workspace/input-box.tsx b/frontend/src/components/workspace/input-box.tsx index 49ebc4f5..85d2ddb1 100644 --- a/frontend/src/components/workspace/input-box.tsx +++ b/frontend/src/components/workspace/input-box.tsx @@ -219,7 +219,6 @@ export function InputBox({ context, extraHeader, showWelcomeStyle, - hasSubmitted, initialValue, onContextChange, onSubmit, @@ -238,7 +237,6 @@ export function InputBox({ }; extraHeader?: React.ReactNode; showWelcomeStyle: boolean; - hasSubmitted?: boolean; initialValue?: string; onContextChange?: ( context: Omit< @@ -294,14 +292,13 @@ export function InputBox({ const [isInputToolsTourReady, setIsInputToolsTourReady] = useState(false); const { data: referenceFilesData } = useReferenceFiles(threadIdFromProps); - // isNewThread 时禁用收缩,始终保持展开(除非已提交消息) - const effectiveIsFocused = - ((showWelcomeStyle ?? false) && !hasSubmitted) || isFocused; + // Welcome 态下禁用收缩,始终保持展开 + const effectiveIsFocused = (showWelcomeStyle ?? false) || isFocused; const shouldShowSuggestionList = - showWelcomeStyle && !hasSubmitted && searchParams.get("mode") !== "skill"; + showWelcomeStyle && searchParams.get("mode") !== "skill"; useEffect(() => { - if (!showWelcomeStyle || hasSubmitted) { + if (!showWelcomeStyle) { setIsInputToolsTourReady(false); return; } @@ -318,14 +315,13 @@ export function InputBox({ return () => window.cancelAnimationFrame(frameId); }, [ showWelcomeStyle, - hasSubmitted, shouldShowSuggestionList, iframeSkill.isBootstrapping, iframeSkill.selectedSkills.length, ]); useEffect(() => { - if (!showWelcomeStyle || hasSubmitted || !isInputToolsTourReady) { + if (!showWelcomeStyle || !isInputToolsTourReady) { setIsInputToolsTourOpen(false); return; } @@ -337,7 +333,7 @@ export function InputBox({ if (!hasSeenTourForCurrentThread) { setIsInputToolsTourOpen(true); } - }, [showWelcomeStyle, hasSubmitted, isInputToolsTourReady, threadId]); + }, [showWelcomeStyle, isInputToolsTourReady, threadId]); const finishInputToolsTour = useCallback(() => { const seenState = parseInputToolsTourSeenState( @@ -817,7 +813,6 @@ export function InputBox({ "border-0 rounded-[20px] backdrop-blur-sm", "transition-[height] duration-300 ease-out shadow-none ", !showWelcomeStyle && "h-[200px] shadow-[0_0_20px_0_rgba(0,0,0,0.10)]", - hasSubmitted && "shadow-[0_0_20px_0_rgba(0,0,0,0.10)]!", effectiveIsFocused ? "h-[200px]" : "h-[80px]", )} disabled={isInputDisabled}