🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.
TypeScript agentagent-collaborationagent-harnessloop-engineeringmcppersonal-assistantproactive-agentskillssuper-agenttask-management
✨ feat(chat): add Manage button to execution device switcher (#16126)
Arvin Xu0230cd0e7f5c
diff --git a/locales/en-US/chat.json b/locales/en-US/chat.jsonindex e7f61cfa2f3..40fc4db475b 100644--- a/locales/en-US/chat.json+++ b/locales/en-US/chat.json@@ -246,6 +246,7 @@"heteroAgent.executionTarget.loading": "Loading devices…","heteroAgent.executionTarget.local": "This device","heteroAgent.executionTarget.localDesc": "Run as a local process on this desktop app",+ "heteroAgent.executionTarget.manage": "Manage","heteroAgent.executionTarget.noDevices": "No remote devices yet. Run `lh connect` on another machine to add one.","heteroAgent.executionTarget.none": "No device","heteroAgent.executionTarget.noneDesc": "No device enabled",diff --git a/locales/zh-CN/chat.json b/locales/zh-CN/chat.jsonindex 9ddf4eaad63..1b85e3de838 100644--- a/locales/zh-CN/chat.json+++ b/locales/zh-CN/chat.json@@ -246,6 +246,7 @@"heteroAgent.executionTarget.loading": "正在加载设备…","heteroAgent.executionTarget.local": "本机","heteroAgent.executionTarget.localDesc": "在当前桌面端以本地进程运行",+ "heteroAgent.executionTarget.manage": "管理","heteroAgent.executionTarget.noDevices": "暂无远程设备。在另一台机器上执行 `lh connect` 即可接入。","heteroAgent.executionTarget.none": "无设备","heteroAgent.executionTarget.noneDesc": "不启用任何设备",diff --git a/packages/locales/src/default/chat.ts b/packages/locales/src/default/chat.tsindex af402863411..25b8fef4d22 100644--- a/packages/locales/src/default/chat.ts+++ b/packages/locales/src/default/chat.ts@@ -197,6 +197,7 @@ export default {'heteroAgent.executionTarget.loading': 'Loading devices…','heteroAgent.executionTarget.local': 'This device','heteroAgent.executionTarget.localDesc': 'Run as a local process on this desktop app',+ 'heteroAgent.executionTarget.manage': 'Manage','heteroAgent.executionTarget.noDevices':'No remote devices yet. Run `lh connect` on another machine to add one.','heteroAgent.executionTarget.none': 'No device',diff --git a/src/features/ChatInput/ControlBar/HeteroDeviceSwitcher.tsx b/src/features/ChatInput/ControlBar/HeteroDeviceSwitcher.tsxindex f0cdaf18c52..75184c85765 100644--- a/src/features/ChatInput/ControlBar/HeteroDeviceSwitcher.tsx+++ b/src/features/ChatInput/ControlBar/HeteroDeviceSwitcher.tsx@@ -17,11 +17,13 @@ import {MonitorDownIcon,MonitorIcon,MonitorOffIcon,+ SettingsIcon,SparklesIcon,} from 'lucide-react';import { memo, type ReactNode, useCallback, useState } from 'react';import { useTranslation } from 'react-i18next';+import { useWorkspaceAwareNavigate } from '@/features/Workspace/useWorkspaceAwareNavigate';import { resolveExecutionTarget } from '@/helpers/executionTarget';import { lambdaQuery } from '@/libs/trpc/client';import { gatewayConnectionService } from '@/services/electron/gatewayConnection';@@ -232,6 +234,27 @@ const styles = createStaticStyles(({ css }) => ({font-weight: 500;color: ${cssVar.colorTextTertiary};`,+ manageButton: css`+ cursor: pointer;++ display: flex;+ gap: 3px;+ align-items: center;++ padding: 0;+ border: none;++ font-size: 11px;+ color: ${cssVar.colorTextQuaternary};++ background: none;++ transition: color 0.2s;++ &:hover {+ color: ${cssVar.colorPrimary};+ }+ `,}));interface OptionRowProps {@@ -295,6 +318,7 @@ interface HeteroDeviceSwitcherProps {const HeteroDeviceSwitcher = memo<HeteroDeviceSwitcherProps>(({ agentId }) => {const { t } = useTranslation('chat');const [open, setOpen] = useState(false);+ const navigate = useWorkspaceAwareNavigate();const agencyConfig = useAgentStore(agentByIdSelectors.getAgencyConfigById(agentId));const updateAgentConfigById = useAgentStore((s) => s.updateAgentConfigById);@@ -437,7 +461,19 @@ const HeteroDeviceSwitcher = memo<HeteroDeviceSwitcherProps>(({ agentId }) => {</span></Tooltip></Flexbox>- {isDesktop || showWebDownloadCard ? null : (+ {isDesktop || showWebDownloadCard ? (+ <button+ className={styles.manageButton}+ type="button"+ onClick={() => {+ setOpen(false);+ navigate('/settings/devices');+ }}+ >+ <Icon icon={SettingsIcon} size={11} />+ <span>{t('heteroAgent.executionTarget.manage')}</span>+ </button>+ ) : (<aclassName={styles.headerLink}href="https://lobehub.com/downloads"