feat(query-editor): enhance current statement framing

This commit is contained in:
二丫讲梵 authored and GitHub committed 2026-07-06 23:09:21 +08:00
1 parent 75fcd253cb
commit 18e5df6f5e
18 files changed
+480 -10

No files matched your search

@@ -10,6 +10,14 @@ describe("normalizeEditorSettings", () => {
expect(normalizeEditorSettings({ autoAliasTables: false }).autoAliasTables).toBe(false);
});
it("shows the current statement frame by default", () => {
expect(normalizeEditorSettings({}).showCurrentStatementFrame).toBe(true);
});
it("preserves disabled current statement frames", () => {
expect(normalizeEditorSettings({ showCurrentStatementFrame: false }).showCurrentStatementFrame).toBe(false);
});
it("keeps SQL semantic diagnostics in auto mode and disabled by default", () => {
const settings = normalizeEditorSettings({});
expect(settings.sqlSemanticDiagnosticsMode).toBe("auto");
+4
View File
@@ -371,6 +371,7 @@ export interface EditorSettings {
executeMode: "all" | "current";
showExecutionTargetPicker: boolean;
showStatementRunButtons: boolean;
showCurrentStatementFrame: boolean;
autoAliasTables: boolean;
wordWrap: boolean;
vimModeEnabled: boolean;
@@ -496,6 +497,7 @@ export const DEFAULT_EDITOR_SETTINGS: EditorSettings = {
executeMode: "all",
showExecutionTargetPicker: false,
showStatementRunButtons: true,
showCurrentStatementFrame: true,
autoAliasTables: true,
wordWrap: false,
vimModeEnabled: false,
@@ -718,6 +720,7 @@ export function normalizeEditorSettings(settings: Partial<EditorSettings>, exist
executeMode: settings.executeMode ?? DEFAULT_EDITOR_SETTINGS.executeMode,
showExecutionTargetPicker: settings.showExecutionTargetPicker ?? DEFAULT_EDITOR_SETTINGS.showExecutionTargetPicker,
showStatementRunButtons: typeof settings.showStatementRunButtons === "boolean" ? settings.showStatementRunButtons : DEFAULT_EDITOR_SETTINGS.showStatementRunButtons,
showCurrentStatementFrame: typeof settings.showCurrentStatementFrame === "boolean" ? settings.showCurrentStatementFrame : DEFAULT_EDITOR_SETTINGS.showCurrentStatementFrame,
autoAliasTables: settings.autoAliasTables ?? DEFAULT_EDITOR_SETTINGS.autoAliasTables,
wordWrap: settings.wordWrap ?? DEFAULT_EDITOR_SETTINGS.wordWrap,
vimModeEnabled: typeof settings.vimModeEnabled === "boolean" ? settings.vimModeEnabled : DEFAULT_EDITOR_SETTINGS.vimModeEnabled,
@@ -952,6 +955,7 @@ export const useSettingsStore = defineStore("settings", () => {
if (partial.executeMode !== undefined) editorSettings.value.executeMode = partial.executeMode;
if (partial.showExecutionTargetPicker !== undefined) editorSettings.value.showExecutionTargetPicker = partial.showExecutionTargetPicker;
if (partial.showStatementRunButtons !== undefined) editorSettings.value.showStatementRunButtons = partial.showStatementRunButtons === true;
if (partial.showCurrentStatementFrame !== undefined) editorSettings.value.showCurrentStatementFrame = partial.showCurrentStatementFrame === true;
if (partial.autoAliasTables !== undefined) editorSettings.value.autoAliasTables = partial.autoAliasTables;
if (partial.wordWrap !== undefined) editorSettings.value.wordWrap = partial.wordWrap;
if (partial.vimModeEnabled !== undefined) editorSettings.value.vimModeEnabled = partial.vimModeEnabled === true;