diff --git a/packages/web/src/icons/FontIcon.svelte b/packages/web/src/icons/FontIcon.svelte index 06d4b956f..4cf0e103a 100644 --- a/packages/web/src/icons/FontIcon.svelte +++ b/packages/web/src/icons/FontIcon.svelte @@ -287,6 +287,7 @@ 'img import': 'mdi mdi-database-import color-icon-green', 'img export': 'mdi mdi-database-export color-icon-green', 'img transform': 'mdi mdi-rotate-orbit color-icon-blue', + 'img tip': 'mdi mdi-lightbulb-on color-icon-yellow', }; diff --git a/packages/web/src/settings/SettingsModal.svelte b/packages/web/src/settings/SettingsModal.svelte index a59fcafbe..e0febfb22 100644 --- a/packages/web/src/settings/SettingsModal.svelte +++ b/packages/web/src/settings/SettingsModal.svelte @@ -100,7 +100,7 @@ ORDER BY { label: 'Connection', slot: 2 }, { label: 'Themes', slot: 3 }, { label: 'Default Actions', slot: 4 }, - { label: 'Confirmations', slot: 5 }, + { label: 'Behaviour', slot: 5 }, { label: 'Other', slot: 6 }, ]} > @@ -331,6 +331,17 @@ ORDER BY /> +
Behaviour
+ + + +
+ When you single-click or select a file in the "Tables, Views, Functions" view, it + is shown in a preview mode and reuses an existing tab (preview tab). This is useful if you are quickly browsing + tables and don't want every visited table to have its own tab. When you start editing the table or use double-click + to open the table from the "Tables" view, a new tab is dedicated to that table. +
+
Confirmations
@@ -405,6 +416,11 @@ ORDER BY margin-top: var(--dim-large-form-margin); } + .tip { + margin-left: var(--dim-large-form-margin); + margin-top: var(--dim-large-form-margin); + } + .themes { overflow-x: scroll; display: flex; diff --git a/packages/web/src/utility/openNewTab.ts b/packages/web/src/utility/openNewTab.ts index 0d724fc3f..a6a229738 100644 --- a/packages/web/src/utility/openNewTab.ts +++ b/packages/web/src/utility/openNewTab.ts @@ -7,6 +7,7 @@ import localforage from 'localforage'; import stableStringify from 'json-stable-stringify'; import { saveAllPendingEditorData } from '../query/useEditorData'; import { getConnectionInfo } from './metadataLoaders'; +import { getBoolSettingsValue } from '../settings/settingsTools'; function findFreeNumber(numbers: number[]) { if (numbers.length == 0) return 1; @@ -22,6 +23,13 @@ export default async function openNewTab(newTab, initialData: any = undefined, o let existing = null; + if (!getBoolSettingsValue('behaviour.useTabPreviewMode', true) && newTab.tabPreviewMode) { + newTab = { + ...newTab, + tabPreviewMode: false, + }; + } + const { savedFile, savedFolder, savedFilePath, conid, database } = newTab.props || {}; if (conid && database) {