Skip to content

Commit 874743b

Browse files
committed
feat(tarko): display agent name in web ui
1 parent 9a9c5a0 commit 874743b

File tree

3 files changed

+28
-10
lines changed

3 files changed

+28
-10
lines changed

multimodal/tarko/agent-web-ui/src/standalone/navbar/AboutModal.tsx

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,21 @@ import { motion } from 'framer-motion';
44
import { FiX, FiExternalLink, FiGithub, FiGlobe, FiCpu, FiCopy, FiCheck } from 'react-icons/fi';
55
import { apiService } from '@/common/services/apiService';
66
import { AgentServerVersionInfo } from '@agent-tars/interface';
7-
import { ModelInfo } from '@/common/types';
7+
import { ModelInfo, AgentInfo } from '@/common/types';
88

99
interface AboutModalProps {
1010
isOpen: boolean;
1111
onClose: () => void;
1212
modelInfo: ModelInfo;
13+
agentInfo: AgentInfo;
1314
}
1415

15-
export const AboutModal: React.FC<AboutModalProps> = ({ isOpen, onClose, modelInfo }) => {
16+
export const AboutModal: React.FC<AboutModalProps> = ({
17+
isOpen,
18+
onClose,
19+
modelInfo,
20+
agentInfo,
21+
}) => {
1622
const [versionInfo, setVersionInfo] = useState<AgentServerVersionInfo | null>(null);
1723
const [copiedModel, setCopiedModel] = useState(false);
1824

@@ -82,11 +88,11 @@ export const AboutModal: React.FC<AboutModalProps> = ({ isOpen, onClose, modelIn
8288
</div>
8389

8490
<h1 className="text-4xl md:text-5xl font-light text-gray-900 dark:text-gray-100 mb-4 tracking-wide">
85-
Agent TARS
91+
{agentInfo.name || 'Tarko'}
8692
</h1>
8793

8894
<p className="text-lg md:text-xl text-gray-600 dark:text-gray-400 font-light tracking-wider uppercase">
89-
An Open-Source Multimodal AI Agent
95+
{'An Open-Source Multimodal AI Agent'}
9096
</p>
9197
</motion.div>
9298

multimodal/tarko/agent-web-ui/src/standalone/navbar/Navbar.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,4 +69,4 @@
6969
-webkit-background-clip: text;
7070
-webkit-text-fill-color: transparent;
7171
background-clip: text;
72-
}
72+
}

multimodal/tarko/agent-web-ui/src/standalone/navbar/Navbar.tsx

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React, { useCallback, useEffect } from 'react';
22
import { ShareButton } from '@/standalone/share';
33
import { AboutModal } from './AboutModal';
44
import { motion } from 'framer-motion';
5-
import { FiMoon, FiSun, FiInfo } from 'react-icons/fi';
5+
import { FiMoon, FiSun, FiInfo, FiCpu } from 'react-icons/fi';
66
import { GoSidebarCollapse, GoSidebarExpand } from 'react-icons/go';
77
import { useLayout } from '@/common/hooks/useLayout';
88
import { useSession } from '@/common/hooks/useSession';
@@ -12,7 +12,7 @@ import './Navbar.css';
1212

1313
export const Navbar: React.FC = () => {
1414
const { isSidebarCollapsed, toggleSidebar } = useLayout();
15-
const { activeSessionId, isProcessing, modelInfo } = useSession();
15+
const { activeSessionId, isProcessing, modelInfo, agentInfo } = useSession();
1616
const { isReplayMode } = useReplayMode();
1717
const [isDarkMode, setIsDarkMode] = React.useState(true);
1818
const [showAboutModal, setShowAboutModal] = React.useState(false);
@@ -93,8 +93,19 @@ export const Navbar: React.FC = () => {
9393
</div>
9494
)}
9595

96-
{/* Center section - now empty, model info moved to About modal */}
97-
<div className="flex-1" />
96+
{/* Center section - Smaller Agent name badge */}
97+
<div className="flex-1 flex justify-center">
98+
{agentInfo.name && (
99+
<div className="agent-name-badge">
100+
<div className="flex items-center gap-1.5 px-2 py-1 bg-gradient-to-r from-blue-500/10 to-purple-500/10 dark:from-blue-400/15 dark:to-purple-400/15 border border-blue-200/30 dark:border-blue-400/20 rounded-full shadow-sm backdrop-blur-sm">
101+
<FiCpu size={12} className="text-blue-600 dark:text-blue-400 flex-shrink-0" />
102+
<span className="text-xs font-medium text-blue-800 dark:text-blue-200 truncate max-w-[150px]">
103+
{agentInfo.name}
104+
</span>
105+
</div>
106+
</div>
107+
)}
108+
</div>
98109

99110
{/* Right section - reordered buttons: About, Dark mode, Share */}
100111
<div className="flex items-center space-x-1 md:space-x-2">
@@ -125,11 +136,12 @@ export const Navbar: React.FC = () => {
125136
</div>
126137
</div>
127138

128-
{/* About Modal - pass modelInfo */}
139+
{/* About Modal - pass modelInfo and agentInfo */}
129140
<AboutModal
130141
isOpen={showAboutModal}
131142
onClose={() => setShowAboutModal(false)}
132143
modelInfo={modelInfo}
144+
agentInfo={agentInfo}
133145
/>
134146
</>
135147
);

0 commit comments

Comments
 (0)