Files
supabase/apps/studio/state/shortcuts/registry/sql-editor.ts
Ali Waseem b100272376 chore(sql-editor): remove Pretty Explain feature (#47981)
Removes the SQL Editor Pretty Explain feature — the Explain tab, the Run
EXPLAIN ANALYZE action + shortcut, and its dead plumbing. It's been
gated off behind the `DisablePrettyExplainOnSqlEditor` kill switch for
weeks with no usage or complaints.

`ExplainVisualizer` / `isExplainQuery` are kept — they're used
independently by Query Insights, Query Performance, and the EditorPanel
quick-runner. Manually-run `EXPLAIN` queries still render as raw rows in
the Results tab.

Typecheck, lint, and all affected unit tests pass.

Closes FE-3930

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Changes**
* Removed the SQL editor’s EXPLAIN execution workflow, including its
toolbar action, keyboard shortcut, utility tab, and visual query-plan
display.
  * Simplified query execution to focus on standard results and charts.
* Improved result clearing when switching databases and refined
execution error handling.
* Updated SQL editor state and tests to reflect the streamlined
experience.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-07-16 11:04:34 +08:00

39 lines
1.2 KiB
TypeScript

import { RegistryDefinations } from '../types'
export const SQL_EDITOR_SHORTCUT_IDS = {
SQL_EDITOR_BLUR_EDITOR: 'sql-editor.blur-editor',
SQL_EDITOR_FOCUS_EDITOR: 'sql-editor.focus-editor',
SQL_EDITOR_FORMAT: 'sql-editor.format',
SQL_EDITOR_NEW_SNIPPET: 'sql-editor.new-snippet',
}
export type SqlEditorShortcutId =
(typeof SQL_EDITOR_SHORTCUT_IDS)[keyof typeof SQL_EDITOR_SHORTCUT_IDS]
export const sqlEditorRegistry: RegistryDefinations<SqlEditorShortcutId> = {
[SQL_EDITOR_SHORTCUT_IDS.SQL_EDITOR_BLUR_EDITOR]: {
id: SQL_EDITOR_SHORTCUT_IDS.SQL_EDITOR_BLUR_EDITOR,
label: 'Blur SQL editor',
sequence: ['Escape'],
showInSettings: false,
},
[SQL_EDITOR_SHORTCUT_IDS.SQL_EDITOR_FOCUS_EDITOR]: {
id: SQL_EDITOR_SHORTCUT_IDS.SQL_EDITOR_FOCUS_EDITOR,
label: 'Focus SQL editor',
sequence: ['Shift+E'],
showInSettings: false,
},
[SQL_EDITOR_SHORTCUT_IDS.SQL_EDITOR_FORMAT]: {
id: SQL_EDITOR_SHORTCUT_IDS.SQL_EDITOR_FORMAT,
label: 'Prettify SQL',
sequence: ['Alt+Shift+F'],
showInSettings: false,
},
[SQL_EDITOR_SHORTCUT_IDS.SQL_EDITOR_NEW_SNIPPET]: {
id: SQL_EDITOR_SHORTCUT_IDS.SQL_EDITOR_NEW_SNIPPET,
label: 'New SQL snippet',
sequence: ['Shift+N'],
showInSettings: false,
},
}