From 0173d8f70714636aaa75a3c4e0bf07880cf8ba6c Mon Sep 17 00:00:00 2001 From: Suguru Inoue Date: Wed, 17 Sep 2025 10:42:40 +0200 Subject: [PATCH] refactor(editor): Migrate mapper popover to ruka UI (#19564) --- cypress/e2e/45-ai-assistant.cy.ts | 3 + .../N8nPopoverReka/N8nPopoverReka.test.ts | 28 ++ .../N8nPopoverReka/N8nPopoverReka.vue | 76 +++- .../__snapshots__/N8nPopoverReka.test.ts.snap | 6 +- .../frontend/editor-ui/src/__tests__/mocks.ts | 11 + .../components/ExpressionParameterInput.vue | 1 - .../InlineExpressionEditorOutput.test.ts | 16 +- .../InlineExpressionEditorOutput.vue | 110 +++-- .../src/components/ParameterInput.test.ts | 28 +- .../src/components/SQLEditor.test.ts | 15 +- .../__snapshots__/WhatsNewModal.test.ts.snap | 376 ------------------ .../ExperimentalEmbeddedNdvMapper.vue | 106 ++--- .../playwright/pages/components/FocusPanel.ts | 2 +- 13 files changed, 212 insertions(+), 566 deletions(-) diff --git a/cypress/e2e/45-ai-assistant.cy.ts b/cypress/e2e/45-ai-assistant.cy.ts index 008d224f78..d82b673ead 100644 --- a/cypress/e2e/45-ai-assistant.cy.ts +++ b/cypress/e2e/45-ai-assistant.cy.ts @@ -244,6 +244,9 @@ describe('AI Assistant::enabled', () => { ndv.getters.nodeExecuteButton().click(); + // Wait for a message from AI to be shown + aiAssistant.getters.chatMessagesAssistant().should('have.length', 3); + getEditor() .type('{selectall}') .paste( diff --git a/packages/frontend/@n8n/design-system/src/components/N8nPopoverReka/N8nPopoverReka.test.ts b/packages/frontend/@n8n/design-system/src/components/N8nPopoverReka/N8nPopoverReka.test.ts index 9193501729..67faa8c94f 100644 --- a/packages/frontend/@n8n/design-system/src/components/N8nPopoverReka/N8nPopoverReka.test.ts +++ b/packages/frontend/@n8n/design-system/src/components/N8nPopoverReka/N8nPopoverReka.test.ts @@ -113,4 +113,32 @@ describe('N8nPopoverReka', () => { expect(wrapper.props('maxHeight')).toBeUndefined(); }); + + describe('auto-focus behavior', () => { + it('should focus an element in the content slot by default', async () => { + const wrapper = render(N8nPopoverReka, { + props: { open: true }, + slots: { + trigger: '