mirror of
https://github.com/n8n-io/n8n
synced 2026-04-21 15:47:20 +00:00
feat(core): Instance AI preview tags and command bar improvements (no-changelog) (#28383)
This commit is contained in:
parent
90a3f460f1
commit
9ef55ca4f9
5 changed files with 25 additions and 11 deletions
|
|
@ -199,6 +199,7 @@ export const ChatModule: FrontendModuleDescription = {
|
|||
label: i18n.baseText('settings.chatHub'),
|
||||
position: 'top',
|
||||
route: { to: { name: CHAT_SETTINGS_VIEW } },
|
||||
preview: true,
|
||||
get available() {
|
||||
return hasPermission(['rbac'], { rbac: { scope: 'chatHub:manage' } });
|
||||
},
|
||||
|
|
|
|||
|
|
@ -63,6 +63,7 @@ export const InstanceAiModule: FrontendModuleDescription = {
|
|||
label: i18n.baseText('settings.n8nAgent'),
|
||||
position: 'top',
|
||||
route: { to: { name: INSTANCE_AI_SETTINGS_VIEW } },
|
||||
preview: true,
|
||||
get available() {
|
||||
return hasPermission(['rbac'], { rbac: { scope: 'instanceAi:message' } });
|
||||
},
|
||||
|
|
|
|||
|
|
@ -113,8 +113,9 @@ const hasFavorites = computed(() => favoritesStore.favorites.length > 0);
|
|||
const instanceAi = computed<IMenuItem>(() => ({
|
||||
id: 'instance-ai',
|
||||
icon: 'sparkles',
|
||||
label: 'Instance AI',
|
||||
label: locale.baseText('projects.menu.instanceAi'),
|
||||
route: { to: { name: INSTANCE_AI_VIEW } },
|
||||
beta: true,
|
||||
}));
|
||||
|
||||
const chat = computed<IMenuItem>(() => ({
|
||||
|
|
|
|||
|
|
@ -99,66 +99,66 @@ export function useCommandBar() {
|
|||
const executionViewGroups: CommandGroup[] = [
|
||||
recentResourcesGroup,
|
||||
executionCommandGroup,
|
||||
instanceAiCommandGroup,
|
||||
workflowNavigationGroup,
|
||||
projectNavigationGroup,
|
||||
credentialNavigationGroup,
|
||||
dataTableNavigationGroup,
|
||||
executionNavigationGroup,
|
||||
instanceAiCommandGroup,
|
||||
genericCommandGroup,
|
||||
];
|
||||
|
||||
const workflowsListViewGroups: CommandGroup[] = [
|
||||
recentResourcesGroup,
|
||||
instanceAiCommandGroup,
|
||||
workflowNavigationGroup,
|
||||
projectNavigationGroup,
|
||||
credentialNavigationGroup,
|
||||
dataTableNavigationGroup,
|
||||
executionNavigationGroup,
|
||||
instanceAiCommandGroup,
|
||||
genericCommandGroup,
|
||||
];
|
||||
|
||||
const credentialsListViewGroups: CommandGroup[] = [
|
||||
recentResourcesGroup,
|
||||
instanceAiCommandGroup,
|
||||
credentialNavigationGroup,
|
||||
projectNavigationGroup,
|
||||
workflowNavigationGroup,
|
||||
dataTableNavigationGroup,
|
||||
executionNavigationGroup,
|
||||
instanceAiCommandGroup,
|
||||
genericCommandGroup,
|
||||
];
|
||||
|
||||
const executionsListViewGroups: CommandGroup[] = [
|
||||
recentResourcesGroup,
|
||||
instanceAiCommandGroup,
|
||||
workflowNavigationGroup,
|
||||
projectNavigationGroup,
|
||||
credentialNavigationGroup,
|
||||
dataTableNavigationGroup,
|
||||
instanceAiCommandGroup,
|
||||
genericCommandGroup,
|
||||
];
|
||||
|
||||
const dataStoresListViewGroups: CommandGroup[] = [
|
||||
recentResourcesGroup,
|
||||
instanceAiCommandGroup,
|
||||
dataTableNavigationGroup,
|
||||
projectNavigationGroup,
|
||||
workflowNavigationGroup,
|
||||
credentialNavigationGroup,
|
||||
executionNavigationGroup,
|
||||
instanceAiCommandGroup,
|
||||
genericCommandGroup,
|
||||
];
|
||||
|
||||
const evaluationViewGroups: CommandGroup[] = [
|
||||
recentResourcesGroup,
|
||||
instanceAiCommandGroup,
|
||||
workflowNavigationGroup,
|
||||
projectNavigationGroup,
|
||||
credentialNavigationGroup,
|
||||
dataTableNavigationGroup,
|
||||
executionNavigationGroup,
|
||||
instanceAiCommandGroup,
|
||||
genericCommandGroup,
|
||||
];
|
||||
|
||||
|
|
@ -176,12 +176,12 @@ export function useCommandBar() {
|
|||
|
||||
const fallbackViewCommands: CommandGroup[] = [
|
||||
recentResourcesGroup,
|
||||
instanceAiCommandGroup,
|
||||
projectNavigationGroup,
|
||||
workflowNavigationGroup,
|
||||
credentialNavigationGroup,
|
||||
dataTableNavigationGroup,
|
||||
executionNavigationGroup,
|
||||
instanceAiCommandGroup,
|
||||
genericCommandGroup,
|
||||
];
|
||||
|
||||
|
|
|
|||
|
|
@ -7,6 +7,16 @@ import { useSettingsStore } from '@/app/stores/settings.store';
|
|||
import { useInstanceAiStore } from '@/features/ai/instanceAi/instanceAi.store';
|
||||
import { INSTANCE_AI_VIEW, INSTANCE_AI_THREAD_VIEW } from '@/features/ai/instanceAi/constants';
|
||||
|
||||
const NAME_KEYWORDS = [
|
||||
'assistant',
|
||||
'ai assistant',
|
||||
'instance ai',
|
||||
'ai',
|
||||
'agent',
|
||||
'n8n agent',
|
||||
'chat',
|
||||
];
|
||||
|
||||
export function useInstanceAiCommands(options: { lastQuery: Ref<string> }): CommandGroup {
|
||||
const i18n = useI18n();
|
||||
const { lastQuery } = options;
|
||||
|
|
@ -34,7 +44,7 @@ export function useInstanceAiCommands(options: { lastQuery: Ref<string> }): Comm
|
|||
id: thread.id,
|
||||
title: thread.title,
|
||||
section: i18n.baseText('commandBar.instanceAi.openThread'),
|
||||
keywords: [thread.title],
|
||||
keywords: [...NAME_KEYWORDS, thread.title],
|
||||
handler: () => {
|
||||
void router.push({ name: INSTANCE_AI_THREAD_VIEW, params: { threadId: thread.id } });
|
||||
},
|
||||
|
|
@ -56,7 +66,7 @@ export function useInstanceAiCommands(options: { lastQuery: Ref<string> }): Comm
|
|||
component: N8nIcon,
|
||||
props: { icon: 'sparkles' },
|
||||
},
|
||||
keywords: ['instance ai', 'ai', 'agent', 'assistant'],
|
||||
keywords: [...NAME_KEYWORDS, 'open', 'view'],
|
||||
},
|
||||
{
|
||||
id: 'instance-ai-new-thread',
|
||||
|
|
@ -70,7 +80,7 @@ export function useInstanceAiCommands(options: { lastQuery: Ref<string> }): Comm
|
|||
component: N8nIcon,
|
||||
props: { icon: 'plus' },
|
||||
},
|
||||
keywords: ['instance ai', 'new', 'conversation', 'thread'],
|
||||
keywords: [...NAME_KEYWORDS, 'new', 'conversation', 'thread', 'chat'],
|
||||
},
|
||||
{
|
||||
id: 'instance-ai-open-thread',
|
||||
|
|
@ -82,6 +92,7 @@ export function useInstanceAiCommands(options: { lastQuery: Ref<string> }): Comm
|
|||
component: N8nIcon,
|
||||
props: { icon: 'message-square', color: 'text-light' },
|
||||
},
|
||||
keywords: [...NAME_KEYWORDS, 'open', 'conversation', 'thread', 'chat'],
|
||||
},
|
||||
];
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue