- {agentList.map((a) => {
- const isActive = a.id === activeAgentId;
- return (
-
onSelect(a.id)}
- style={{
- display: 'flex',
- alignItems: 'center',
- gap: 12,
- padding: '10px 16px',
- cursor: 'pointer',
- background: isActive ? 'var(--color-surface-2)' : 'transparent',
- borderLeft: `3px solid ${isActive ? 'var(--color-brand)' : 'transparent'}`,
- transition: 'background 0.2s'
- }}
- >
+
+ {agentList.length > 0 ? (
+ agentList.map((a) => {
+ const isActive = a.id === activeAgentId;
+ return (
onSelect(a.id)}
+ className={`chat-agent-item ${isActive ? 'active' : ''}`}
>
- {isImageUrl(a.avatar) ?

: (a.name?.charAt(0) || '?').toUpperCase()}
-
-
- {a.name}
+ {isImageUrl(a.avatar) ? (
+

+ ) : (
+ (a.name?.charAt(0) || '?').toUpperCase()
+ )}
+
+
+
+ {a.name}
+ {!isSidebar && }
+
-
- );
- })}
+ );
+ })
+ ) : !loadingTimeout ? (
+
+ ) : (
+
+
+ 暂无智能体
+ 点击上方按钮开始创建
+
+ }
+ />
+
+ )}
);
diff --git a/src/pages/chat/components/ChatInput.tsx b/src/pages/chat/components/ChatInput.tsx
index a0b1266..ff1f4ff 100644
--- a/src/pages/chat/components/ChatInput.tsx
+++ b/src/pages/chat/components/ChatInput.tsx
@@ -293,7 +293,7 @@ export default function ChatInput(props: {
-
}
placeholder="选择模型"
onChange={onChangeModel}
- />
+ /> */}
{/* 顶部附件展示 */}
-
+ {(attachments.length > 0 || imageUrls.length > 0) && (
+
{attachments.map((a, i) => (
setAttachments((arr) => arr.filter((_, j) => j !== i))}>
📎 {a.name}
@@ -185,12 +186,12 @@ export default function ChatInputH5(props: {
/>
))}
-
+ )}
{/* 模型切换与工具栏 */}
-
-
-
} onClick={onOpenAgents}>
- 智能体
+
*/}
+
} onClick={onOpenAgents}>
-
} onClick={onOpenOutline}>
- 大纲
+
} onClick={onOpenOutline}>
-
} onClick={onOpenHistory}>
- 历史
+
} onClick={onOpenHistory}>
-
} onClick={onNewSession}>
- 新建
+
} onClick={onNewSession}>
-
} onClick={onOpenTpl}>
- 模板
+
} onClick={onOpenTpl}>
diff --git a/src/pages/chat/components/ChatPageH5.tsx b/src/pages/chat/components/ChatPageH5.tsx
index ad62416..d3d51e4 100644
--- a/src/pages/chat/components/ChatPageH5.tsx
+++ b/src/pages/chat/components/ChatPageH5.tsx
@@ -88,9 +88,13 @@ export default function ChatPageH5({ logic }: { logic: ChatPageLogicOutput }) {
{!agent ? (
-
-
-
+ navigate('/agents/new')}
+ onSelect={(aid) => navigate(`/chat/${aid}`)}
+ />
) : (
<>
+
setTplDrawerOpen(true)}
+ modelOptions={sender.modelOptions}
+ activeModelValue={sender.activeModelValue}
+ onChangeModel={(modelId: string) => {
+ const picked = sender.modelOptions.find((o) => o.value === modelId);
+ setOverrides((o: ModelOverrides) => ({
+ ...o,
+ model_id: modelId,
+ model: picked?.label ?? o.model
+ }));
+ }}
+ agentList={agentList}
+ onInsertMention={() => { }}
+ onOpenHistory={() => setHistoryDrawerOpen(true)}
+ onNewSession={handleNewSession}
+ onOpenAgents={() => setAgentDrawerOpen(true)}
+ onOpenOutline={() => setOutlineDrawerOpen(true)}
+ hasAgent={!!agent}
+ hasId={!!id}
+ showActions={false}
+ />
>
)}
- setTplDrawerOpen(true)}
- modelOptions={sender.modelOptions}
- activeModelValue={sender.activeModelValue}
- onChangeModel={(modelId: string) => {
- const picked = sender.modelOptions.find((o) => o.value === modelId);
- setOverrides((o: ModelOverrides) => ({
- ...o,
- model_id: modelId,
- model: picked?.label ?? o.model
- }));
- }}
- agentList={agentList}
- onInsertMention={() => { }}
- onOpenHistory={() => setHistoryDrawerOpen(true)}
- onNewSession={handleNewSession}
- onOpenAgents={() => setAgentDrawerOpen(true)}
- onOpenOutline={() => setOutlineDrawerOpen(true)}
- hasAgent={!!agent}
- hasId={!!id}
- showActions={false}
- />