feat(tabs): add adjacent data tab opening option

Closes #3723
This commit is contained in:
t8y2 committed 2026-08-15 00:52:24 +00:00
1 parent fbaf556f3a
commit 4768dbb99a
19 files changed
+192 -7

No files matched your search

@@ -61,6 +61,10 @@ describe("EDITOR_SETTINGS_DRAFT_KEYS", () => {
expect(EDITOR_SETTINGS_DRAFT_KEYS).toContain("dataTabReuseMode");
});
it("includes adjacent data-tab opening", () => {
expect(EDITOR_SETTINGS_DRAFT_KEYS).toContain("openDataTabsNextToActive");
});
it("includes data grid type colors", () => {
expect(EDITOR_SETTINGS_DRAFT_KEYS).toContain("colorizeDataGridCellTypes");
});
@@ -208,6 +212,14 @@ describe("editorSettingsDraftChanged", () => {
expect(editorSettingsDraftChanged(draft, base)).toBe(true);
});
it("detects adjacent data-tab opening changes", () => {
const settings = makeSettings({ openDataTabsNextToActive: false });
const draft = editorSettingsDraftFromSettings(settings);
const base = editorSettingsDraftFromSettings(settings);
draft.openDataTabsNextToActive = true;
expect(editorSettingsDraftChanged(draft, base)).toBe(true);
});
it("detects completionTriggerMode change", () => {
const settings = makeSettings({ completionTriggerMode: "positional" } as Partial<EditorSettings>);
const draft = editorSettingsDraftFromSettings(settings);
@@ -266,6 +278,14 @@ describe("editorSettingsPatchFromDraft", () => {
expect(editorSettingsPatchFromDraft(draft, base).dataTabReuseMode).toBe("always-new");
});
it("includes adjacent data-tab opening when changed", () => {
const settings = makeSettings({ openDataTabsNextToActive: false });
const draft = editorSettingsDraftFromSettings(settings);
const base = editorSettingsDraftFromSettings(settings);
draft.openDataTabsNextToActive = true;
expect(editorSettingsPatchFromDraft(draft, base).openDataTabsNextToActive).toBe(true);
});
it("includes completionTriggerMode in patch when changed", () => {
const settings = makeSettings({ completionTriggerMode: "positional" } as Partial<EditorSettings>);
const draft = editorSettingsDraftFromSettings(settings);
@@ -0,0 +1,13 @@
import { readFileSync } from "node:fs";
import { describe, expect, it } from "vitest";
const settingsDialogSource = readFileSync(new URL("../../../components/editor/EditorSettingsDialog.vue", import.meta.url), "utf8");
describe("openDataTabsNextToActive settings control", () => {
it("binds the navigation switch through apply and both reset paths", () => {
expect(settingsDialogSource).toContain("const editOpenDataTabsNextToActive = ref(settingsStore.editorSettings.openDataTabsNextToActive)");
expect(settingsDialogSource).toContain("openDataTabsNextToActive: editOpenDataTabsNextToActive.value");
expect(settingsDialogSource.match(/editOpenDataTabsNextToActive\.value = DEFAULT_EDITOR_SETTINGS\.openDataTabsNextToActive/g)).toHaveLength(2);
expect(settingsDialogSource).toContain('id="open-data-tabs-next-to-active" v-model="editOpenDataTabsNextToActive"');
});
});
@@ -58,6 +58,7 @@ export const EDITOR_SETTINGS_DRAFT_KEYS = [
"openTabsRestoreMode",
"disconnectTabHandlingMode",
"dataTabReuseMode",
"openDataTabsNextToActive",
"prefillNewQueryWithSelect",
"updateNotificationsEnabled",
"sidebarObjectInfoMode",
@@ -159,6 +159,7 @@ export const SETTINGS_SEARCH_DEFINITIONS: readonly SettingsSearchDefinition[] =
{ id: "navigation-sidebar", category: "navigation", titleKey: "settings.sidebarActivation", targetId: "navigation" },
{ id: "navigation-routine-source", category: "navigation", titleKey: "settings.routineSourceOpenMode", descriptionKey: "settings.routineSourceOpenModeDescription", targetId: "navigation" },
{ id: "navigation-reuse-data-tab", category: "navigation", titleKey: "settings.reuseDataTab", descriptionKey: "settings.reuseDataTabDescription", targetId: "navigation" },
{ id: "navigation-open-data-tabs-next-to-active", category: "navigation", titleKey: "settings.openDataTabsNextToActive", descriptionKey: "settings.openDataTabsNextToActiveDescription", targetId: "navigation" },
{ id: "navigation-object-display", category: "navigation", titleKey: "settings.sidebarObjectDisplay", targetId: "navigation" },
{ id: "navigation-object-info", category: "navigation", titleKey: "settings.sidebarObjectInfoMode", descriptionKey: "settings.sidebarObjectInfoModeDescription", targetId: "navigation" },
{ id: "navigation-table-search", category: "navigation", titleKey: "settings.sidebarTableSearchEnabled", descriptionKey: "settings.sidebarTableSearchEnabledDescription", targetId: "navigation" },