feat: update agent label for clarity in dashboard localization files and improve HomePage layout

This commit is contained in:
duanshuwen
2026-04-21 21:08:02 +08:00
parent 41c1949a2e
commit db93888921
4 changed files with 12 additions and 21 deletions

View File

@@ -28,7 +28,7 @@
}, },
"currentAgentSummary": "Current Agent: {{name}}", "currentAgentSummary": "Current Agent: {{name}}",
"modelSummary": "Model: {{name}}", "modelSummary": "Model: {{name}}",
"agentLabel": "Agent", "agentLabel": "Current conversation target",
"refresh": "Refresh" "refresh": "Refresh"
} }
} }

View File

@@ -28,7 +28,7 @@
}, },
"currentAgentSummary": "Agent ปัจจุบัน: {{name}}", "currentAgentSummary": "Agent ปัจจุบัน: {{name}}",
"modelSummary": "โมเดล: {{name}}", "modelSummary": "โมเดล: {{name}}",
"agentLabel": "Agent", "agentLabel": "คู่สนทนาปัจจุบัน",
"refresh": "รีเฟรช" "refresh": "รีเฟรช"
} }
} }

View File

@@ -28,7 +28,7 @@
}, },
"currentAgentSummary": "当前 Agent{{name}}", "currentAgentSummary": "当前 Agent{{name}}",
"modelSummary": "模型:{{name}}", "modelSummary": "模型:{{name}}",
"agentLabel": "Agent", "agentLabel": "当前对话对象",
"refresh": "刷新" "refresh": "刷新"
} }
} }

View File

@@ -219,7 +219,6 @@ function HomeChatComposerSection({
export default function HomePage() { export default function HomePage() {
const { t, locale } = useI18n(); const { t, locale } = useI18n();
const agents = useAgentsStore((state) => state.agents); const agents = useAgentsStore((state) => state.agents);
const agentsLoading = useAgentsStore((state) => state.loading);
const defaultAgentId = useAgentsStore((state) => state.defaultAgentId); const defaultAgentId = useAgentsStore((state) => state.defaultAgentId);
const chatInitialized = useChatStore((state) => state.initialized); const chatInitialized = useChatStore((state) => state.initialized);
const chatMessages = useChatStore((state) => state.messages); const chatMessages = useChatStore((state) => state.messages);
@@ -471,26 +470,18 @@ export default function HomePage() {
</div> </div>
</div> </div>
<div className="flex items-center gap-3"> <div className="flex items-center gap-3">
<label className="flex items-center gap-2 text-xs text-[#525866] dark:text-gray-300"> <div className="rounded-full border border-[#E5E8EE] px-3 py-1.5 flex items-center gap-2 text-xs text-[#525866] dark:text-gray-300">
<span>{t('dashboard.conversation.agentLabel')}</span> <span>{t('dashboard.conversation.agentLabel')}</span>
<select <div
className="rounded-full border border-[#E5E8EE] bg-white px-3 py-1.5 text-xs text-[#525866] outline-none transition-colors hover:border-[#2B7FFF] dark:border-[#2a2a2d] dark:bg-[#232327] dark:text-gray-300" className=" text-xs text-[#525866] dark:border-[#2a2a2d] dark:bg-[#232327] dark:text-gray-300"
disabled={agentsLoading || agents.length === 0} title={currentAgent?.name || selectedAgentId}
value={selectedAgentId}
onChange={(event) => {
chatStore.selectAgent(event.target.value);
}}
> >
{agents.map((agent) => ( {currentAgent?.name || selectedAgentId || '--'}
<option key={agent.id} value={agent.id}> </div>
{agent.name} </div>
</option>
))}
</select>
</label>
<button <button
type="button" type="button"
className="rounded-full border border-[#E5E8EE] px-3 py-1.5 text-xs text-[#525866] transition-colors hover:border-[#2B7FFF] hover:text-[#2B7FFF] dark:border-[#2a2a2d] dark:text-gray-300" className="text-xs text-[#525866] transition-colors hover:border-[#2B7FFF] hover:text-[#2B7FFF] dark:border-[#2a2a2d] dark:text-gray-300"
onClick={handleRefreshConversationData} onClick={handleRefreshConversationData}
title={t('dashboard.conversation.refresh')} title={t('dashboard.conversation.refresh')}
aria-label={t('dashboard.conversation.refresh')} aria-label={t('dashboard.conversation.refresh')}