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(skills): reuse market icons in the working sidebar (#23137)

AmAzing-f432ee687bde
diff --git a/src/features/ChatInput/ActionBar/Tools/MarketSkillIcon.tsx b/src/components/MarketSkillIcon/index.tsx
similarity index 100%
rename from src/features/ChatInput/ActionBar/Tools/MarketSkillIcon.tsx
rename to src/components/MarketSkillIcon/index.tsx
diff --git a/src/features/ChatInput/ActionBar/Tools/useControls.tsx b/src/features/ChatInput/ActionBar/Tools/useControls.tsx
index b75c155d2a8..02af59d20c3 100644
--- a/src/features/ChatInput/ActionBar/Tools/useControls.tsx
+++ b/src/features/ChatInput/ActionBar/Tools/useControls.tsx
@@ -36,6 +36,7 @@ import type { ReactNode } from 'react';
import { useCallback, useEffect, useMemo, useState } from 'react';
import { useTranslation } from 'react-i18next';
+import MarketSkillIcon from '@/components/MarketSkillIcon';
import { useConnectorConfigure } from '@/features/Connectors/CustomConnectorModal/useConnectorConfigure';
import { openPluginEditDrawer } from '@/features/PluginDevModal/imperative';
import { createSkillStoreModal } from '@/features/SkillStore';
@@ -76,7 +77,6 @@ import { SKILL_ICON_SIZE } from './constants';
import LobehubSkillIcon from './LobehubSkillIcon';
import LobehubSkillServerItem from './LobehubSkillServerItem';
import MarketAgentSkillPopoverContent from './MarketAgentSkillPopoverContent';
-import MarketSkillIcon from './MarketSkillIcon';
import SkillRow from './SkillRow';
import ToolItem from './ToolItem';
import ToolItemDetailPopover from './ToolItemDetailPopover';
diff --git a/src/features/Conversation/WorkingSidebar/ResourcesSection/UserLevelSkills.test.ts b/src/features/Conversation/WorkingSidebar/ResourcesSection/UserLevelSkills.test.ts
new file mode 100644
index 00000000000..5fa8f059f20
--- /dev/null
+++ b/src/features/Conversation/WorkingSidebar/ResourcesSection/UserLevelSkills.test.ts
@@ -0,0 +1,66 @@
+import { renderHook } from '@testing-library/react';
+import { isValidElement } from 'react';
+import { describe, expect, it, vi } from 'vitest';
+
+import { useUserSkills } from './UserLevelSkills';
+
+const { skills, useFetchAgentSkills } = vi.hoisted(() => ({
+ skills: [
+ {
+ description: 'Analyze spreadsheets',
+ identifier: 'davila7-claude-code-templates-excel-analysis',
+ name: 'Excel Analysis',
+ source: 'market',
+ },
+ {
+ description: 'A locally authored skill',
+ identifier: 'my-skill',
+ name: 'My skill',
+ source: 'user',
+ },
+ ],
+ useFetchAgentSkills: vi.fn(),
+}));
+
+vi.mock('@/store/tool', () => ({
+ useToolStore: (selector: (state: unknown) => unknown) =>
+ selector({ skills, useFetchAgentSkills }),
+}));
+
+vi.mock('@/store/tool/selectors', () => ({
+ agentSkillsSelectors: { getAgentSkills: (state: { skills: typeof skills }) => state.skills },
+}));
+
+vi.mock('@/hooks/usePermission', () => ({ usePermission: () => ({ allowed: true }) }));
+vi.mock('@/features/SkillsList', () => ({}));
+vi.mock('@/features/ChatInput/InputEditor/ActionTag/skillDragData', () => ({
+ startSkillDrag: vi.fn(),
+}));
+
+// Exercise the sidebar's row data, not a component render. The icon's own
+// market lookup remains shared with the input menu.
+describe('useUserSkills icons', () => {
+ it('provides a market icon for installed market skills without changing their identity', () => {
+ const { result } = renderHook(() => useUserSkills());
+
+ expect(result.current[0]).toMatchObject({
+ description: skills[0].description,
+ id: skills[0].identifier,
+ name: skills[0].name,
+ });
+ expect(result.current[0]).toHaveProperty('icon', expect.anything());
+ expect(isValidElement(result.current[0].icon)).toBe(true);
+ });
+
+ it('keeps the generic skill icon fallback for custom skills', () => {
+ const { result } = renderHook(() => useUserSkills());
+
+ expect(result.current[1].icon).toBeUndefined();
+ });
+
+ it('does not produce rows or icons when the section is disabled', () => {
+ const { result } = renderHook(() => useUserSkills(false));
+
+ expect(result.current).toEqual([]);
+ });
+});
diff --git a/src/features/Conversation/WorkingSidebar/ResourcesSection/UserLevelSkills.tsx b/src/features/Conversation/WorkingSidebar/ResourcesSection/UserLevelSkills.tsx
index fa7c94e61f4..944810342a3 100644
--- a/src/features/Conversation/WorkingSidebar/ResourcesSection/UserLevelSkills.tsx
+++ b/src/features/Conversation/WorkingSidebar/ResourcesSection/UserLevelSkills.tsx
@@ -6,6 +6,7 @@ import type React from 'react';
import { lazy, memo, Suspense, useCallback, useMemo } from 'react';
import { useTranslation } from 'react-i18next';
+import MarketSkillIcon from '@/components/MarketSkillIcon';
import { startSkillDrag } from '@/features/ChatInput/InputEditor/ActionTag/skillDragData';
import {
filterSkillItems,
@@ -64,6 +65,10 @@ export const useUserSkills = (enabled = true): SkillListItem[] => {
? EMPTY_ITEMS
: agentSkills.map((skill) => ({
description: skill.description ?? undefined,
+ icon:
+ skill.source === 'market' ? (
+ <MarketSkillIcon identifier={skill.identifier} name={skill.name} />
+ ) : undefined,
// `identifier` is what the runtime resolves through the skill registry,
// and is unique per skill — reuse it as both the React key and the
// drag payload's `type`.
diff --git a/src/features/ProfileEditor/AgentTool.tsx b/src/features/ProfileEditor/AgentTool.tsx
index df6214d5df7..8625c9d21ff 100644
--- a/src/features/ProfileEditor/AgentTool.tsx
+++ b/src/features/ProfileEditor/AgentTool.tsx
@@ -10,6 +10,7 @@ import { PlusIcon } from 'lucide-react';
import React, { memo, Suspense, useCallback, useEffect, useMemo, useState } from 'react';
import { useTranslation } from 'react-i18next';
+import MarketSkillIcon from '@/components/MarketSkillIcon';
import ActionDropdown from '@/features/ChatInput/ActionBar/components/ActionDropdown';
import ComposioServerItem from '@/features/ChatInput/ActionBar/Tools/ComposioServerItem';
import ComposioSkillIcon, {
@@ -18,7 +19,6 @@ import ComposioSkillIcon, {
import LobehubSkillIcon from '@/features/ChatInput/ActionBar/Tools/LobehubSkillIcon';
import LobehubSkillServerItem from '@/features/ChatInput/ActionBar/Tools/LobehubSkillServerItem';
import MarketAgentSkillPopoverContent from '@/features/ChatInput/ActionBar/Tools/MarketAgentSkillPopoverContent';
-import MarketSkillIcon from '@/features/ChatInput/ActionBar/Tools/MarketSkillIcon';
import ToolItem from '@/features/ChatInput/ActionBar/Tools/ToolItem';
import ToolItemDetailPopover from '@/features/ChatInput/ActionBar/Tools/ToolItemDetailPopover';
import { useResourceAccess } from '@/features/ResourcePermission/useResourceAccess';
diff --git a/src/features/SkillsList/SkillsList.tsx b/src/features/SkillsList/SkillsList.tsx
index 2d2e4f47869..6ff6a8902c2 100644
--- a/src/features/SkillsList/SkillsList.tsx
+++ b/src/features/SkillsList/SkillsList.tsx
@@ -27,6 +27,8 @@ export interface SkillListItem {
* empty or omitted the row stays atomic (no chevron, no expansion).
*/
files?: string[];
+ /** Custom icon; omitted for skills that use the generic skill glyph. */
+ icon?: React.ReactNode;
id: string;
name: string;
/** Filesystem skill scope when the row comes from a device scan. */
@@ -408,7 +410,7 @@ const SkillRow = memo<SkillRowProps>(
) : reserveChevronSlot ? (
<span style={{ flexShrink: 0, height: 20, width: 20 }} />
) : null}
- <Icon className={styles.itemIcon} icon={SkillsIcon} size={14} />
+ {item.icon ?? <Icon className={styles.itemIcon} icon={SkillsIcon} size={14} />}
{item.description ? (
<Tooltip
placement={'left'}