diff --git a/apps/remix-ide/src/app/components/bottom-bar.tsx b/apps/remix-ide/src/app/components/bottom-bar.tsx index 82ce71dac11..3300738351f 100644 --- a/apps/remix-ide/src/app/components/bottom-bar.tsx +++ b/apps/remix-ide/src/app/components/bottom-bar.tsx @@ -64,6 +64,12 @@ export const BottomBar = ({ plugin }: BottomBarProps) => { } setExplaining(true) try { + // Check if pinned panel has a closed plugin and maximize it + const closedPlugin = await plugin.call('pinnedPanel', 'getClosedPlugin') + if (closedPlugin) { + await plugin.call('pinnedPanel', 'maximizePlugin', closedPlugin) + } + await plugin.call('menuicons', 'select', 'remixaiassistant') await new Promise((resolve) => setTimeout(resolve, 500)) const content = await plugin.call('fileManager', 'readFile', currentFilePath) diff --git a/libs/remix-ui/editor/src/lib/remix-ui-editor.tsx b/libs/remix-ui/editor/src/lib/remix-ui-editor.tsx index 3d2a6f68f71..3839f2e805d 100644 --- a/libs/remix-ui/editor/src/lib/remix-ui-editor.tsx +++ b/libs/remix-ui/editor/src/lib/remix-ui-editor.tsx @@ -1015,6 +1015,11 @@ export const EditorUI = (props: EditorUIProps) => { const message = intl.formatMessage({ id: 'editor.explainFunctionByAI' }, { content:context, currentFunction: currentFunction.current }) await props.plugin.call('popupPanel', 'showPopupPanel', true) setTimeout(async () => { + // Check if pinned panel has a closed plugin and maximize it + const closedPlugin = await props.plugin.call('pinnedPanel', 'getClosedPlugin') + if (closedPlugin) { + await props.plugin.call('pinnedPanel', 'maximizePlugin', closedPlugin) + } await props.plugin.call('remixAI' as any, 'chatPipe', 'code_explaining', message, context) }, 500) trackMatomoEvent({ category: 'ai', action: 'remixAI', name: 'explainFunction', isClick: true }) @@ -1039,6 +1044,11 @@ export const EditorUI = (props: EditorUIProps) => { await props.plugin.call('popupPanel', 'showPopupPanel', true) setTimeout(async () => { + // Check if pinned panel has a closed plugin and maximize it + const closedPlugin = await props.plugin.call('pinnedPanel', 'getClosedPlugin') + if (closedPlugin) { + await props.plugin.call('pinnedPanel', 'maximizePlugin', closedPlugin) + } await props.plugin.call('remixAI' as any, 'chatPipe', 'code_explaining', selectedCode, content, pipeMessage) }, 500) trackMatomoEvent({ category: 'ai', action: 'remixAI', name: 'explainFunction', isClick: true })