refactor(ui): rename agents to assistantPresets for consistency

Update route paths, i18n keys and tab identifiers to use 'assistantPresets' instead of 'agents'
Add new agents tab component while maintaining backward compatibility
This commit is contained in:
icarus 2025-09-18 19:04:05 +08:00
parent 2fc1df8793
commit 3405b7e429
4 changed files with 10 additions and 4 deletions

View File

@ -58,7 +58,7 @@ const getTabIcon = (tabId: string, minapps: any[]): React.ReactNode | undefined
switch (tabId) {
case 'home':
return <Home size={14} />
case 'agents':
case 'assistantPresets':
return <Sparkle size={14} />
case 'translate':
return <Languages size={14} />

View File

@ -125,7 +125,8 @@ export const getRestoreProgressLabel = (key: string): string => {
}
const titleKeyMap = {
agents: 'title.agents',
// TODO: update i18n key
assistantPresets: 'title.agents',
apps: 'title.apps',
code: 'title.code',
files: 'title.files',

View File

@ -9,6 +9,7 @@ import { FC, useEffect, useState } from 'react'
import { useTranslation } from 'react-i18next'
import styled from 'styled-components'
import { AgentsTab as Agents } from './AgentsTab'
import Assistants from './AssistantsTab'
import Settings from './SettingsTab'
import Topics from './TopicsTab'
@ -23,7 +24,7 @@ interface Props {
style?: React.CSSProperties
}
type Tab = 'assistants' | 'topic' | 'settings'
type Tab = 'assistants' | 'topic' | 'settings' | 'agents' | 'sessions'
let _tab: any = ''
@ -107,6 +108,9 @@ const HomeTabs: FC<Props> = ({
<TabItem active={tab === 'assistants'} onClick={() => setTab('assistants')}>
{t('assistants.abbr')}
</TabItem>
<TabItem active={tab === 'agents'} onClick={() => setTab('agents')}>
{t('agents.title')}
</TabItem>
<TabItem active={tab === 'topic'} onClick={() => setTab('topic')}>
{t('common.topics')}
</TabItem>
@ -136,6 +140,7 @@ const HomeTabs: FC<Props> = ({
onCreateDefaultAssistant={onCreateDefaultAssistant}
/>
)}
{tab === 'agents' && <Agents />}
{tab === 'topic' && (
<Topics
assistant={activeAssistant}

View File

@ -37,7 +37,7 @@ const LaunchpadPage: FC = () => {
{
icon: <Sparkle size={32} className="icon" />,
text: t('title.agents'),
path: '/agents',
path: '/assistantPresets',
bgColor: 'linear-gradient(135deg, #6366F1, #4F46E5)' // AI助手靛蓝渐变代表智能和科技
},
{