Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

fix(sql-editor): debug ai layout and styles

Greg Richardsond1bd43778ee9
diff --git a/studio/components/interfaces/SQLEditor/SQLEditor.tsx b/studio/components/interfaces/SQLEditor/SQLEditor.tsx
index 973dd3a836f..6023ac8a6d8 100644
--- a/studio/components/interfaces/SQLEditor/SQLEditor.tsx
+++ b/studio/components/interfaces/SQLEditor/SQLEditor.tsx
@@ -483,7 +483,7 @@ const SQLEditor = () => {
{debugSolution}
</div>
)}
- {!isEditSqlLoading ? (
+ {!isEditSqlLoading && !debugSolution && (
<motion.div
key="ask-ai-input"
className="w-full h-full relative flex items-center"
@@ -582,7 +582,8 @@ const SQLEditor = () => {
}}
/>
</motion.div>
- ) : (
+ )}
+ {isEditSqlLoading && (
<motion.div
key="ask-ai-loading"
className="p-0 flex flex-row gap-2 items-center w-full"
diff --git a/studio/components/interfaces/SQLEditor/UtilityPanel/UtilityTabResults.tsx b/studio/components/interfaces/SQLEditor/UtilityPanel/UtilityTabResults.tsx
index 017fc4c1ed4..235e1ae16e4 100644
--- a/studio/components/interfaces/SQLEditor/UtilityPanel/UtilityTabResults.tsx
+++ b/studio/components/interfaces/SQLEditor/UtilityPanel/UtilityTabResults.tsx
@@ -5,7 +5,7 @@ import { useLocalStorageQuery, useSelectedOrganization, useSelectedProject, useS
import { IS_PLATFORM } from 'lib/constants'
import { format } from 'sql-formatter'
import { useSqlEditorStateSnapshot } from 'state/sql-editor'
-import { AiIcon, Button, IconLoader } from 'ui'
+import { AiIconAnimation, Button } from 'ui'
import { useSqlEditor } from '../SQLEditor'
import { sqlAiDisclaimerComment } from '../SQLEditor.constants'
import Results from './Results'
@@ -57,11 +57,9 @@ const UtilityTabResults = ({ id, isExecuting }: UtilityTabResultsProps) => {
<p className="m-0 border-0 px-6 py-4 font-mono">{result.error.message ?? result.error}</p>
<Button
icon={
- !isDebugSqlLoading ? (
- <AiIcon className="w-3 h-3" />
- ) : (
- <IconLoader className="animate-spin" size={14} />
- )
+ <div className="scale-75">
+ <AiIconAnimation className="w-3 h-3" loading={isDebugSqlLoading} />
+ </div>
}
disabled={!!sqlDiff}
onClick={async () => {