From 80e08db911ab9141b578376d00c13441d8d2d27d Mon Sep 17 00:00:00 2001 From: Suguru Inoue Date: Mon, 22 Sep 2025 12:24:10 +0200 Subject: [PATCH] fix(editor): Fix position of notification toast and "Ask AI" floating button (#19694) --- packages/frontend/editor-ui/src/App.vue | 12 ++-- .../Chat/AskAssistantFloatingButton.vue | 15 +---- .../src/composables/useExposeCssVar.test.ts | 42 ++++++++++++ .../src/composables/useExposeCssVar.ts | 22 ++++++ .../composables/useFloatingUiOffsets.test.ts | 64 ++++++++++++++++++ .../src/composables/useFloatingUiOffsets.ts | 35 ++++++++++ .../src/composables/useToast.test.ts | 67 ------------------- .../editor-ui/src/composables/useToast.ts | 23 +------ packages/frontend/editor-ui/src/constants.ts | 1 - .../logs/composables/useLogsPanelLayout.ts | 11 ++- .../frontend/editor-ui/src/n8n-theme.scss | 1 + .../editor-ui/src/stores/assistant.store.ts | 12 +++- 12 files changed, 187 insertions(+), 118 deletions(-) create mode 100644 packages/frontend/editor-ui/src/composables/useExposeCssVar.test.ts create mode 100644 packages/frontend/editor-ui/src/composables/useExposeCssVar.ts create mode 100644 packages/frontend/editor-ui/src/composables/useFloatingUiOffsets.test.ts create mode 100644 packages/frontend/editor-ui/src/composables/useFloatingUiOffsets.ts diff --git a/packages/frontend/editor-ui/src/App.vue b/packages/frontend/editor-ui/src/App.vue index 4f49db8e0f9..b766d9184ea 100644 --- a/packages/frontend/editor-ui/src/App.vue +++ b/packages/frontend/editor-ui/src/App.vue @@ -30,6 +30,8 @@ import axios from 'axios'; import { computed, nextTick, onBeforeUnmount, onMounted, ref, watch } from 'vue'; import { useRoute } from 'vue-router'; import { useStyles } from './composables/useStyles'; +import { useExposeCssVar } from '@/composables/useExposeCssVar'; +import { useFloatingUiOffsets } from '@/composables/useFloatingUiOffsets'; const route = useRoute(); const rootStore = useRootStore(); @@ -41,6 +43,7 @@ const settingsStore = useSettingsStore(); const ndvStore = useNDVStore(); const { setAppZIndexes } = useStyles(); +const { toastBottomOffset, askAiFloatingButtonBottomOffset } = useFloatingUiOffsets(); // Initialize undo/redo useHistoryHelper(route); @@ -51,10 +54,6 @@ useWorkflowDiffRouting(); const loading = ref(true); const defaultLocale = computed(() => rootStore.defaultLocale); const isDemoMode = computed(() => route.name === VIEWS.DEMO); -const showAssistantFloatingButton = computed( - () => - assistantStore.canShowAssistantButtonsOnCanvas && !assistantStore.hideAssistantFloatingButton, -); const hasContentFooter = ref(false); const appGrid = ref(null); @@ -109,6 +108,9 @@ watch( }, { immediate: true }, ); + +useExposeCssVar('--toast-bottom-offset', toastBottomOffset); +useExposeCssVar('--ask-assistant-floating-button-bottom-offset', askAiFloatingButtonBottomOffset);