Skip to content

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

feat(sql-editor): change ai input placeholder when generating vs editing

Greg Richardson50ecc0d27805
diff --git a/studio/components/interfaces/SQLEditor/MonacoEditor.tsx b/studio/components/interfaces/SQLEditor/MonacoEditor.tsx
index 1a9e1fccaa4..660499d712e 100644
--- a/studio/components/interfaces/SQLEditor/MonacoEditor.tsx
+++ b/studio/components/interfaces/SQLEditor/MonacoEditor.tsx
@@ -70,7 +70,9 @@ const MonacoEditor = ({
}
function handleEditorChange(value: string | undefined) {
- if (id && value) snap.setSql(id, value)
+ if (id && value !== undefined) {
+ snap.setSql(id, value)
+ }
}
return (
diff --git a/studio/components/interfaces/SQLEditor/SQLEditor.tsx b/studio/components/interfaces/SQLEditor/SQLEditor.tsx
index ac732cdb5d6..eef64c14941 100644
--- a/studio/components/interfaces/SQLEditor/SQLEditor.tsx
+++ b/studio/components/interfaces/SQLEditor/SQLEditor.tsx
@@ -530,7 +530,13 @@ const SQLEditor = () => {
'focus-visible:ring-0 focus-visible:ring-offset-0',
'appearance-none outline-none'
)}
- placeholder={!debugSolution ? 'Ask Supabase AI to modify your query' : ''}
+ placeholder={
+ !debugSolution
+ ? !snippet?.snippet.content.sql.trim()
+ ? 'Ask Supabase AI to build a query'
+ : 'Ask Supabase AI to modify your query'
+ : ''
+ }
onKeyDown={(e) => {
if (e.key === 'Escape' && !aiInput) {
setIsAiOpen(false)