feat(desktop): add pinned auto-show table info panel
This commit is contained in:
14 files changed
+104
No files matched your search
@@ -23,6 +23,13 @@ describe("normalizeEditorSettings", () => {
|
||||
expect(normalizeEditorSettings({ refreshDdlOnOpen: "true" } as any).refreshDdlOnOpen).toBe(false);
|
||||
});
|
||||
|
||||
it("keeps table-info drawer pinning disabled unless explicitly enabled", () => {
|
||||
expect(normalizeEditorSettings({}).tableInfoDrawerPinned).toBe(false);
|
||||
expect(normalizeEditorSettings({ tableInfoDrawerPinned: true }).tableInfoDrawerPinned).toBe(true);
|
||||
expect(normalizeEditorSettings({ tableInfoDrawerPinned: false }).tableInfoDrawerPinned).toBe(false);
|
||||
expect(normalizeEditorSettings({ tableInfoDrawerPinned: "true" } as any).tableInfoDrawerPinned).toBe(false);
|
||||
});
|
||||
|
||||
it("enables SQL variable substitution by default and only preserves booleans", () => {
|
||||
expect(normalizeEditorSettings({}).sqlVariableSubstitutionEnabled).toBe(true);
|
||||
expect(normalizeEditorSettings({ sqlVariableSubstitutionEnabled: true }).sqlVariableSubstitutionEnabled).toBe(true);
|
||||
|
||||
@@ -776,6 +776,7 @@ export interface EditorSettings {
|
||||
tableFontSize: number;
|
||||
structureEditorDensity: StructureEditorDensity;
|
||||
tableInfoActiveTab: TableInfoTab;
|
||||
tableInfoDrawerPinned: boolean;
|
||||
tableInfoDrawerWidth: number;
|
||||
cellDetailDrawerWidth: number;
|
||||
cellDetailPanelLayout: CellDetailPanelLayout;
|
||||
@@ -1004,6 +1005,7 @@ export const DEFAULT_EDITOR_SETTINGS: EditorSettings = {
|
||||
tableFontSize: TABLE_FONT_SIZE_DEFAULT,
|
||||
structureEditorDensity: "compact",
|
||||
tableInfoActiveTab: "ddl",
|
||||
tableInfoDrawerPinned: false,
|
||||
tableInfoDrawerWidth: 320,
|
||||
cellDetailDrawerWidth: 380,
|
||||
cellDetailPanelLayout: "bottom",
|
||||
@@ -1448,6 +1450,7 @@ export function normalizeEditorSettings(settings: Partial<EditorSettings>, exist
|
||||
tableFontSize: normalizeTableFontSize(settings.tableFontSize),
|
||||
structureEditorDensity: normalizeStructureEditorDensity(settings.structureEditorDensity),
|
||||
tableInfoActiveTab: normalizeTableInfoTab(settings.tableInfoActiveTab),
|
||||
tableInfoDrawerPinned: settings.tableInfoDrawerPinned === true,
|
||||
tableInfoDrawerWidth: normalizeDrawerWidth(settings.tableInfoDrawerWidth, 240, DEFAULT_EDITOR_SETTINGS.tableInfoDrawerWidth),
|
||||
cellDetailDrawerWidth: normalizeDrawerWidth(settings.cellDetailDrawerWidth, 260, DEFAULT_EDITOR_SETTINGS.cellDetailDrawerWidth),
|
||||
cellDetailPanelLayout: normalizeCellDetailPanelLayout(settings.cellDetailPanelLayout),
|
||||
@@ -2161,6 +2164,7 @@ export const useSettingsStore = defineStore("settings", () => {
|
||||
if (partial.tableFontSize !== undefined) editorSettings.value.tableFontSize = normalizeTableFontSize(partial.tableFontSize);
|
||||
if (partial.structureEditorDensity !== undefined) editorSettings.value.structureEditorDensity = normalizeStructureEditorDensity(partial.structureEditorDensity);
|
||||
if (partial.tableInfoActiveTab !== undefined) editorSettings.value.tableInfoActiveTab = normalizeTableInfoTab(partial.tableInfoActiveTab);
|
||||
if (partial.tableInfoDrawerPinned !== undefined) editorSettings.value.tableInfoDrawerPinned = partial.tableInfoDrawerPinned === true;
|
||||
if (partial.tableInfoDrawerWidth !== undefined) editorSettings.value.tableInfoDrawerWidth = normalizeDrawerWidth(partial.tableInfoDrawerWidth, 240, DEFAULT_EDITOR_SETTINGS.tableInfoDrawerWidth);
|
||||
if (partial.cellDetailDrawerWidth !== undefined) editorSettings.value.cellDetailDrawerWidth = normalizeDrawerWidth(partial.cellDetailDrawerWidth, 260, DEFAULT_EDITOR_SETTINGS.cellDetailDrawerWidth);
|
||||
if (partial.cellDetailPanelLayout !== undefined) editorSettings.value.cellDetailPanelLayout = normalizeCellDetailPanelLayout(partial.cellDetailPanelLayout);
|
||||
|
||||
Reference in new issue
Block a user