Files
supabase/apps/studio/components/ui/EditorPanel/EditorPanel.utils.ts
T
Jordi Enric 233c2d4a4c feat(inline sql editor): snippet management in editor panel (#43011)
- EditorPanel can now load, save, and rename SQL snippets inline
- New SaveSnippetDialog component for saving snippets with AI-generated
titles
- EditorPanel state tracks active snippet ID and pending reset
- EditQueryButton opens the inline editor panel instead of navigating to
SQL editor page
- AIEditor exposes onMount callback for editor instance access
- SnippetDropdown label updated to "Create snippet"


## TO TEST 

### Normal CRUD
- open inline SQL Editor
- try creating a new snippet
- try editing an existing snippet

### Homepage V2 Report
- Try adding a new block → create snippet
- create the snippet in inline sql editor
- select the snippet in the report block section
2026-02-23 10:11:58 +01:00

10 lines
388 B
TypeScript

import type { SqlError } from 'state/editor-panel-state'
export function formatSqlError(error: SqlError): { header: string | undefined; lines: string[] } {
if (error.formattedError) {
const lines = error.formattedError.split('\n').filter((l) => l.length > 0)
return { header: lines[0], lines: lines.slice(1) }
}
return { header: undefined, lines: [error.message ?? ''] }
}