From 254e9a89c5b520c995f9fad39efb448934f69111 Mon Sep 17 00:00:00 2001 From: Michael Drury Date: Mon, 13 Oct 2025 09:04:08 +0100 Subject: [PATCH] feat(editor): Randomise the order of prompt suggestions (no-changelog) (#20597) --- .../assistant/components/Agent/AskAssistantBuild.vue | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/frontend/editor-ui/src/features/assistant/components/Agent/AskAssistantBuild.vue b/packages/frontend/editor-ui/src/features/assistant/components/Agent/AskAssistantBuild.vue index 5ced67973c5..31ad4701bf4 100644 --- a/packages/frontend/editor-ui/src/features/assistant/components/Agent/AskAssistantBuild.vue +++ b/packages/frontend/editor-ui/src/features/assistant/components/Agent/AskAssistantBuild.vue @@ -7,13 +7,13 @@ import { useI18n } from '@n8n/i18n'; import { useWorkflowsStore } from '@/stores/workflows.store'; import { useRoute, useRouter } from 'vue-router'; import { useWorkflowSaving } from '@/composables/useWorkflowSaving'; -import type { RatingFeedback } from '@n8n/design-system/types/assistant'; +import type { RatingFeedback, WorkflowSuggestion } from '@n8n/design-system/types/assistant'; import { isWorkflowUpdatedMessage } from '@n8n/design-system/types/assistant'; import { nodeViewEventBus } from '@/event-bus'; import ExecuteMessage from './ExecuteMessage.vue'; import { usePageRedirectionHelper } from '@/composables/usePageRedirectionHelper'; import { WORKFLOW_SUGGESTIONS } from '@/constants/workflowSuggestions'; -import type { WorkflowSuggestion } from '@n8n/design-system/types/assistant'; +import shuffle from 'lodash/shuffle'; import { N8nAskAssistantChat, N8nText } from '@n8n/design-system'; @@ -71,7 +71,8 @@ const showAskOwnerTooltip = computed(() => !usersStore.isInstanceOwner); const workflowSuggestions = computed(() => { // Only show suggestions when no messages in chat yet (blank state) if (builderStore.chatMessages.length === 0) { - return WORKFLOW_SUGGESTIONS; + // Shuffle the suggestions to show them in random order + return shuffle(WORKFLOW_SUGGESTIONS); } return undefined; });