From 3b36f7341d1b0dfe0b98d59f6fdecbca37f8d86c Mon Sep 17 00:00:00 2001 From: Suguru Inoue Date: Tue, 28 Oct 2025 14:29:42 +0100 Subject: [PATCH] feat(editor): Chat agent directory (no-changelog) (#21236) --- .../src/components/N8nAvatar/Avatar.vue | 4 +- .../src/components/N8nIcon/Icon.vue | 1 + .../@n8n/design-system/src/types/icon.ts | 2 +- .../features/ai/chatHub/ChatAgentsView.vue | 294 ++++++++++++++++++ .../src/features/ai/chatHub/ChatView.vue | 255 ++++++--------- .../src/features/ai/chatHub/chat.types.ts | 6 + .../src/features/ai/chatHub/chat.utils.ts | 163 +++++++++- .../chatHub/components/AgentEditorModal.vue | 98 +++--- .../ai/chatHub/components/ChatAgentAvatar.vue | 33 ++ .../ai/chatHub/components/ChatAgentCard.vue | 147 +++++++++ .../components/ChatConversationHeader.vue | 6 +- .../ai/chatHub/components/ChatMessage.vue | 69 ++-- .../components/ChatSessionMenuItem.vue | 46 +-- .../chatHub/components/ChatSidebarContent.vue | 9 +- .../ai/chatHub/components/ModelSelector.vue | 51 ++- .../chatHub/composables/useChatCredentials.ts | 76 +++++ .../src/features/ai/chatHub/constants.ts | 1 + .../features/ai/chatHub/module.descriptor.ts | 14 +- 18 files changed, 940 insertions(+), 335 deletions(-) create mode 100644 packages/frontend/editor-ui/src/features/ai/chatHub/ChatAgentsView.vue create mode 100644 packages/frontend/editor-ui/src/features/ai/chatHub/components/ChatAgentAvatar.vue create mode 100644 packages/frontend/editor-ui/src/features/ai/chatHub/components/ChatAgentCard.vue create mode 100644 packages/frontend/editor-ui/src/features/ai/chatHub/composables/useChatCredentials.ts diff --git a/packages/frontend/@n8n/design-system/src/components/N8nAvatar/Avatar.vue b/packages/frontend/@n8n/design-system/src/components/N8nAvatar/Avatar.vue index 86fda5a9663..4c6bd4e84f1 100644 --- a/packages/frontend/@n8n/design-system/src/components/N8nAvatar/Avatar.vue +++ b/packages/frontend/@n8n/design-system/src/components/N8nAvatar/Avatar.vue @@ -7,7 +7,7 @@ import { getInitials } from '../../utils/labelUtil'; interface AvatarProps { firstName?: string | null; lastName?: string | null; - size?: 'xsmall' | 'small' | 'medium' | 'large'; + size?: 'xxsmall' | 'xsmall' | 'small' | 'medium' | 'large'; colors?: string[]; } @@ -34,6 +34,7 @@ const getColors = (colors: string[]): string[] => { }; const sizes: { [size: string]: number } = { + xxsmall: 16, xsmall: 20, small: 28, large: 48, @@ -86,6 +87,7 @@ const getSize = (size: string): number => sizes[size]; text-transform: uppercase; } +.text-xxsmall, .text-xsmall { font-size: 6px; } diff --git a/packages/frontend/@n8n/design-system/src/components/N8nIcon/Icon.vue b/packages/frontend/@n8n/design-system/src/components/N8nIcon/Icon.vue index 064c1ec9e5d..b1e993616d6 100644 --- a/packages/frontend/@n8n/design-system/src/components/N8nIcon/Icon.vue +++ b/packages/frontend/@n8n/design-system/src/components/N8nIcon/Icon.vue @@ -43,6 +43,7 @@ const sizesInPixels: Record = { medium: 14, large: 16, xlarge: 20, + xxlarge: 40, }; const size = computed((): { height: string; width: string } => { diff --git a/packages/frontend/@n8n/design-system/src/types/icon.ts b/packages/frontend/@n8n/design-system/src/types/icon.ts index 91d065818f8..a532b4006f4 100644 --- a/packages/frontend/@n8n/design-system/src/types/icon.ts +++ b/packages/frontend/@n8n/design-system/src/types/icon.ts @@ -1,6 +1,6 @@ import type { TextColor } from '@n8n/design-system/types/text'; -const ICON_SIZE = ['xsmall', 'small', 'medium', 'large', 'xlarge'] as const; +const ICON_SIZE = ['xsmall', 'small', 'medium', 'large', 'xlarge', 'xxlarge'] as const; export type IconSize = (typeof ICON_SIZE)[number]; export type IconColor = TextColor; diff --git a/packages/frontend/editor-ui/src/features/ai/chatHub/ChatAgentsView.vue b/packages/frontend/editor-ui/src/features/ai/chatHub/ChatAgentsView.vue new file mode 100644 index 00000000000..13be5952048 --- /dev/null +++ b/packages/frontend/editor-ui/src/features/ai/chatHub/ChatAgentsView.vue @@ -0,0 +1,294 @@ + + + + + diff --git a/packages/frontend/editor-ui/src/features/ai/chatHub/ChatView.vue b/packages/frontend/editor-ui/src/features/ai/chatHub/ChatView.vue index 0ffb9b8bf74..5ae3a9df71b 100644 --- a/packages/frontend/editor-ui/src/features/ai/chatHub/ChatView.vue +++ b/packages/frontend/editor-ui/src/features/ai/chatHub/ChatView.vue @@ -1,9 +1,6 @@ + + diff --git a/packages/frontend/editor-ui/src/features/ai/chatHub/components/ChatAgentCard.vue b/packages/frontend/editor-ui/src/features/ai/chatHub/components/ChatAgentCard.vue new file mode 100644 index 00000000000..00d84d1a9f2 --- /dev/null +++ b/packages/frontend/editor-ui/src/features/ai/chatHub/components/ChatAgentCard.vue @@ -0,0 +1,147 @@ + + + + + diff --git a/packages/frontend/editor-ui/src/features/ai/chatHub/components/ChatConversationHeader.vue b/packages/frontend/editor-ui/src/features/ai/chatHub/components/ChatConversationHeader.vue index e4819ebf650..2b88da428a8 100644 --- a/packages/frontend/editor-ui/src/features/ai/chatHub/components/ChatConversationHeader.vue +++ b/packages/frontend/editor-ui/src/features/ai/chatHub/components/ChatConversationHeader.vue @@ -1,5 +1,4 @@