mirror of
https://github.com/n8n-io/n8n.git
synced 2026-10-12 02:19:43 +00:00
fix(editor): Show friendly labels for the activity and conversation-history tools in the n8n Assistant chat (#38447)
Co-authored-by: Claude Fable 5.1 <[email protected]>
This commit is contained in:
co-authored by
Claude Fable 5.1
parent
11cc12043b
commit
fe5de38a61
@@ -7302,6 +7302,12 @@
|
||||
"instanceAi.tools.executions.get-node-output": "Reading node output",
|
||||
"instanceAi.tools.executions.get-resolved-node-parameters": "Inspecting node parameters",
|
||||
"instanceAi.tools.executions.stop": "Stopping execution",
|
||||
"instanceAi.tools.activity": "Activity",
|
||||
"instanceAi.tools.activity.list": "Checking recent activity",
|
||||
"instanceAi.tools.activity.expand": "Reading activity entry",
|
||||
"instanceAi.tools.conversation-history": "Past conversations",
|
||||
"instanceAi.tools.conversation-history.search": "Searching past conversations",
|
||||
"instanceAi.tools.conversation-history.get-messages": "Recalling past conversation",
|
||||
"instanceAi.tools.credentials": "Credentials",
|
||||
"instanceAi.tools.credentials.list": "Checking credentials",
|
||||
"instanceAi.tools.credentials.get": "Reading credential",
|
||||
|
||||
@@ -14,6 +14,10 @@ vi.mock('@n8n/i18n', () => ({
|
||||
'instanceAi.tools.list_workflows': 'Listing workflows',
|
||||
'instanceAi.tools.nodes': 'Search nodes',
|
||||
'instanceAi.tools.executions': 'Run workflow',
|
||||
'instanceAi.tools.activity': 'Activity',
|
||||
'instanceAi.tools.activity.list': 'Checking recent activity',
|
||||
'instanceAi.tools.conversation-history': 'Past conversations',
|
||||
'instanceAi.tools.conversation-history.search': 'Searching past conversations',
|
||||
'instanceAi.tools.workspace_execute_command': 'Running command',
|
||||
'instanceAi.tools.workspace_execute_command.skill': 'Running skill script',
|
||||
'instanceAi.tools.workspace_execute_command.skillScript': 'Running',
|
||||
@@ -125,6 +129,14 @@ describe('getToolIcon', () => {
|
||||
expect(getToolIcon('n8n-docs')).toBe('book-open');
|
||||
});
|
||||
|
||||
test('returns history for the activity tool', () => {
|
||||
expect(getToolIcon('activity')).toBe('history');
|
||||
});
|
||||
|
||||
test('returns message-square for the conversation-history tool', () => {
|
||||
expect(getToolIcon('conversation-history')).toBe('message-square');
|
||||
});
|
||||
|
||||
test('returns wrench as default', () => {
|
||||
expect(getToolIcon('unknown-tool')).toBe('wrench');
|
||||
});
|
||||
@@ -191,6 +203,16 @@ describe('useToolLabel', () => {
|
||||
expect(getToolLabel('n8n-docs', { action: 'read' })).toBe('Opening n8n docs');
|
||||
});
|
||||
|
||||
test('getToolLabel returns action-specific activity and conversation-history labels', () => {
|
||||
const { getToolLabel } = useToolLabel();
|
||||
expect(getToolLabel('activity')).toBe('Activity');
|
||||
expect(getToolLabel('activity', { action: 'list' })).toBe('Checking recent activity');
|
||||
expect(getToolLabel('conversation-history')).toBe('Past conversations');
|
||||
expect(getToolLabel('conversation-history', { action: 'search' })).toBe(
|
||||
'Searching past conversations',
|
||||
);
|
||||
});
|
||||
|
||||
test('getToggleLabel returns show data for regular tools', () => {
|
||||
const { getToggleLabel } = useToolLabel();
|
||||
expect(getToggleLabel(makeToolCall({ toolName: 'workflows' }))).toBe('Show data');
|
||||
|
||||
@@ -108,6 +108,8 @@ export function getToolIcon(toolName: string): IconName {
|
||||
if (toolName === 'resolve_integration') return 'share';
|
||||
if (SKILL_TOOLS.has(toolName) || toolName === 'n8n-docs') return 'book-open';
|
||||
if (toolName === 'data-tables') return 'table';
|
||||
if (toolName === 'activity') return 'history';
|
||||
if (toolName === 'conversation-history') return 'message-square';
|
||||
if (toolName === 'mcp-servers') return 'plug';
|
||||
if (
|
||||
toolName === 'workflows' ||
|
||||
|
||||
Reference in New Issue
Block a user