From 17bb3715d1cfdf36cef117f811ee351d4c4ac151 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=89=E9=91=AB=E5=8D=87?= Date: Thu, 11 Jun 2026 09:52:27 +0800 Subject: [PATCH] =?UTF-8?q?feat(agents):=20=E6=99=BA=E8=83=BD=E4=BD=93?= =?UTF-8?q?=E9=97=AE=E7=AD=94=E9=A1=B5=E8=90=BD=E5=9C=B0=E6=80=81=E5=B1=95?= =?UTF-8?q?=E7=A4=BA=E5=B8=B8=E7=94=A8=E9=97=AE=E9=A2=98=E5=85=A5=E5=8F=A3?= =?UTF-8?q?=E5=B9=B6=E9=BB=98=E8=AE=A4=E5=B1=95=E5=BC=80=E7=AE=80=E4=BB=8B?= =?UTF-8?q?=E6=A0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 落地页 Hero 以"Hi,我是{名称}"问候,将管理员配置的常用问题渲染为可点击的引导气泡,点击即发起对话 - 右侧智能体简介栏改为默认展开,作为主要"专家信息"卡片,仍可手动收起 Co-Authored-By: Claude Opus 4.8 (1M context) --- .../workspace/agent-info-sidebar.tsx | 5 +- .../components/workspace/agent-welcome.tsx | 115 ++++++++++++------ frontend-web/src/pages/AgentChatPage.tsx | 11 +- 3 files changed, 90 insertions(+), 41 deletions(-) diff --git a/frontend-web/src/components/workspace/agent-info-sidebar.tsx b/frontend-web/src/components/workspace/agent-info-sidebar.tsx index 27bd7640..803add70 100644 --- a/frontend-web/src/components/workspace/agent-info-sidebar.tsx +++ b/frontend-web/src/components/workspace/agent-info-sidebar.tsx @@ -43,7 +43,10 @@ export function AgentInfoSidebar({ onAskQuestion: (text: string) => void; disabled?: boolean; }) { - const [collapsed, setCollapsed] = useState(true); + // Expanded by default: the profile card is meant to be the agent's primary + // "expert info" panel, not a hidden drawer. Users can still collapse it on + // narrow screens via the header toggle. + const [collapsed, setCollapsed] = useState(false); const [detailSkillName, setDetailSkillName] = useState(null); const { skills } = useSkills(); const updateAgent = useUpdateAgent(); diff --git a/frontend-web/src/components/workspace/agent-welcome.tsx b/frontend-web/src/components/workspace/agent-welcome.tsx index d154becc..1fb8038d 100644 --- a/frontend-web/src/components/workspace/agent-welcome.tsx +++ b/frontend-web/src/components/workspace/agent-welcome.tsx @@ -1,39 +1,76 @@ -"use client"; - -import { BotIcon } from "lucide-react"; - -import { type Agent } from "@/core/agents"; -import { desensitize } from "@/lib/desensitize"; -import { cn } from "@/lib/utils"; - -export function AgentWelcome({ - className, - agent, - agentName, -}: { - className?: string; - agent: Agent | null | undefined; - agentName: string; -}) { - const displayName = desensitize(agent?.name ?? agentName); - const description = agent?.description - ? desensitize(agent.description) - : undefined; - - return ( -
-
- -
-
{displayName}
- {description && ( -

{description}

- )} -
- ); -} +"use client"; + +import { BotIcon } from "lucide-react"; + +import { type Agent } from "@/core/agents"; +import { desensitize } from "@/lib/desensitize"; +import { cn } from "@/lib/utils"; + +/** + * Landing (home) hero shown above the input box before the first message of an + * agent conversation. Mirrors the qclaw landing screen: centered avatar, a + * "Hi,我是{name}" greeting, the agent's one-line description as a slogan, and + * the agent's admin-configured common questions surfaced as clickable starter + * pills. Clicking a pill sends it as the opening message via `onAskQuestion`. + */ +export function AgentWelcome({ + className, + agent, + agentName, + onAskQuestion, + disabled, +}: { + className?: string; + agent: Agent | null | undefined; + agentName: string; + onAskQuestion?: (text: string) => void; + disabled?: boolean; +}) { + const displayName = desensitize(agent?.name ?? agentName); + const description = agent?.description + ? desensitize(agent.description) + : undefined; + const questions = (agent?.common_questions ?? []).filter( + (q) => q.trim().length > 0, + ); + + return ( +
+
+ +
+
+ Hi,我是{displayName} +
+ {description && ( +

+ {description} +

+ )} + {onAskQuestion && questions.length > 0 && ( +
+ {questions.slice(0, 6).map((question, index) => ( + + ))} +
+ )} +
+ ); +} diff --git a/frontend-web/src/pages/AgentChatPage.tsx b/frontend-web/src/pages/AgentChatPage.tsx index e26bc612..1cf155c2 100644 --- a/frontend-web/src/pages/AgentChatPage.tsx +++ b/frontend-web/src/pages/AgentChatPage.tsx @@ -268,7 +268,16 @@ export default function AgentChatPage() { context={settings.context} extraHeader={ isLandingState && ( - + + handleSubmit({ text, files: [] }) + } + disabled={ + env.NEXT_PUBLIC_STATIC_WEBSITE_ONLY === "true" + } + /> ) } disabled={env.NEXT_PUBLIC_STATIC_WEBSITE_ONLY === "true"}