Skip to content

🤯 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.

🐛 fix(chat): clarify skill installation flow (#16034)

AmAzing-ce274593c2fd
diff --git a/locales/en-US/chat.json b/locales/en-US/chat.json
index 5426a487921..b88f61cba1b 100644
--- a/locales/en-US/chat.json
+++ b/locales/en-US/chat.json
@@ -122,15 +122,15 @@
"createModal.placeholder": "Describe what this Agent should do...",
"createModal.skillSuggestion.actions.createAnyway": "Create Agent Anyway",
"createModal.skillSuggestion.actions.createAnywayHint": "Skill not a fit?",
- "createModal.skillSuggestion.actions.install": "Add Skill",
- "createModal.skillSuggestion.actions.installing": "Adding…",
+ "createModal.skillSuggestion.actions.install": "Install Skill",
+ "createModal.skillSuggestion.actions.installing": "Installing…",
"createModal.skillSuggestion.actions.openSkills": "View in Skills",
- "createModal.skillSuggestion.actions.tryInLobeAI": "Use in LobeAI",
+ "createModal.skillSuggestion.actions.tryInLobeAI": "Use in {{name}}",
"createModal.skillSuggestion.description": "This looks like a reusable workflow. Install the Skill once, then use it across Agents.",
- "createModal.skillSuggestion.installError": "Skill wasn't added. Retry, or create an Agent anyway.",
- "createModal.skillSuggestion.installed.description": "You can use this Skill in LobeAI or add it to any Agent.",
- "createModal.skillSuggestion.installed.ready": "Ready in LobeAI",
- "createModal.skillSuggestion.installed.title": "Skill added",
+ "createModal.skillSuggestion.installError": "Skill wasn't installed. Retry, or create an Agent anyway.",
+ "createModal.skillSuggestion.installed.description": "You can use this Skill in {{name}}, or enable it for any Agent.",
+ "createModal.skillSuggestion.installed.ready": "Ready in {{name}}",
+ "createModal.skillSuggestion.installed.title": "Skill installed",
"createModal.skillSuggestion.title": "A Skill may fit better",
"createModal.title": "What should this Agent do?",
"createTask.assignee": "Assignee",
diff --git a/locales/en-US/setting.json b/locales/en-US/setting.json
index 1a1c508c673..6f569db1773 100644
--- a/locales/en-US/setting.json
+++ b/locales/en-US/setting.json
@@ -1017,6 +1017,7 @@
"tools.activation.auto": "Auto",
"tools.activation.auto.desc": "Smart",
"tools.activation.fixed.hint": "Always on — managed by the app and can’t be turned off",
+ "tools.activation.pin": "Pin",
"tools.activation.pinned": "Pinned",
"tools.activation.pinned.desc": "Always On",
"tools.add": "Add Skill",
diff --git a/locales/zh-CN/chat.json b/locales/zh-CN/chat.json
index 23dfb96bfcb..65b06c2c0ae 100644
--- a/locales/zh-CN/chat.json
+++ b/locales/zh-CN/chat.json
@@ -122,15 +122,15 @@
"createModal.placeholder": "描述这个助理要完成什么…",
"createModal.skillSuggestion.actions.createAnyway": "仍然创建助理",
"createModal.skillSuggestion.actions.createAnywayHint": "技能不合适?",
- "createModal.skillSuggestion.actions.install": "添加技能",
- "createModal.skillSuggestion.actions.installing": "添加中…",
+ "createModal.skillSuggestion.actions.install": "安装技能",
+ "createModal.skillSuggestion.actions.installing": "安装中…",
"createModal.skillSuggestion.actions.openSkills": "查看技能",
- "createModal.skillSuggestion.actions.tryInLobeAI": "在 LobeAI 中使用",
+ "createModal.skillSuggestion.actions.tryInLobeAI": "在 {{name}} 中使用",
"createModal.skillSuggestion.description": "这更像一个可复用的工作流。安装一次技能后,可在多个助理中使用。",
- "createModal.skillSuggestion.installError": "技能未添加成功。你可以重试,或仍然创建助理。",
- "createModal.skillSuggestion.installed.description": "你可以在 LobeAI 中使用这个技能,也可以把它添加到任意助理。",
- "createModal.skillSuggestion.installed.ready": "已可在 LobeAI 中使用",
- "createModal.skillSuggestion.installed.title": "技能已添加",
+ "createModal.skillSuggestion.installError": "技能未安装成功。你可以重试,或仍然创建助理。",
+ "createModal.skillSuggestion.installed.description": "你可以在 {{name}} 中使用这个技能,也可以为任意助理启用它。",
+ "createModal.skillSuggestion.installed.ready": "已可在 {{name}} 中使用",
+ "createModal.skillSuggestion.installed.title": "技能已安装",
"createModal.skillSuggestion.title": "这个需求适合用技能",
"createModal.title": "这个助理要做什么?",
"createTask.assignee": "负责人",
diff --git a/locales/zh-CN/setting.json b/locales/zh-CN/setting.json
index 9a34f9985e8..2ce036047bc 100644
--- a/locales/zh-CN/setting.json
+++ b/locales/zh-CN/setting.json
@@ -1017,6 +1017,7 @@
"tools.activation.auto": "自动",
"tools.activation.auto.desc": "智能调用",
"tools.activation.fixed.hint": "由应用强制开启,始终可用,无法关闭",
+ "tools.activation.pin": "固定启用",
"tools.activation.pinned": "固定启用",
"tools.activation.pinned.desc": "始终注入",
"tools.add": "集成技能",
diff --git a/packages/locales/src/default/chat.ts b/packages/locales/src/default/chat.ts
index 16d100e9973..b78121466b4 100644
--- a/packages/locales/src/default/chat.ts
+++ b/packages/locales/src/default/chat.ts
@@ -332,18 +332,18 @@ export default {
'createModal.placeholder': 'Describe what this Agent should do...',
'createModal.skillSuggestion.actions.createAnyway': 'Create Agent Anyway',
'createModal.skillSuggestion.actions.createAnywayHint': 'Skill not a fit?',
- 'createModal.skillSuggestion.actions.install': 'Add Skill',
- 'createModal.skillSuggestion.actions.installing': 'Adding…',
+ 'createModal.skillSuggestion.actions.install': 'Install Skill',
+ 'createModal.skillSuggestion.actions.installing': 'Installing…',
'createModal.skillSuggestion.actions.openSkills': 'View in Skills',
- 'createModal.skillSuggestion.actions.tryInLobeAI': 'Use in LobeAI',
+ 'createModal.skillSuggestion.actions.tryInLobeAI': 'Use in {{name}}',
'createModal.skillSuggestion.description':
'This looks like a reusable workflow. Install the Skill once, then use it across Agents.',
'createModal.skillSuggestion.installed.description':
- 'You can use this Skill in LobeAI or add it to any Agent.',
- 'createModal.skillSuggestion.installed.ready': 'Ready in LobeAI',
- 'createModal.skillSuggestion.installed.title': 'Skill added',
+ 'You can use this Skill in {{name}}, or enable it for any Agent.',
+ 'createModal.skillSuggestion.installed.ready': 'Ready in {{name}}',
+ 'createModal.skillSuggestion.installed.title': 'Skill installed',
'createModal.skillSuggestion.installError':
- "Skill wasn't added. Retry, or create an Agent anyway.",
+ "Skill wasn't installed. Retry, or create an Agent anyway.",
'createModal.skillSuggestion.title': 'A Skill may fit better',
'createModal.title': 'What should this Agent do?',
'claudeCodeInstallGuide.actions.openDocs': 'Open Install Guide',
diff --git a/packages/locales/src/default/setting.ts b/packages/locales/src/default/setting.ts
index a09415a5ef6..85205ff9953 100644
--- a/packages/locales/src/default/setting.ts
+++ b/packages/locales/src/default/setting.ts
@@ -2458,6 +2458,7 @@ When I am ___, I need ___
'tools.activation.auto': 'Auto',
'tools.activation.auto.desc': 'Smart',
'tools.activation.fixed.hint': 'Always on — managed by the app and can’t be turned off',
+ 'tools.activation.pin': 'Pin',
'tools.activation.pinned': 'Pinned',
'tools.activation.pinned.desc': 'Always On',
'tools.skillActivateMode.auto.desc':
diff --git a/src/features/ChatInput/ActionBar/Tools/useControls.tsx b/src/features/ChatInput/ActionBar/Tools/useControls.tsx
index 0a128c849a4..d463a969867 100644
--- a/src/features/ChatInput/ActionBar/Tools/useControls.tsx
+++ b/src/features/ChatInput/ActionBar/Tools/useControls.tsx
@@ -512,7 +512,9 @@ export const useControls = ({ closeDropdown }: { closeDropdown?: () => void } =
}}
>
<span className={cx(styles.policyItemIcon)}>{icon}</span>
- <span className={cx(styles.policyText)}>{t(`tools.activation.${value}`)}</span>
+ <span className={cx(styles.policyText)}>
+ {t(value === 'pinned' ? 'tools.activation.pin' : `tools.activation.${value}`)}
+ </span>
{renderCheck(value)}
</button>
);
diff --git a/src/routes/(main)/home/_layout/Body/Agent/ModalProvider.test.tsx b/src/routes/(main)/home/_layout/Body/Agent/ModalProvider.test.tsx
index 2e2eaf50940..eec0fa4b5d4 100644
--- a/src/routes/(main)/home/_layout/Body/Agent/ModalProvider.test.tsx
+++ b/src/routes/(main)/home/_layout/Body/Agent/ModalProvider.test.tsx
@@ -9,6 +9,7 @@ const mocks = vi.hoisted(() => ({
refreshAgentList: vi.fn(),
sendAsAgent: vi.fn(),
sendAsGroup: vi.fn(),
+ sendMessage: vi.fn(),
toggleAgentBuilderPanel: vi.fn(),
}));
@@ -38,12 +39,16 @@ vi.mock('@/features/EditingPopover', () => ({
vi.mock('@/routes/(main)/home/_layout/hooks/useCreateModal', () => ({
CreateAgentModal: ({
+ inboxAgentName,
open,
onCreateBlank,
onOpenSkills,
+ onTryInLobeAI,
}: {
+ inboxAgentName?: string;
onCreateBlank: () => Promise<void> | void;
onOpenSkills?: (identifier: string) => void;
+ onTryInLobeAI?: () => Promise<void> | void;
open: boolean;
}) =>
open ? (
@@ -54,21 +59,37 @@ vi.mock('@/routes/(main)/home/_layout/hooks/useCreateModal', () => ({
<button type="button" onClick={() => onOpenSkills?.('product-requirements-writer')}>
View in Skills
</button>
+ <button type="button" onClick={() => void onTryInLobeAI?.()}>
+ Use in LobeAI
+ </button>
+ <span>Inbox name: {inboxAgentName}</span>
</>
) : null,
}));
vi.mock('@/store/agent', () => ({
useAgentStore: (
- selector: (state: { createAgent: typeof mocks.createAgent; inboxAgentId: string }) => unknown,
+ selector: (state: {
+ agentMap: Record<string, { title?: string }>;
+ createAgent: typeof mocks.createAgent;
+ inboxAgentId: string;
+ }) => unknown,
) =>
selector({
+ agentMap: {
+ 'inbox-agent': { title: 'Nova' },
+ },
createAgent: mocks.createAgent,
inboxAgentId: 'inbox-agent',
}),
}));
vi.mock('@/store/agent/selectors', () => ({
+ agentSelectors: {
+ getAgentMetaById:
+ (agentId: string) => (state: { agentMap: Record<string, { title?: string }> }) =>
+ state.agentMap[agentId] ?? {},
+ },
builtinAgentSelectors: {
inboxAgentId: (state: { inboxAgentId: string }) => state.inboxAgentId,
},
@@ -97,6 +118,13 @@ vi.mock('@/store/home', () => ({
}),
}));
+vi.mock('@/store/chat', () => ({
+ useChatStore: (selector: (state: { sendMessage: typeof mocks.sendMessage }) => unknown) =>
+ selector({
+ sendMessage: mocks.sendMessage,
+ }),
+}));
+
vi.mock('./Modals/ConfigGroupModal', () => ({
default: () => null,
}));
@@ -156,4 +184,22 @@ describe('AgentModalProvider', () => {
'/settings/skill?tab=skill&skill=product-requirements-writer',
);
});
+
+ it('navigates to LobeAI without sending the original create-agent prompt', async () => {
+ renderProvider();
+
+ fireEvent.click(screen.getByText('Open create agent modal'));
+ fireEvent.click(screen.getByText('Use in LobeAI'));
+
+ expect(mocks.sendMessage).not.toHaveBeenCalled();
+ expect(mocks.navigate).toHaveBeenCalledWith('/agent/inbox-agent');
+ });
+
+ it('passes the customized inbox agent name to the create modal', async () => {
+ renderProvider();
+
+ fireEvent.click(screen.getByText('Open create agent modal'));
+
+ expect(screen.getByText('Inbox name: Nova')).toBeInTheDocument();
+ });
});
diff --git a/src/routes/(main)/home/_layout/Body/Agent/ModalProvider.tsx b/src/routes/(main)/home/_layout/Body/Agent/ModalProvider.tsx
index 9b588847a71..70352b612ba 100644
--- a/src/routes/(main)/home/_layout/Body/Agent/ModalProvider.tsx
+++ b/src/routes/(main)/home/_layout/Body/Agent/ModalProvider.tsx
@@ -1,5 +1,6 @@
'use client';
+import { DEFAULT_INBOX_TITLE, SESSION_CHAT_URL } from '@lobechat/const';
import { type ReactNode, useCallback } from 'react';
import { createContext, memo, use, useMemo, useState } from 'react';
@@ -10,7 +11,7 @@ import EditingPopover from '@/features/EditingPopover';
import { useWorkspaceAwareNavigate } from '@/features/Workspace/useWorkspaceAwareNavigate';
import { CreateAgentModal } from '@/routes/(main)/home/_layout/hooks/useCreateModal';
import { useAgentStore } from '@/store/agent';
-import { builtinAgentSelectors } from '@/store/agent/selectors';
+import { agentSelectors, builtinAgentSelectors } from '@/store/agent/selectors';
import { useGlobalStore } from '@/store/global';
import { useHomeStore } from '@/store/home';
@@ -72,6 +73,8 @@ interface CreateModalRendererProps {
const CreateModalRenderer = memo<CreateModalRendererProps>(({ open, type, groupId, onClose }) => {
const navigate = useWorkspaceAwareNavigate();
const inboxAgentId = useAgentStore(builtinAgentSelectors.inboxAgentId);
+ const inboxMeta = useAgentStore(agentSelectors.getAgentMetaById(inboxAgentId!));
+ const inboxAgentName = inboxMeta.title || DEFAULT_INBOX_TITLE;
const storeCreateAgent = useAgentStore((s) => s.createAgent);
const refreshAgentList = useHomeStore((s) => s.refreshAgentList);
const sendAsAgent = useHomeStore((s) => s.sendAsAgent);
@@ -107,15 +110,23 @@ const CreateModalRenderer = memo<CreateModalRendererProps>(({ open, type, groupI
[navigate, onClose],
);
+ const handleTryInLobeAI = useCallback(() => {
+ if (!inboxAgentId) return;
+
+ navigate(SESSION_CHAT_URL(inboxAgentId, false));
+ }, [inboxAgentId, navigate]);
+
return (
<CreateAgentModal
agentId={inboxAgentId}
+ inboxAgentName={inboxAgentName}
open={open}
type={type}
onClose={onClose}
onCreateBlank={handleCreateBlank}
onOpenSkills={handleOpenSkills}
onSubmit={handleSubmit}
+ onTryInLobeAI={handleTryInLobeAI}
/>
);
});
diff --git a/src/routes/(main)/home/_layout/hooks/useCreateModal.test.tsx b/src/routes/(main)/home/_layout/hooks/useCreateModal.test.tsx
index 4b81ee7ee35..3be38a70e1d 100644
--- a/src/routes/(main)/home/_layout/hooks/useCreateModal.test.tsx
+++ b/src/routes/(main)/home/_layout/hooks/useCreateModal.test.tsx
@@ -120,35 +120,40 @@ vi.mock('antd-style', () => ({
vi.mock('react-i18next', () => ({
useTranslation: (namespace: string) => ({
- t: (key: string) =>
- (
- ({
- 'chat:createModal.createBlank': 'Start Blank',
- 'chat:createModal.groupPlaceholder': 'Describe what this Group should do...',
- 'chat:createModal.groupTitle': 'What should this Group do?',
- 'chat:createModal.placeholder': 'Describe what this Agent should do...',
- 'chat:createModal.skillSuggestion.actions.createAnyway': 'Create Agent Anyway',
- 'chat:createModal.skillSuggestion.actions.createAnywayHint': 'Skill not a fit?',
- 'chat:createModal.skillSuggestion.actions.install': 'Add Skill',
- 'chat:createModal.skillSuggestion.actions.installing': 'Adding…',
- 'chat:createModal.skillSuggestion.actions.openSkills': 'View in Skills',
- 'chat:createModal.skillSuggestion.actions.tryInLobeAI': 'Use in LobeAI',
- 'chat:createModal.skillSuggestion.description':
- 'This looks like a reusable workflow. Install the Skill once, then use it across Agents.',
- 'chat:createModal.skillSuggestion.installed.description':
- 'You can use this Skill in LobeAI or add it to any Agent.',
- 'chat:createModal.skillSuggestion.installed.ready': 'Ready in LobeAI',
- 'chat:createModal.skillSuggestion.installed.title': 'Skill added',
- 'chat:createModal.skillSuggestion.installError':
- "Skill wasn't added. Retry, or create an Agent anyway.",
- 'chat:createModal.skillSuggestion.title': 'A Skill may fit better',
- 'chat:createModal.title': 'What should this Agent do?',
- 'common:home.suggestQuestions': 'Try these examples',
- 'common:switch': 'Switch',
- 'suggestQuestions:example.prompt': 'Use this example prompt',
- 'suggestQuestions:example.title': 'Example title',
- }) as Record<string, string>
- )[`${namespace}:${key}`] ?? key,
+ t: (key: string, options?: Record<string, string>) => {
+ const text =
+ (
+ {
+ 'chat:createModal.createBlank': 'Start Blank',
+ 'chat:createModal.groupPlaceholder': 'Describe what this Group should do...',
+ 'chat:createModal.groupTitle': 'What should this Group do?',
+ 'chat:createModal.placeholder': 'Describe what this Agent should do...',
+ 'chat:inbox.title': 'Lobe AI',
+ 'chat:createModal.skillSuggestion.actions.createAnyway': 'Create Agent Anyway',
+ 'chat:createModal.skillSuggestion.actions.createAnywayHint': 'Skill not a fit?',
+ 'chat:createModal.skillSuggestion.actions.install': 'Install Skill',
+ 'chat:createModal.skillSuggestion.actions.installing': 'Installing…',
+ 'chat:createModal.skillSuggestion.actions.openSkills': 'View in Skills',
+ 'chat:createModal.skillSuggestion.actions.tryInLobeAI': 'Use in {{name}}',
+ 'chat:createModal.skillSuggestion.description':
+ 'This looks like a reusable workflow. Install the Skill once, then use it across Agents.',
+ 'chat:createModal.skillSuggestion.installed.description':
+ 'You can use this Skill in {{name}}, or enable it for any Agent.',
+ 'chat:createModal.skillSuggestion.installed.ready': 'Ready in {{name}}',
+ 'chat:createModal.skillSuggestion.installed.title': 'Skill installed',
+ 'chat:createModal.skillSuggestion.installError':
+ "Skill wasn't installed. Retry, or create an Agent anyway.",
+ 'chat:createModal.skillSuggestion.title': 'A Skill may fit better',
+ 'chat:createModal.title': 'What should this Agent do?',
+ 'common:home.suggestQuestions': 'Try these examples',
+ 'common:switch': 'Switch',
+ 'suggestQuestions:example.prompt': 'Use this example prompt',
+ 'suggestQuestions:example.title': 'Example title',
+ } as Record<string, string>
+ )[`${namespace}:${key}`] ?? key;
+
+ return text.replaceAll('{{name}}', options?.name ?? 'LobeAI');
+ },
}),
}));
@@ -228,20 +233,23 @@ const renderModal = (type: 'agent' | 'group' = 'agent') => {
const onCreateBlank = vi.fn().mockResolvedValue(undefined);
const onOpenSkills = vi.fn();
const onSubmit = vi.fn().mockResolvedValue(undefined);
+ const onTryInLobeAI = vi.fn();
render(
<CreateAgentModal
open
agentId="inbox-agent"
+ inboxAgentName="Nova"
type={type}
onClose={onClose}
onCreateBlank={onCreateBlank}
onOpenSkills={onOpenSkills}
onSubmit={onSubmit}
+ onTryInLobeAI={onTryInLobeAI}
/>,
);
- return { onClose, onCreateBlank, onOpenSkills, onSubmit };
+ return { onClose, onCreateBlank, onOpenSkills, onSubmit, onTryInLobeAI };
};
const expectTrackedSkillSuggestionAction = async (
@@ -437,7 +445,7 @@ describe('CreateAgentModal analytics', () => {
top_skill_identifier: 'resume-reviewer',
});
- expect(screen.getByText('Add Skill')).toHaveAttribute('data-button-type', 'primary');
+ expect(screen.getByText('Install Skill')).toHaveAttribute('data-button-type', 'primary');
const createAnywayButton = screen.getByText('Create Agent Anyway');
expect(createAnywayButton).not.toHaveAttribute('data-button-type', 'primary');
@@ -509,7 +517,7 @@ describe('CreateAgentModal analytics', () => {
expect(await screen.findByText('A Skill may fit better')).toBeInTheDocument();
});
- it('keeps add skill buttons visually consistent when multiple skill suggestions are shown', async () => {
+ it('keeps install skill buttons visually consistent when multiple skill suggestions are shown', async () => {
marketApiMocks.searchSkill.mockResolvedValueOnce({
currentPage: 1,
items: [
@@ -551,14 +559,14 @@ describe('CreateAgentModal analytics', () => {
expect(await screen.findByText('A Skill may fit better')).toBeInTheDocument();
- const addSkillButtons = screen.getAllByText('Add Skill');
- expect(addSkillButtons).toHaveLength(3);
- addSkillButtons.forEach((button) => {
+ const installSkillButtons = screen.getAllByText('Install Skill');
+ expect(installSkillButtons).toHaveLength(3);
+ installSkillButtons.forEach((button) => {
expect(button).not.toHaveAttribute('data-button-type', 'primary');
});
});
- it('shows an installing state while adding the suggested skill', async () => {
+ it('shows an installing state while installing the suggested skill', async () => {
marketApiMocks.searchSkill.mockResolvedValueOnce({
currentPage: 1,
items: [
@@ -593,14 +601,14 @@ describe('CreateAgentModal analytics', () => {
fireEvent.click(screen.getByText('Send'));
expect(await screen.findByText('A Skill may fit better')).toBeInTheDocument();
- fireEvent.click(screen.getByText('Add Skill'));
+ fireEvent.click(screen.getByText('Install Skill'));
- const installingButton = await screen.findByText('Adding…');
+ const installingButton = await screen.findByText('Installing…');
expect(installingButton).toHaveAttribute('data-button-loading', 'true');
- expect(screen.queryByText('Add Skill')).not.toBeInTheDocument();
+ expect(screen.queryByText('Install Skill')).not.toBeInTheDocument();
resolveImport({ skill: { id: 'skill-1', name: 'Resume Reviewer' }, status: 'created' });
- expect(await screen.findByText('Skill added')).toBeInTheDocument();
+ expect(await screen.findByText('Skill installed')).toBeInTheDocument();
});
it('shows a completed skill state after installing the recommended skill', async () => {
@@ -620,7 +628,7 @@ describe('CreateAgentModal analytics', () => {
totalCount: 1,
totalPages: 1,
});
- const { onClose, onOpenSkills, onSubmit } = renderModal();
+ const { onClose, onOpenSkills, onSubmit, onTryInLobeAI } = renderModal();
fireEvent.change(screen.getByLabelText('chat input'), {
target: { value: '帮我做一个简历优化检查清单' },
@@ -628,7 +636,7 @@ describe('CreateAgentModal analytics', () => {
fireEvent.click(screen.getByText('Send'));
expect(await screen.findByText('A Skill may fit better')).toBeInTheDocument();
- fireEvent.click(screen.getByText('Add Skill'));
+ fireEvent.click(screen.getByText('Install Skill'));
await waitFor(() => {
expect(skillServiceMocks.importFromMarket).toHaveBeenCalledWith('resume-reviewer');
@@ -642,15 +650,18 @@ describe('CreateAgentModal analytics', () => {
expect(toolStoreMocks.refreshAgentSkills).toHaveBeenCalled();
expect(onClose).not.toHaveBeenCalled();
expect(onSubmit).not.toHaveBeenCalled();
- expect(await screen.findByText('Skill added')).toBeInTheDocument();
+ expect(await screen.findByText('Skill installed')).toBeInTheDocument();
expect(screen.getByText('Resume Reviewer')).toBeInTheDocument();
- expect(screen.getByText('Ready in LobeAI')).toBeInTheDocument();
+ expect(screen.getByText('Ready in Nova')).toBeInTheDocument();
+ expect(
+ screen.getByText('You can use this Skill in Nova, or enable it for any Agent.'),
+ ).toBeInTheDocument();
expect(screen.queryByText('resume-reviewer')).not.toBeInTheDocument();
expect(screen.getByRole('dialog')).toHaveAttribute('data-modal-width', 'min(90vw, 560px)');
expect(screen.queryByText('Skill not a fit?')).not.toBeInTheDocument();
expect(screen.queryByText('Create Agent Anyway')).not.toBeInTheDocument();
- const tryInLobeAIButton = screen.getByText('Use in LobeAI');
+ const tryInLobeAIButton = screen.getByText('Use in Nova');
expect(tryInLobeAIButton).toHaveAttribute('data-button-type', 'primary');
const openSkillsButton = screen.getByText('View in Skills');
expect(openSkillsButton).not.toHaveAttribute('data-button-type', 'primary');
@@ -662,6 +673,7 @@ describe('CreateAgentModal analytics', () => {
});
fireEvent.click(tryInLobeAIButton);
+ expect(onTryInLobeAI).toHaveBeenCalledTimes(1);
expect(onClose).toHaveBeenCalled();
await expectTrackedSkillSuggestionAction('try_in_lobeai_clicked', {
selected_skill_identifier: 'resume-reviewer',
@@ -694,7 +706,7 @@ describe('CreateAgentModal analytics', () => {
fireEvent.click(screen.getByText('Send'));
expect(await screen.findByText('A Skill may fit better')).toBeInTheDocument();
- fireEvent.click(screen.getByText('Add Skill'));
+ fireEvent.click(screen.getByText('Install Skill'));
await waitFor(() => {
expect(skillServiceMocks.importFromMarket).toHaveBeenCalledWith('resume-reviewer');
@@ -705,7 +717,7 @@ describe('CreateAgentModal analytics', () => {
selected_skill_identifier: 'resume-reviewer',
});
expect(
- await screen.findByText("Skill wasn't added. Retry, or create an Agent anyway."),
+ await screen.findByText("Skill wasn't installed. Retry, or create an Agent anyway."),
).toBeInTheDocument();
});
});
diff --git a/src/routes/(main)/home/_layout/hooks/useCreateModal.tsx b/src/routes/(main)/home/_layout/hooks/useCreateModal.tsx
index 270fa9441eb..4c9bc6a18ad 100644
--- a/src/routes/(main)/home/_layout/hooks/useCreateModal.tsx
+++ b/src/routes/(main)/home/_layout/hooks/useCreateModal.tsx
@@ -135,95 +135,98 @@ const SkillSuggestionPanel = memo<SkillSuggestionPanelProps>(
);
interface SkillInstalledPanelProps {
+ inboxAgentName: string;
onClose: () => void;
onOpenSkills?: (identifier: string) => void;
skill: InstalledSkill;
}
-const SkillInstalledPanel = memo<SkillInstalledPanelProps>(({ onClose, onOpenSkills, skill }) => {
- const { t } = useTranslation('chat');
+const SkillInstalledPanel = memo<SkillInstalledPanelProps>(
+ ({ inboxAgentName, onClose, onOpenSkills, skill }) => {
+ const { t } = useTranslation('chat');
- return (
- <Flexbox
- align={'center'}
- gap={20}
- style={{
- paddingBlock: 8,
- }}
- >
- <Flexbox align={'center'} gap={8} style={{ textAlign: 'center' }}>
- <Flexbox
- align={'center'}
- justify={'center'}
- style={{
- background: cssVar.colorSuccessBg,
- borderRadius: '50%',
- height: 48,
- width: 48,
- }}
- >
- <CheckCircle2 color={cssVar.colorSuccess} size={28} />
- </Flexbox>
- <Text fontSize={18} style={{ fontWeight: 600 }}>
- {t('createModal.skillSuggestion.installed.title')}
- </Text>
- <Text
- color={cssVar.colorTextSecondary}
- fontSize={13}
- style={{ maxWidth: 360, textAlign: 'center' }}
- >
- {t('createModal.skillSuggestion.installed.description')}
- </Text>
- </Flexbox>
+ return (
<Flexbox
- horizontal
align={'center'}
- gap={12}
- justify={'space-between'}
+ gap={20}
style={{
- background: cssVar.colorFillQuaternary,
- border: `1px solid ${cssVar.colorFillTertiary}`,
- borderRadius: 12,
- padding: 12,
- width: '100%',
+ paddingBlock: 8,
}}
>
+ <Flexbox align={'center'} gap={8} style={{ textAlign: 'center' }}>
+ <Flexbox
+ align={'center'}
+ justify={'center'}
+ style={{
+ background: cssVar.colorSuccessBg,
+ borderRadius: '50%',
+ height: 48,
+ width: 48,
+ }}
+ >
+ <CheckCircle2 color={cssVar.colorSuccess} size={28} />
+ </Flexbox>
+ <Text fontSize={18} style={{ fontWeight: 600 }}>
+ {t('createModal.skillSuggestion.installed.title')}
+ </Text>
+ <Text
+ color={cssVar.colorTextSecondary}
+ fontSize={13}
+ style={{ maxWidth: 360, textAlign: 'center' }}
+ >
+ {t('createModal.skillSuggestion.installed.description', { name: inboxAgentName })}
+ </Text>
+ </Flexbox>
<Flexbox
+ horizontal
align={'center'}
- justify={'center'}
+ gap={12}
+ justify={'space-between'}
style={{
- background: cssVar.colorBgContainer,
+ background: cssVar.colorFillQuaternary,
border: `1px solid ${cssVar.colorFillTertiary}`,
- borderRadius: 10,
- flex: 'none',
- height: 38,
- width: 38,
+ borderRadius: 12,
+ padding: 12,
+ width: '100%',
}}
>
- <Blocks color={cssVar.colorTextSecondary} size={18} />
- </Flexbox>
- <Flexbox flex={1} gap={4} style={{ minWidth: 0 }}>
- <Text ellipsis fontSize={13} style={{ fontWeight: 500 }}>
- {skill.name}
- </Text>
- <Text color={cssVar.colorTextTertiary} fontSize={12}>
- {t('createModal.skillSuggestion.installed.ready')}
- </Text>
+ <Flexbox
+ align={'center'}
+ justify={'center'}
+ style={{
+ background: cssVar.colorBgContainer,
+ border: `1px solid ${cssVar.colorFillTertiary}`,
+ borderRadius: 10,
+ flex: 'none',
+ height: 38,
+ width: 38,
+ }}
+ >
+ <Blocks color={cssVar.colorTextSecondary} size={18} />
+ </Flexbox>
+ <Flexbox flex={1} gap={4} style={{ minWidth: 0 }}>
+ <Text ellipsis fontSize={13} style={{ fontWeight: 500 }}>
+ {skill.name}
+ </Text>
+ <Text color={cssVar.colorTextTertiary} fontSize={12}>
+ {t('createModal.skillSuggestion.installed.ready', { name: inboxAgentName })}
+ </Text>
+ </Flexbox>
</Flexbox>
- </Flexbox>
- <Flexbox horizontal align={'center'} gap={8} justify={'center'} style={{ width: '100%' }}>
- {onOpenSkills && (
- <Button onClick={() => onOpenSkills(skill.identifier)}>
- {t('createModal.skillSuggestion.actions.openSkills')}
+ <Flexbox horizontal align={'center'} gap={8} justify={'center'} style={{ width: '100%' }}>
+ {onOpenSkills && (
+ <Button onClick={() => onOpenSkills(skill.identifier)}>
+ {t('createModal.skillSuggestion.actions.openSkills')}
+ </Button>
+ )}
+ <Button type={'primary'} onClick={onClose}>
+ {t('createModal.skillSuggestion.actions.tryInLobeAI', { name: inboxAgentName })}
</Button>
- )}
- <Button type={'primary'} onClick={onClose}>
- {t('createModal.skillSuggestion.actions.tryInLobeAI')}
- </Button>
+ </Flexbox>
</Flexbox>
- </Flexbox>
- );
-});
+ );
+ },
+);
interface ExampleItemProps {
description: string;
@@ -307,17 +310,30 @@ const Examples = memo<ExamplesProps>(({ suggestMode, onExampleClick }) => {
export interface CreateAgentModalProps {
agentId?: string;
+ inboxAgentName?: string;
onClose: () => void;
onCreateBlank: () => Promise<void> | void;
onOpenSkills?: (identifier: string) => void;
onSubmit: (prompt: string) => Promise<void> | void;
+ onTryInLobeAI?: () => Promise<void> | void;
open: boolean;
type: 'agent' | 'group';
}
export const CreateAgentModal = memo<CreateAgentModalProps>(
- ({ open, type, agentId, onClose, onOpenSkills, onSubmit, onCreateBlank }) => {
+ ({
+ open,
+ type,
+ agentId,
+ inboxAgentName,
+ onClose,
+ onOpenSkills,
+ onSubmit,
+ onCreateBlank,
+ onTryInLobeAI,
+ }) => {
const { t } = useTranslation('chat');
+ const displayInboxAgentName = inboxAgentName || t('inbox.title');
const editorRef = useRef<ChatInputEditor | null>(null);
const contentRef = useRef('');
const examplePromptRef = useRef('');
@@ -479,9 +495,10 @@ export const CreateAgentModal = memo<CreateAgentModalProps>(
const handleTryInLobeAI = useCallback(() => {
if (installedSkill) {
trackSkillSuggestionAction('try_in_lobeai_clicked', installedSkill.identifier);
+ void onTryInLobeAI?.();
}
handleClose();
- }, [handleClose, installedSkill, trackSkillSuggestionAction]);
+ }, [handleClose, installedSkill, onTryInLobeAI, trackSkillSuggestionAction]);
const handleCreateBlank = useCallback(async () => {
if (loading) return;
@@ -548,6 +565,7 @@ export const CreateAgentModal = memo<CreateAgentModalProps>(
<ActionIcon icon={X} onClick={handleClose} />
</Flexbox>
<SkillInstalledPanel
+ inboxAgentName={displayInboxAgentName}
skill={installedSkill}
onClose={handleTryInLobeAI}
onOpenSkills={onOpenSkills ? handleOpenInstalledSkill : undefined}