Skip to content

Commit 51a65d9

Browse files
scdekovclaude
andauthored
fix(editor): Remove toast bottom offset when AI chat panel is open (#27132)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 90b2b9c commit 51a65d9

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

packages/frontend/editor-ui/src/app/composables/useFloatingUiOffsets.test.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
useWorkflowDocumentStore,
88
createWorkflowDocumentId,
99
} from '@/app/stores/workflowDocument.store';
10+
import { useChatPanelStateStore } from '@/features/ai/assistant/chatPanelState.store';
1011
import { setActivePinia } from 'pinia';
1112
import { useFloatingUiOffsets } from './useFloatingUiOffsets';
1213
import { reactive } from 'vue';
@@ -54,6 +55,18 @@ describe(useFloatingUiOffsets, () => {
5455
expect(toastBottomOffset.value).toBe('3px');
5556
});
5657

58+
it('should not account for the height of log view when chat panel is open', () => {
59+
useLogsStore().setHeight(300);
60+
61+
const { toastBottomOffset } = useFloatingUiOffsets();
62+
63+
expect(toastBottomOffset.value).toBe('300px');
64+
65+
useChatPanelStateStore().isOpen = true;
66+
67+
expect(toastBottomOffset.value).toBe('0px');
68+
});
69+
5770
it.each(EDITABLE_CANVAS_VIEWS)(
5871
'should account for the height of AI assistant floating button in %s only when the button is displayed',
5972
async (view) => {

packages/frontend/editor-ui/src/app/composables/useFloatingUiOffsets.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export function useFloatingUiOffsets() {
1818
return {
1919
askAiFloatingButtonBottomOffset: computed(() => `${askAiOffset.value}px`),
2020
toastBottomOffset: computed(() => {
21-
const logsPanelOffset = ndvStore.isNDVOpen ? 0 : logsStore.height;
21+
const logsPanelOffset = ndvStore.isNDVOpen || chatPanelStore.isOpen ? 0 : logsStore.height;
2222
const assistantOffset = assistantStore.isFloatingButtonShown
2323
? ASSISTANT_FLOATING_BUTTON_SIZE + askAiOffset.value
2424
: 0;

0 commit comments

Comments
 (0)