feat(sidebar): add setting to disable hover tooltips

This commit is contained in:
Allen authored and GitHub committed 2026-09-02 14:08:06 +08:00
1 parent ee731a3353
commit e619b70d5d
17 files changed
+57 -6

No files matched your search

@@ -120,6 +120,12 @@ describe("normalizeEditorSettings", () => {
expect(normalizeEditorSettings({ sidebarShowConnectionNotes: false }).sidebarShowConnectionNotes).toBe(false);
});
it("shows sidebar tooltips by default and preserves an explicit opt-out", () => {
expect(normalizeEditorSettings({}).sidebarShowTooltips).toBe(true);
expect(normalizeEditorSettings({ sidebarShowTooltips: false }).sidebarShowTooltips).toBe(false);
expect(normalizeEditorSettings({ sidebarShowTooltips: true }).sidebarShowTooltips).toBe(true);
});
it("defaults SQL execution to the current statement and migrates legacy execute-all settings", () => {
expect(normalizeEditorSettings({}).executeMode).toBe("current");
expect(normalizeEditorSettings({ executeMode: "all" }).executeMode).toBe("current");
+4
View File
@@ -748,6 +748,7 @@ export interface EditorSettings {
sidebarCopyTableNameIncludeSchema: boolean;
sidebarObjectInfoMode: SidebarObjectInfoMode;
sidebarShowConnectionNotes: boolean;
sidebarShowTooltips: boolean;
sidebarAllowHorizontalScroll: boolean;
sidebarIndent: number;
sidebarFontSize: number;
@@ -972,6 +973,7 @@ export const DEFAULT_EDITOR_SETTINGS: EditorSettings = {
sidebarCopyTableNameIncludeSchema: false,
sidebarObjectInfoMode: "comment-inline",
sidebarShowConnectionNotes: false,
sidebarShowTooltips: true,
sidebarAllowHorizontalScroll: false,
sidebarIndent: SIDEBAR_INDENT_DEFAULT,
sidebarFontSize: SIDEBAR_FONT_SIZE_DEFAULT,
@@ -1441,6 +1443,7 @@ export function normalizeEditorSettings(settings: Partial<EditorSettings>, exist
).sidebarShowDatabaseSizes,
),
sidebarShowConnectionNotes: settings.sidebarShowConnectionNotes === true,
sidebarShowTooltips: settings.sidebarShowTooltips ?? DEFAULT_EDITOR_SETTINGS.sidebarShowTooltips,
sidebarAllowHorizontalScroll: settings.sidebarAllowHorizontalScroll ?? DEFAULT_EDITOR_SETTINGS.sidebarAllowHorizontalScroll,
sidebarIndent: normalizeSidebarIndent(settings.sidebarIndent),
sidebarFontSize: normalizeSidebarFontSize(settings.sidebarFontSize),
@@ -2033,6 +2036,7 @@ export const useSettingsStore = defineStore("settings", () => {
if (partial.sidebarCopyTableNameIncludeSchema !== undefined) editorSettings.value.sidebarCopyTableNameIncludeSchema = partial.sidebarCopyTableNameIncludeSchema === true;
if (partial.sidebarObjectInfoMode !== undefined) editorSettings.value.sidebarObjectInfoMode = normalizeSidebarObjectInfoMode(partial.sidebarObjectInfoMode);
if (partial.sidebarShowConnectionNotes !== undefined) editorSettings.value.sidebarShowConnectionNotes = partial.sidebarShowConnectionNotes === true;
if (partial.sidebarShowTooltips !== undefined) editorSettings.value.sidebarShowTooltips = partial.sidebarShowTooltips;
if (partial.sidebarAllowHorizontalScroll !== undefined) editorSettings.value.sidebarAllowHorizontalScroll = partial.sidebarAllowHorizontalScroll;
if (partial.sidebarIndent !== undefined) editorSettings.value.sidebarIndent = normalizeSidebarIndent(partial.sidebarIndent);
if (partial.sidebarFontSize !== undefined) editorSettings.value.sidebarFontSize = normalizeSidebarFontSize(partial.sidebarFontSize);