From 9fcb429a9752e010e01a3731e7e61414f27be67c Mon Sep 17 00:00:00 2001 From: broisnees Date: Tue, 24 Nov 2026 16:09:07 +0000 Subject: [PATCH 1/2] Revert "Add a Labs option to open the connection page as a tab (#426)" This reverts commit fb4d282a0d015fcd94d2ba4dd46b326ea77443eb. --- src/lib/components/ConnectionModal.svelte | 156 ++++++++-------------- src/lib/components/SettingsDialog.svelte | 8 -- src/lib/components/StudioShell.svelte | 141 +------------------ src/lib/components/TabBar.svelte | 1 - src/lib/stores/settings.js | 10 +- src/lib/studio-tabs.js | 7 +- src/lib/studio-tabs.test.js | 8 -- 7 files changed, 62 insertions(+), 269 deletions(-) diff --git a/src/lib/components/ConnectionModal.svelte b/src/lib/components/ConnectionModal.svelte index 03ba8b22..e086b256 100644 --- a/src/lib/components/ConnectionModal.svelte +++ b/src/lib/components/ConnectionModal.svelte @@ -137,29 +137,7 @@ ondisconnect = () => {}, /** A saved connection was deleted here; the shell ends its session if open. */ onremoved = (/** @type {string} */ id) => {}, - /** - * Labs, connection page in a tab: drawn in place (a tab's pane, or the - * window when nothing is connected) instead of as a dialog over the app. - */ - inline = false, - /** Inline only: show the saved-connections rail. Off in a tab, where the - * studio's own sidebar lists the connections. */ - showRail = true, - /** Inline only: whether this view is the one on screen (its tab is the - * active one). The page's keyboard and mouse chords only act when it is. */ - active = true, - /** Inline only: bumped by the shell to start over (a new "Edit…" or - * engine request) while the view stays open. */ - resetKey = 0, - /** Inline only: drawn above the form, in place of the dialog's title row - * (the shell's tab strip when nothing is connected). */ - top = undefined, } = $props(); - // Inline the app's own title bar is above, so nothing makes room for the - // traffic lights. - const macChrome = $derived(isMacChrome && !inline); - // The page's global chords act only while it is open and on screen. - const live = $derived(open && (!inline || active)); /** The logos on the New connection button. */ const NEW_CONN_STACK = ["postgres", "mysql", "mongodb", "sqlite"]; @@ -1082,7 +1060,7 @@ // when there is nowhere to go - left alone the webview walks its own document // history, which in a Tauri window navigates away from the app. $effect(() => { - if (!live) return; + if (!open) return; /** @param {MouseEvent} e */ function onMouseNav(e) { if (e.button !== 3 && e.button !== 4) return; @@ -1090,7 +1068,7 @@ e.stopPropagation(); if (e.button !== 3) return; // nothing to go forward to if (step === "form") backToPick(); - else if (!inline) requestClose(); + else requestClose(); } /** Swallow the paired auxclick/mouseup so the webview cannot act on them. */ function swallowAux(/** @type {MouseEvent} */ e) { @@ -2348,7 +2326,6 @@ $effect(() => { if (!open) return; - void resetKey; untrack(() => { // The first provider call pays DNS + TCP + TLS; start those now, while // the dialog is still being read, so a listing or connect doesn't. @@ -2614,8 +2591,6 @@ const _rail = loadRail(); let railWidth = $state(_rail.width); let railOpen = $state(_rail.open); - // The rail as drawn: a tab never shows it. - const railShown = $derived(inline ? showRail : railOpen); function saveRail() { try { localStorage.setItem( @@ -2645,7 +2620,7 @@ * @param {KeyboardEvent} e */ function onRefreshKey(e) { - if (!live) return; + if (!open) return; if (!(e.ctrlKey || e.metaKey) || e.altKey) return; const key = e.key.toLowerCase(); /** @param {() => void} run */ @@ -2669,8 +2644,6 @@ } else if (key === "n") { take(() => newConnectionForm()); } else if (key === "f") { - // In a tab the studio's sidebar is the list: its own Mod+F finds there. - if (inline && !showRail) return; take(() => { if (!railOpen) { railOpen = true; saveRail(); } void tick().then(() => { savedSearchEl?.focus(); savedSearchEl?.select?.(); }); @@ -3465,7 +3438,7 @@ { - if (!live || inline) return; + if (!open) return; if ( (e.ctrlKey || e.metaKey) && !e.altKey && @@ -3978,15 +3951,57 @@ {/snippet} -{#snippet panelBody()} + + + + { + // Start in the connection filter. Left to the dialog, focus went to + // its first button, the rail's Hide toggle, and opened from the + // keyboard it drew a focus box around that icon in the header. + if (!savedSearchEl) return; + e.preventDefault(); + savedSearchEl.focus(); + }} + onEscapeKeydown={(e) => { + if (isDirty && !isBusy) { + e.preventDefault(); + confirmDiscardOpen = true; + } + }} + onFocusOutside={(e) => { + // Never let focus leaving the content dismiss the modal. Starting a native + // window drag/resize from the titlebar makes the webview lose focus, which + // bits-ui treats as focus-outside and closes the dialog. The modal is only + // meant to close via ×, Escape, or a genuine outside pointer interaction + // (handled below) - not because the OS took focus for a window drag. + e.preventDefault(); + }} + onInteractOutside={(e) => { + // Nothing outside the content dismisses this dialog. It is inset to leave + // the titlebar and status bar usable, so "outside" is window chrome: + // dragging the window to move or resize it, or a stray click on the tab + // bar, would otherwise throw away a half-filled connection form. Closing + // is deliberate only - the × button, Escape, or a successful connect. + e.preventDefault(); + }} + > + Connections
- {#if !railShown} + {#if !railOpen}
{:else} @@ -4015,12 +4030,9 @@ the rail's far end, and in a 48px row against the panel's 40px, it jumped across and down on every collapse. -->
- - {#if !inline} - {/if}

Connections

@@ -4345,13 +4356,8 @@ lights sit in it; 40px elsewhere), so its buttons share the lights' centre line instead of floating at an offset. It is also the window's drag area here. --> - {#if inline} - - {#if top}{@render top()}{/if} - {:else}
{#if !railOpen} @@ -4380,8 +4386,7 @@
- {/if} - {#if dialing} @@ -6387,7 +6392,7 @@ {saved.length === 0 ? "Everything stays on this machine" - : railOpen || inline + : railOpen ? "Or pick a saved connection on the left" : "Saved connections are hidden - reopen them from the top left"} @@ -6674,64 +6679,9 @@
{/if} -{/snippet} - -{#if inline} - - {#if open} -
- {@render panelBody()} -
- {/if} -{:else} - - - - { - // Start in the connection filter. Left to the dialog, focus went to - // its first button, the rail's Hide toggle, and opened from the - // keyboard it drew a focus box around that icon in the header. - if (!savedSearchEl) return; - e.preventDefault(); - savedSearchEl.focus(); - }} - onEscapeKeydown={(e) => { - if (isDirty && !isBusy) { - e.preventDefault(); - confirmDiscardOpen = true; - } - }} - onFocusOutside={(e) => { - // Never let focus leaving the content dismiss the modal. Starting a native - // window drag/resize from the titlebar makes the webview lose focus, which - // bits-ui treats as focus-outside and closes the dialog. The modal is only - // meant to close via ×, Escape, or a genuine outside pointer interaction - // (handled below) - not because the OS took focus for a window drag. - e.preventDefault(); - }} - onInteractOutside={(e) => { - // Nothing outside the content dismisses this dialog. It is inset to leave - // the titlebar and status bar usable, so "outside" is window chrome: - // dragging the window to move or resize it, or a stray click on the tab - // bar, would otherwise throw away a half-filled connection form. Closing - // is deliberate only - the × button, Escape, or a successful connect. - e.preventDefault(); - }} - > - Connections - {@render panelBody()} -{/if} { settings = updateSettings({ treeFocusOnSwitch: settings.treeFocusOnSwitch !== true }) }, )} {/if} - {#if show('Connection page in a tab', 'Labs, open new connections and edits as a tab, and start in the app instead of a separate connection page')} - {@render switchRow( - 'Connection page in a tab', - 'Adding or editing a connection opens a Connect tab beside your tables and queries. With nothing connected, the window shows your saved connections and the connect page in one view instead of a separate first page.', - settings.connectInTab === true, - () => { settings = updateSettings({ connectInTab: settings.connectInTab !== true }) }, - )} - {/if} {#if show('Boring connection bar', 'Labs, group saved connections into a folder per database kind')} {@render switchRow( 'Boring connection bar', diff --git a/src/lib/components/StudioShell.svelte b/src/lib/components/StudioShell.svelte index 543ac9fd..a0187d6b 100644 --- a/src/lib/components/StudioShell.svelte +++ b/src/lib/components/StudioShell.svelte @@ -44,7 +44,7 @@ import { isTypingTarget } from '$lib/focus-search.js' import { slashFocusTarget } from '$lib/slash-focus.js' import QuitHint from './QuitHint.svelte' - import { appRelationColumns, appFkAutoExpandJson, cycleTheme, restorePreviousTheme, isCurrentThemeDark, loadSettings, appPaginationMode, appVimMode, appAutoSaveQueries, appStreamResults, appSqlUndo, appSqlEditor, appAiInTab, appConnectInTab, increaseZoom, decreaseZoom, resetZoom, updateSettings } from '$lib/stores/settings.js' + import { appRelationColumns, appFkAutoExpandJson, cycleTheme, restorePreviousTheme, isCurrentThemeDark, loadSettings, appPaginationMode, appVimMode, appAutoSaveQueries, appStreamResults, appSqlUndo, appSqlEditor, appAiInTab, increaseZoom, decreaseZoom, resetZoom, updateSettings } from '$lib/stores/settings.js' import { requireUnlock } from '$lib/stores/app-lock.js' import { isTextEntryTarget, setVimSubMode } from '$lib/vim/vim.js' import { normalizeColumn, columnType } from '$lib/column.js' @@ -227,8 +227,6 @@ createMigrationsTab, findMigrationsTab, createLicenseTab, - createConnectTab, - findConnectTab, createAiTab, findAiTab, findLicenseTab, @@ -687,14 +685,6 @@ let objectsFocusSearch = $state(/** @type {() => void} */ (() => {})) let dbSearchFocusInput = $state(/** @type {() => void} */ (() => {})) let showConnectionModal = $state(false) - // Labs, connection page in a tab (connectInTab). `showConnectionModal` stays - // the one way to ask for the page; with the option on, the request opens the - // Connect tab instead (or, with nothing connected, resets the page the window - // already shows), so the dialog never opens and none of its callers change. - // The inline page's own open flag: it clears it to close itself. - let connectInlineOpen = $state(true) - // Bumped to start the page over (a new Edit… or engine request) in place. - let connectResetKey = $state(0) /** Engine chosen on the welcome screen - the modal opens straight into its form. */ let connectionModalEngine = $state('') /** A saved connection the dialog opens into its form (sidebar Edit…). */ @@ -896,7 +886,7 @@ if (importDataOpen) dialogMounted.importData = true if ($shareRequest) dialogMounted.share = true if (showDockerModal) dialogMounted.docker = true - if (showConnectionModal && !$appConnectInTab) dialogMounted.connection = true + if (showConnectionModal) dialogMounted.connection = true if (showOnboarding) dialogMounted.onboarding = true if (showCreateDbDialog) dialogMounted.createDb = true if (generateSqlOpen) dialogMounted.generateSql = true @@ -3491,7 +3481,7 @@ let rowSearch = $state('') // `sqlLoading` true (only the owning tab's state is patched), and the next // snapshot of ANY sql tab would then capture that stale true as its own. if (tab.kind !== 'sql') sqlLoading = false - if (tab.kind === 'welcome' || tab.kind === 'ai' || tab.kind === 'schema' || tab.kind === 'orm' || tab.kind === 'ddl' || tab.kind === 'connect') { + if (tab.kind === 'welcome' || tab.kind === 'ai' || tab.kind === 'schema' || tab.kind === 'orm' || tab.kind === 'ddl') { clearTableEditor() return } @@ -5269,58 +5259,6 @@ let rowSearch = $state('') openSingletonTab({ find: findSchemaTab, create: createSchemaTab, capability: () => hasSchemaExplorer }) } - /** - * Labs, connection page in a tab: open the Connect tab (or bring it forward) - * and start its page over, picking up any engine or Edit… request. Free, like - * the dialog it stands in for, so no Pro gate. - */ - function openConnectTab() { - if (aiMode) exitAiMode() - connectInlineOpen = true - connectResetKey += 1 - const existing = findConnectTab(tabs) - if (existing) { void activateTab(existing.id); return } - saveActiveTabState() - dropWelcomeTabs() - const tab = createConnectTab() - tabs = [...tabs, tab] - activeTabId = tab.id - clearTableEditor() - } - - // A request for the connection page, with the Labs option on: never the - // dialog. Connected, it is the Connect tab; with nothing connected the window - // already shows the page, which starts over to take the request. - $effect(() => { - if (!showConnectionModal || !$appConnectInTab) return - untrack(() => { - showConnectionModal = false - if (connection) openConnectTab() - else { connectInlineOpen = true; connectResetKey += 1 } - }) - }) - - // The option turned off with a Connect tab open: the tab has nothing to draw. - $effect(() => { - if ($appConnectInTab) return - untrack(() => { - const tab = findConnectTab(tabs) - if (tab) void closeTab(tab.id) - }) - }) - - // The inline page closed itself (its hand-over after a connect, or a Cancel): - // its tab goes with it. With nothing connected the page is the window, so it - // simply stays. - $effect(() => { - if (connectInlineOpen) return - untrack(() => { - connectInlineOpen = true - const tab = connection ? findConnectTab(tabs) : null - if (tab) void closeTab(tab.id) - }) - }) - function openOrmTab() { openSingletonTab({ find: findOrmTab, create: createOrmTab }) } @@ -9727,8 +9665,7 @@ let rowSearch = $state('') label: sessionLabel(connection), // The tab on screen keeps its rows, so coming back to it is instant; // the others refetch when shown, so a kept database costs little. - // The Connect tab belongs to the window, not to this database. - tabs: tabs.filter((t) => t.kind !== 'connect').map((t) => { + tabs: tabs.map((t) => { if (!(t.kind === 'table' && t.state && t.id !== activeTabId)) return t _liveRowsByTab.delete(t.id) return { ...t, state: { ...t.state, rows: [], selected: new Set(), windowedHead: false, windowedLoaded: [], windowCount: 0, loadingRows: false, evicted: true } } @@ -10966,7 +10903,7 @@ let rowSearch = $state('') {#if dialogMounted.connection} {#await lazyDialogs.connection() then { default: ConnectionModal }} showConnectionModal && !$appConnectInTab, (v) => (showConnectionModal = v)} + bind:open={showConnectionModal} bind:initialEngine={connectionModalEngine} bind:initialEditId={connectionModalEditId} bind:initialUri={connectionModalUri} @@ -11541,18 +11478,6 @@ let rowSearch = $state('') {/await} {/if} - {#snippet connectStrip()} - -
- -
- {/snippet} - {#snippet tabError(/** @type {unknown} */ error, /** @type {() => void} */ reset)}
@@ -11572,28 +11497,7 @@ let rowSearch = $state('')
{/snippet} - {#if !connection && $appConnectInTab} - - {#await lazyDialogs.connection() then { default: ConnectionModal }} - onConnected(conn, id)} - maxConnections={$hasPro ? Infinity : FREE_CONNECTION_LIMIT} - activeConnectionName="" - ondisconnect={requestDisconnect} - onremoved={handleConnectionRemoved} - top={connectStrip} - /> - {/await} - {:else if !connection} + {#if !connection} - {:else if activeTab?.kind === 'connect'} - {:else if activeTab?.kind === 'schema'} {#await import('./SchemaPage.svelte')}{:then { default: SchemaPage }} @@ -11777,37 +11679,6 @@ let rowSearch = $state('') {/if} - - {#if $appConnectInTab && tabs.some((t) => t.kind === 'connect')} -
- - {#await lazyDialogs.connection()}{:then { default: ConnectionModal }} - onConnected(conn, id)} - maxConnections={$hasPro ? Infinity : FREE_CONNECTION_LIMIT} - activeConnectionName={connection ? (connection.name || connection.database || connection.host || connection.filePath || 'Connected') : ''} - ondisconnect={requestDisconnect} - onremoved={handleConnectionRemoved} - /> - {/await} - -
- {/if} - {#if aiTabEverOpened && $appAiInTab} diff --git a/src/lib/components/TabBar.svelte b/src/lib/components/TabBar.svelte index 76b1013a..a2710d9c 100644 --- a/src/lib/components/TabBar.svelte +++ b/src/lib/components/TabBar.svelte @@ -164,7 +164,6 @@ if (tab.kind === 'map') return 'globe' if (tab.kind === 'search') return 'search' if (tab.kind === 'license') return 'key-round' - if (tab.kind === 'connect') return 'plug' if (tab.kind === 'shortcuts') return 'keyboard' if (tab.kind === 'shares') return 'share-2' if (tab.kind === 'queries') return 'history' diff --git a/src/lib/stores/settings.js b/src/lib/stores/settings.js index 061ebc02..18fa0f84 100644 --- a/src/lib/stores/settings.js +++ b/src/lib/stores/settings.js @@ -134,7 +134,7 @@ function pushProxySettings(proxy) { .catch((e) => { _proxySent = ''; console.warn('proxy settings not applied:', e) }) } -/** @typedef {{ theme: ThemeId, zoom: number, font: FontId, iconStyle: IconStyleId, iconSet: IconSetId, tableStyle: TableStyleId, jsonTheme: JsonThemeId, editorTheme: import('$lib/themes/editor-themes.js').EditorThemeId, mcpAutoStart: boolean, launchAtLogin: boolean, autoUpdate: boolean, autoReconnectOnStartup: boolean, previewDmlBeforeApply: boolean, defaultDataView: string, paginationMode: string, maxQueryHistory: number, connectTimeoutMs: number, socketTimeoutMs: number, maxAllowedPacket: number, sessionTimezone: string, displayTimezone: string, vimMode: boolean, cmdkAiEnabled: boolean, liveModeEnabled: boolean, sidebarStyle: SidebarStyleId, aiInTab: boolean, connectInTab: boolean, lazyWideColumns: boolean, nullSortOrder: string, agentChatFontSize: number, agentCodeFontSize: number, agentThinkingStyle: string, agentShowQueryCards: boolean, agentWebAccess: boolean, tableTextAlign: string, telemetry: boolean, jsonWordWrap: boolean, nativeScroll: boolean, rowSpacing: RowSpacingId, motion: MotionId, animatePanels: boolean, quitGuard: boolean, reopenTabs: boolean, multiConnection: boolean, studioShare: boolean, treeFocusOnSwitch: boolean, boringConnectionBar: boolean, zebraRows: boolean, showRowNumbers: boolean, showRelationColumns: boolean, showMenuBar: boolean, numberGrouping: boolean, imagePreview: boolean, openUrlsOnClick: boolean, highlightActiveRow: boolean, fkAutoExpandJson: boolean, gridFontSize: number, autoSaveQueries: boolean, streamResults: boolean, sqlUndo: boolean, sidebarComments: boolean, sidebarRememberGroups: boolean, sqlFormat: import('$lib/sql-format-options.js').SqlFormatOptions, sqlEditor: import('$lib/sql-editor-options.js').SqlEditorOptions, shareDefaults: Record | null, proxy: ProxySettings, fonts: import('$lib/fonts.js').FontSettings }} AppSettings */ +/** @typedef {{ theme: ThemeId, zoom: number, font: FontId, iconStyle: IconStyleId, iconSet: IconSetId, tableStyle: TableStyleId, jsonTheme: JsonThemeId, editorTheme: import('$lib/themes/editor-themes.js').EditorThemeId, mcpAutoStart: boolean, launchAtLogin: boolean, autoUpdate: boolean, autoReconnectOnStartup: boolean, previewDmlBeforeApply: boolean, defaultDataView: string, paginationMode: string, maxQueryHistory: number, connectTimeoutMs: number, socketTimeoutMs: number, maxAllowedPacket: number, sessionTimezone: string, displayTimezone: string, vimMode: boolean, cmdkAiEnabled: boolean, liveModeEnabled: boolean, sidebarStyle: SidebarStyleId, aiInTab: boolean, lazyWideColumns: boolean, nullSortOrder: string, agentChatFontSize: number, agentCodeFontSize: number, agentThinkingStyle: string, agentShowQueryCards: boolean, agentWebAccess: boolean, tableTextAlign: string, telemetry: boolean, jsonWordWrap: boolean, nativeScroll: boolean, rowSpacing: RowSpacingId, motion: MotionId, animatePanels: boolean, quitGuard: boolean, reopenTabs: boolean, multiConnection: boolean, studioShare: boolean, treeFocusOnSwitch: boolean, boringConnectionBar: boolean, zebraRows: boolean, showRowNumbers: boolean, showRelationColumns: boolean, showMenuBar: boolean, numberGrouping: boolean, imagePreview: boolean, openUrlsOnClick: boolean, highlightActiveRow: boolean, fkAutoExpandJson: boolean, gridFontSize: number, autoSaveQueries: boolean, streamResults: boolean, sqlUndo: boolean, sidebarComments: boolean, sidebarRememberGroups: boolean, sqlFormat: import('$lib/sql-format-options.js').SqlFormatOptions, sqlEditor: import('$lib/sql-editor-options.js').SqlEditorOptions, shareDefaults: Record | null, proxy: ProxySettings, fonts: import('$lib/fonts.js').FontSettings }} AppSettings */ /** * UI type scale in design pixels: `[step, font-size, line-height?]`, matching @@ -618,8 +618,6 @@ export const DEFAULT_SETTINGS = { // Labs: a database switch folds the tree to the new database's tables. treeFocusOnSwitch: false, boringConnectionBar: false, - // Labs: the connection page opens as a tab, and replaces the first-run page. - connectInTab: false, // SQL formatter preferences. Defaults live with the formatter (format-sql.js) // so there is one source for what a valid option set is. sqlFormat: { ...SQL_FORMAT_DEFAULTS }, @@ -797,8 +795,6 @@ export const appSidebarStyle = writable(/** @type {SidebarStyleId} */ ('classic' export const appAiInTab = writable(false) /** Labs: saved connections in one folder per database kind. */ export const appBoringConnectionBar = writable(false) -/** Labs: the connection page as a tab (connectInTab). */ -export const appConnectInTab = writable(false) /** Whether the agent transcript shows a card per executed query. */ export const appAgentQueryCards = writable(false) @@ -1035,7 +1031,6 @@ export function loadSettings() { const studioShare = parsed.studioShare === true const treeFocusOnSwitch = parsed.treeFocusOnSwitch === true const boringConnectionBar = parsed.boringConnectionBar === true - const connectInTab = parsed.connectInTab === true const sqlFormat = normalizeSqlFormat(parsed.sqlFormat) const sqlEditor = normalizeSqlEditor(parsed.sqlEditor) const proxy = normalizeProxy(parsed.proxy) @@ -1082,7 +1077,7 @@ export function loadSettings() { const agentShowQueryCards = parsed.agentShowQueryCards === true const agentWebAccess = parsed.agentWebAccess === true const tableTextAlign = TABLE_ALIGN_IDS.includes(parsed.tableTextAlign) ? parsed.tableTextAlign : DEFAULT_TABLE_ALIGN - _settingsCache = { theme, zoom, font, iconStyle, iconSet, tableStyle, jsonTheme, editorTheme, mcpAutoStart, launchAtLogin, autoUpdate, autoReconnectOnStartup, previewDmlBeforeApply, defaultDataView, paginationMode, maxQueryHistory, connectTimeoutMs, socketTimeoutMs, maxAllowedPacket, sessionTimezone, displayTimezone, vimMode, cmdkAiEnabled, liveModeEnabled, sidebarStyle, aiInTab, connectInTab, lazyWideColumns, nullSortOrder, agentChatFontSize, agentCodeFontSize, agentThinkingStyle, agentShowQueryCards, agentWebAccess, tableTextAlign, telemetry, jsonWordWrap, nativeScroll, rowSpacing, motion, animatePanels, quitGuard, reopenTabs, multiConnection, studioShare, treeFocusOnSwitch, boringConnectionBar, zebraRows, showRowNumbers, showRelationColumns, showMenuBar, numberGrouping, imagePreview, openUrlsOnClick, highlightActiveRow, fkAutoExpandJson, gridFontSize, autoSaveQueries, streamResults, sqlUndo, sidebarComments, sidebarRememberGroups, sqlFormat, sqlEditor, shareDefaults, proxy, fonts } + _settingsCache = { theme, zoom, font, iconStyle, iconSet, tableStyle, jsonTheme, editorTheme, mcpAutoStart, launchAtLogin, autoUpdate, autoReconnectOnStartup, previewDmlBeforeApply, defaultDataView, paginationMode, maxQueryHistory, connectTimeoutMs, socketTimeoutMs, maxAllowedPacket, sessionTimezone, displayTimezone, vimMode, cmdkAiEnabled, liveModeEnabled, sidebarStyle, aiInTab, lazyWideColumns, nullSortOrder, agentChatFontSize, agentCodeFontSize, agentThinkingStyle, agentShowQueryCards, agentWebAccess, tableTextAlign, telemetry, jsonWordWrap, nativeScroll, rowSpacing, motion, animatePanels, quitGuard, reopenTabs, multiConnection, studioShare, treeFocusOnSwitch, boringConnectionBar, zebraRows, showRowNumbers, showRelationColumns, showMenuBar, numberGrouping, imagePreview, openUrlsOnClick, highlightActiveRow, fkAutoExpandJson, gridFontSize, autoSaveQueries, streamResults, sqlUndo, sidebarComments, sidebarRememberGroups, sqlFormat, sqlEditor, shareDefaults, proxy, fonts } // A migrated value is saved at once, or the next launch reads the old one. if (settingsMigrated) { try { localStorage.setItem(STORAGE_KEY, JSON.stringify(_settingsCache)) } catch {} @@ -1432,7 +1427,6 @@ function applySettingsNow(settings, root, theme, zoom, dark) { setStore(appSidebarStyle, settings.sidebarStyle === 'tree' ? 'tree' : 'classic') setStore(appAiInTab, settings.aiInTab === true) setStore(appBoringConnectionBar, settings.boringConnectionBar === true) - setStore(appConnectInTab, settings.connectInTab === true) setStore(appAgentQueryCards, settings.agentShowQueryCards === true) setStore(appAgentWebAccess, settings.agentWebAccess === true) setStore(appTableAlign, TABLE_ALIGN_IDS.includes(settings.tableTextAlign) ? settings.tableTextAlign : DEFAULT_TABLE_ALIGN) diff --git a/src/lib/studio-tabs.js b/src/lib/studio-tabs.js index ea6275eb..5b9b1d2f 100644 --- a/src/lib/studio-tabs.js +++ b/src/lib/studio-tabs.js @@ -1,4 +1,4 @@ -/** @typedef {'table' | 'sql' | 'ddl' | 'welcome' | 'ai' | 'schema' | 'orm' | 'security' | 'logs' | 'extensions' | 'extension-detail' | 'backup' | 'json' | 'charts' | 'dashboard' | 'erd' | 'reltree' | 'diagrams' | 'search' | 'notebook' | 'schema-timeline' | 'data-diff' | 'migrations' | 'insights' | 'objects' | 'redis' | 'dynamodb' | 'docs' | 'license' | 'orm-schema' | 'map' | 'advisor' | 'golf' | 'terminal' | 'shortcuts' | 'shares' | 'queries' | 'connect'} StudioTabKind */ +/** @typedef {'table' | 'sql' | 'ddl' | 'welcome' | 'ai' | 'schema' | 'orm' | 'security' | 'logs' | 'extensions' | 'extension-detail' | 'backup' | 'json' | 'charts' | 'dashboard' | 'erd' | 'reltree' | 'diagrams' | 'search' | 'notebook' | 'schema-timeline' | 'data-diff' | 'migrations' | 'insights' | 'objects' | 'redis' | 'dynamodb' | 'docs' | 'license' | 'orm-schema' | 'map' | 'advisor' | 'golf' | 'terminal' | 'shortcuts' | 'shares' | 'queries'} StudioTabKind */ import { loadDefaultPageSize } from '$lib/table-query.js' @@ -245,8 +245,6 @@ const SINGLETON_TAB_TITLES = { shortcuts: 'Keyboard shortcuts', shares: 'Shared links', queries: 'Queries', - // Labs, connection page in a tab. - connect: 'Connect', } /** @param {StudioTabKind} kind */ @@ -288,7 +286,6 @@ export const createRelTreeTab = () => createKindTab('reltree') export const createDiagramsTab = () => createKindTab('diagrams') export const createErdTab = () => createKindTab('erd') export const createLicenseTab = () => createKindTab('license') -export const createConnectTab = () => createKindTab('connect') export const createSearchTab = () => createKindTab('search') export const createSchemaTimelineTab = () => createKindTab('schema-timeline') export const createDataDiffTab = () => createKindTab('data-diff') @@ -348,8 +345,6 @@ export const findDiagramsTab = (tabs) => findTabByKind(tabs, 'diagrams') export const findErdTab = (tabs) => findTabByKind(tabs, 'erd') /** @type {(tabs: StudioTab[]) => StudioTab | null} */ export const findLicenseTab = (tabs) => findTabByKind(tabs, 'license') -/** @param {StudioTab[]} tabs */ -export const findConnectTab = (tabs) => findTabByKind(tabs, 'connect') /** @type {(tabs: StudioTab[]) => StudioTab | null} */ export const findShortcutsTab = (tabs) => findTabByKind(tabs, 'shortcuts') /** @type {(tabs: StudioTab[]) => StudioTab | null} */ diff --git a/src/lib/studio-tabs.test.js b/src/lib/studio-tabs.test.js index 98089dda..80284564 100644 --- a/src/lib/studio-tabs.test.js +++ b/src/lib/studio-tabs.test.js @@ -8,8 +8,6 @@ import { cloneTableTabState, cloneSqlTabState, createAiTab, - createConnectTab, - findConnectTab, createSchemaTab, findAiTab, findSchemaTab, @@ -96,12 +94,6 @@ describe('find helpers', () => { expect(findSchemaTab(tabs)?.kind).toBe('schema') expect(findAiTab([createSqlTab('SELECT 1;')])).toBeNull() }) - it('find the Labs Connect tab, titled for what it does', () => { - const connect = createConnectTab() - expect(connect.title).toBe('Connect') - expect(findConnectTab([createSqlTab('SELECT 1;'), connect])?.id).toBe(connect.id) - expect(findConnectTab([createAiTab()])).toBeNull() - }) }) describe('cloneSqlTabState', () => { From e02f07eb4f7ecdb78b5a14e9fda7105a226654b7 Mon Sep 17 00:00:00 2001 From: broisnees Date: Tue, 24 Nov 2026 16:15:09 +0000 Subject: [PATCH 2/2] Bring back the larger icons and the 36px status bar The native-feel change (#415) dropped the rule that drew every icon one size up and shrank the status bar and the sidebar's footer to 28px with 24px buttons and smaller text. Restore the icon rule (14, 17 and 19px at 100% zoom, the sizes before it) and the 36px bars with 28px buttons, keeping the hairline borders #415 added. --- .changeset/bigger-icons.md | 3 +++ src/app.css | 9 +++++++++ src/lib/components/Sidebar.svelte | 17 +++++++++-------- src/lib/components/StatusBar.svelte | 8 ++++---- src/lib/components/StudioShell.svelte | 2 +- 5 files changed, 26 insertions(+), 13 deletions(-) create mode 100644 .changeset/bigger-icons.md diff --git a/.changeset/bigger-icons.md b/.changeset/bigger-icons.md new file mode 100644 index 00000000..168ad407 --- /dev/null +++ b/.changeset/bigger-icons.md @@ -0,0 +1,3 @@ +### Changes +- **Larger icons again** - Icons are back to the size they were before 3.7.6 (14, 17 and 19px instead of 12, 14 and 16px at 100% zoom), and the status bar and the sidebar's bottom row are back to 36px with full-size buttons and text. +- **Removed: Connection page in a tab** - The Labs option from 3.8.1 is gone; the connection page opens as it did before. diff --git a/src/app.css b/src/app.css index b9c6bc55..28501da3 100644 --- a/src/app.css +++ b/src/app.css @@ -1538,6 +1538,15 @@ html[data-window-focused='false'] [role='tablist'] > * { opacity: 0.65; } +/* ── Icon scale (T3-sized) ─────────────────────────────────────────────────── + Every icon one step up: 12→14, 14→17, 16→19px. Icons read as the controls + rather than as specks beside the text. One rule, so every icon in the app + moves together; rem, so it follows the zoom. Unlayered so it wins over the + `size-*` utilities on the icons themselves. */ +svg.size-3 { width: calc(14px * var(--app-scale, 1)); height: calc(14px * var(--app-scale, 1)); } +svg.size-3\.5 { width: calc(17px * var(--app-scale, 1)); height: calc(17px * var(--app-scale, 1)); } +svg.size-4 { width: calc(19px * var(--app-scale, 1)); height: calc(19px * var(--app-scale, 1)); } + /* ── Linux frameless window edge ───────────────────────────────────────────── Without OS decorations, a dark window blends into dark windows behind it on Linux compositors that don't draw CSD borders. A crisp 1px inner hairline diff --git a/src/lib/components/Sidebar.svelte b/src/lib/components/Sidebar.svelte index f7fc9664..7e2600af 100644 --- a/src/lib/components/Sidebar.svelte +++ b/src/lib/components/Sidebar.svelte @@ -3359,18 +3359,19 @@ {#await import('./ExtensionsSidebarPanel.svelte') then { default: ExtensionsSidebarPanel }}{/await} {/if} - -
- - - - {#if onopenlabs}{/if} + +
+ + + + {#if onopenlabs}{/if} {#if updateState} {:else} - + {/if}
diff --git a/src/lib/components/StatusBar.svelte b/src/lib/components/StatusBar.svelte index 613e0fd2..2fcf103a 100644 --- a/src/lib/components/StatusBar.svelte +++ b/src/lib/components/StatusBar.svelte @@ -409,9 +409,9 @@ }) } - const iconBtn = 'inline-flex size-6 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-sidebar-accent/60 hover:text-foreground' + const iconBtn = 'inline-flex size-7 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-sidebar-accent/60 hover:text-foreground' /** Shared label+icon button */ - const labelBtn = 'flex h-6 items-center gap-1.5 rounded-md px-2 text-ui-2xs hover:bg-sidebar-accent/60 hover:text-foreground data-[state=open]:bg-sidebar-accent/60 data-[state=open]:text-foreground' + const labelBtn = 'flex h-7 items-center gap-2 rounded-md px-2.5 text-ui-xs hover:bg-sidebar-accent/60 hover:text-foreground data-[state=open]:bg-sidebar-accent/60 data-[state=open]:text-foreground' let aiModelMenuOpen = $state(false) @@ -492,7 +492,7 @@ {/snippet}
@@ -975,7 +975,7 @@