25 MB lightweight cross-platform database client for 100+ databases, including MySQL, PostgreSQL, SQLite, Redis, MongoDB, DuckDB, SQL Server, and Dameng. Built-in AI, MCP Server, CLI, desktop and Docker. | 轻量级跨平台数据库管理工具,支持 MySQL、PostgreSQL、SQLite、Redis、MongoDB、达梦等 100+ 数据库,提供桌面端、Docker、CLI、内置 AI 助手和 MCP。
TypeScript aicliclickhousedatabasedatabase-clientdatabase-managementdockerguimcpmongodbmysqlpostgresqlredisrustsql-serversqlitetaurivue
feat(editor): add optional two-row grouped tab layout (#12905)
Terry Yaoc0a97d73bf33
diff --git a/apps/desktop/src/components/editor/EditorSettingsDialog.vue b/apps/desktop/src/components/editor/EditorSettingsDialog.vueindex cdf9df67fa..02ea0dc4e4 100644--- a/apps/desktop/src/components/editor/EditorSettingsDialog.vue+++ b/apps/desktop/src/components/editor/EditorSettingsDialog.vue@@ -104,6 +104,7 @@ import {type SavedSqlOpenTargetMode,type AiSqlApplyTargetMode,type TabGroupMode,+ type TabGroupRowMode,type TabPlacement,type TabSortMode,type WelcomePageMode,@@ -800,6 +801,7 @@ const editColorizeConnectionTabs = ref(settingsStore.editorSettings.colorizeConnconst editTabGroupMode = ref<TabGroupMode>(settingsStore.editorSettings.tabGroupMode);const editTabSortMode = ref<TabSortMode>(settingsStore.editorSettings.tabSortMode);const editTabMaxWidth = ref<number>(settingsStore.editorSettings.tabMaxWidth);+const editTabGroupRows = ref<TabGroupRowMode>(settingsStore.editorSettings.tabGroupRows);const editShowTrayIcon = ref(settingsStore.desktopSettings.show_tray_icon);const editQuitOnClose = ref(settingsStore.desktopSettings.quit_on_close);const desktopCloseBehaviorResetPending = ref(false);@@ -1198,6 +1200,7 @@ function currentEditorSettingsDraft(): EditorSettingsDraft {tabGroupMode: editTabGroupMode.value,tabSortMode: editTabSortMode.value,tabMaxWidth: editTabMaxWidth.value,+ tabGroupRows: editTabGroupRows.value,showColumnCommentsInHeader: editShowColumnCommentsInHeader.value,dataGridColumnCommentsInInfoArea: editDataGridColumnCommentsInInfoArea.value,showColumnTypesInHeader: editShowColumnTypesInHeader.value,@@ -1895,6 +1898,7 @@ function syncEditorSettingsDraftFromStore() {editTabGroupMode.value = settingsStore.editorSettings.tabGroupMode;editTabSortMode.value = settingsStore.editorSettings.tabSortMode;editTabMaxWidth.value = settingsStore.editorSettings.tabMaxWidth;+ editTabGroupRows.value = settingsStore.editorSettings.tabGroupRows;editShowColumnCommentsInHeader.value = settingsStore.editorSettings.showColumnCommentsInHeader;editDataGridColumnCommentsInInfoArea.value = settingsStore.editorSettings.dataGridColumnCommentsInInfoArea;editShowColumnTypesInHeader.value = settingsStore.editorSettings.showColumnTypesInHeader;@@ -2066,6 +2070,7 @@ const editorSettingsDraftRefs: EditorSettingsDraftRefMap = {tabGroupMode: editTabGroupMode,tabSortMode: editTabSortMode,tabMaxWidth: editTabMaxWidth,+ tabGroupRows: editTabGroupRows,showColumnCommentsInHeader: editShowColumnCommentsInHeader,dataGridColumnCommentsInInfoArea: editDataGridColumnCommentsInInfoArea,showColumnTypesInHeader: editShowColumnTypesInHeader,@@ -2670,6 +2675,7 @@ function resetDefaultsForTab(tab: SettingsCategory) {editTabGroupMode.value = DEFAULT_EDITOR_SETTINGS.tabGroupMode;editTabSortMode.value = DEFAULT_EDITOR_SETTINGS.tabSortMode;editTabMaxWidth.value = DEFAULT_EDITOR_SETTINGS.tabMaxWidth;+ editTabGroupRows.value = DEFAULT_EDITOR_SETTINGS.tabGroupRows;editShowTrayIcon.value = DEFAULT_DESKTOP_SETTINGS.show_tray_icon;editQuitOnClose.value = DEFAULT_DESKTOP_SETTINGS.quit_on_close;desktopCloseBehaviorResetPending.value = true;@@ -3512,6 +3518,10 @@ function setTabMaxWidth(value: number) {editTabMaxWidth.value = normalizeTabMaxWidth(value);}+function setTabGroupRows(value: TabGroupRowMode) {+ editTabGroupRows.value = value;+}+function setSidebarActivation(value: "single" | "double") {editSidebarActivation.value = value;}@@ -8599,7 +8609,7 @@ onUnmounted(() => {</div><div class="settings-appearance-group">- <div class="grid grid-cols-1 gap-4 sm:grid-cols-2 xl:grid-cols-4">+ <div class="grid grid-cols-1 gap-4 sm:grid-cols-2 xl:grid-cols-5"><div class="space-y-2"><Label>{{ t("settings.tabPlacement") }}</Label><Select :model-value="editTabPlacement" @update:model-value="setTabPlacement($event as TabPlacement)">@@ -8625,6 +8635,16 @@ onUnmounted(() => {</SelectContent></Select></div>+ <div class="space-y-2">+ <Label>{{ t("settings.tabGroupRows") }}</Label>+ <Select :model-value="editTabGroupRows" @update:model-value="setTabGroupRows($event as TabGroupRowMode)">+ <SelectTrigger class="w-full"><SelectValue /></SelectTrigger>+ <SelectContent>+ <SelectItem value="single">{{ t("settings.tabGroupRowsSingle") }}</SelectItem>+ <SelectItem value="two-row">{{ t("settings.tabGroupRowsTwoRow") }}</SelectItem>+ </SelectContent>+ </Select>+ </div><div class="space-y-2"><Label>{{ t("settings.tabSort") }}</Label><Select :model-value="editTabSortMode" @update:model-value="setTabSortMode($event as TabSortMode)">@@ -8653,6 +8673,7 @@ onUnmounted(() => {<div class="space-y-1 text-xs text-muted-foreground"><p>{{ t("settings.tabPlacementDescription") }}</p><p>{{ t("settings.tabOrganizationDescription") }}</p>+ <p>{{ t("settings.tabGroupRowsDescription") }}</p><p>{{ t("settings.tabMaxWidthDescription") }}</p></div></div>diff --git a/apps/desktop/src/components/layout/EditorGroupTabBar.vue b/apps/desktop/src/components/layout/EditorGroupTabBar.vueindex 1670e0018f..32892472c9 100644--- a/apps/desktop/src/components/layout/EditorGroupTabBar.vue+++ b/apps/desktop/src/components/layout/EditorGroupTabBar.vue@@ -28,7 +28,7 @@ const TAB_DRAG_HORIZONTAL_THRESHOLD = 24;<script setup lang="ts">import { computed, inject, nextTick, onUnmounted, ref, watch } from "vue";-import type { CSSProperties } from "vue";+import type { Component, CSSProperties } from "vue";import { useI18n } from "vue-i18n";import {ArrowDown,@@ -58,6 +58,7 @@ import {Plus,RotateCcw,RotateCw,+ Rows2,Search,Server,Settings,@@ -212,7 +213,11 @@ function specialPageTabStyle(active: boolean) {return { "--app-tab-background": appTabActiveBackground(), boxShadow: appTabActiveIndicator() };}const isVerticalLayout = computed(() => settingsStore.editorSettings.tabPlacement === "left" || settingsStore.editorSettings.tabPlacement === "right");-const isWrapLayout = computed(() => !isVerticalLayout.value && settingsStore.editorSettings.tabLayout === "wrap");+// Master-detail grouped strip: a rail of semantic groups on its own row, and+// the strip below rendering only the selected group's tabs (issue #10034).+// Meaningless without grouping, so it silently falls back to the single row.+const isTwoRowLayout = computed(() => !isVerticalLayout.value && settingsStore.editorSettings.tabGroupRows === "two-row" && settingsStore.editorSettings.tabGroupMode !== "none");+const isWrapLayout = computed(() => !isVerticalLayout.value && !isTwoRowLayout.value && settingsStore.editorSettings.tabLayout === "wrap");// The icon-only collapse only exists in the vertical toolbar; horizontal// placements must ignore the persisted collapse state entirely.const isTabBarCollapsed = computed(() => isVerticalLayout.value && !!props.tabBarCollapsed);@@ -276,7 +281,7 @@ function getSpecialPageTabMenuItems(surface: "settings" | "driverStore" | "plugi];}-const hasHorizontalFixedRows = computed(() => !isVerticalLayout.value && props.tabs.some((tab) => tab.pinned) && (props.tabs.some((tab) => !tab.pinned) || showSpecialPageTabs.value));+const hasHorizontalFixedRows = computed(() => !isVerticalLayout.value && !isTwoRowLayout.value && props.tabs.some((tab) => tab.pinned) && (props.tabs.some((tab) => !tab.pinned) || showSpecialPageTabs.value));const tabBarClass = computed(() => [isClassicLayout.value ? "classic-tab-layout" : "separated-tab-layout",isVerticalLayout.value@@ -286,6 +291,7 @@ const tabBarClass = computed(() => [: `bg-background ${settingsStore.editorSettings.tabPlacement === "bottom" ? "border-t" : "border-b"}`,isVerticalLayout.value && props.tabBarCollapsed ? "vertical-tab-layout--collapsed" : "",hasHorizontalFixedRows.value ? "horizontal-fixed-tabs" : "",+ isTwoRowLayout.value ? "flex-col tab-two-row-groups" : "",]);const tabsContainerStyle = computed<CSSProperties>(() => ({msOverflowStyle: "none",@@ -433,8 +439,12 @@ const tabMaxWidthItems = computed(() => [{ value: 240, label: t("settings.tabMaxWidthStandard") },{ value: 320, label: t("settings.tabMaxWidthWide") },]);+const tabGroupRowsItems = computed(() => [+ { value: "single", label: t("settings.tabGroupRowsSingle") },+ { value: "two-row", label: t("settings.tabGroupRowsTwoRow") },+]);-type TabPreferencePatch = Partial<Pick<EditorSettings, "tabPlacement" | "tabGroupMode" | "tabSortMode" | "tabGroupCustomizations" | "tabMaxWidth">>;+type TabPreferencePatch = Partial<Pick<EditorSettings, "tabPlacement" | "tabGroupMode" | "tabSortMode" | "tabGroupCustomizations" | "tabMaxWidth" | "tabGroupRows">>;async function persistTabPreferences(partial: TabPreferencePatch) {try {@@ -460,6 +470,19 @@ function updateTabMaxWidth(value: number) {if (Number.isFinite(value) && value >= 0) void persistTabPreferences({ tabMaxWidth: value });}+function updateTabGroupRows(value: string) {+ if (value !== "single" && value !== "two-row") return;+ // Two-row is a master-detail view of the semantic groups: without a grouping+ // mode it would render exactly the single row the user already has, so fall+ // back to connection grouping (the mode issue #10034 asked for) instead of+ // silently doing nothing.+ if (value === "two-row" && settingsStore.editorSettings.tabGroupMode === "none") {+ void persistTabPreferences({ tabGroupRows: value, tabGroupMode: "connection" });+ return;+ }+ void persistTabPreferences({ tabGroupRows: value });+}+function databaseTabGroupKey(tab: QueryTab) {const database = tab.database || "";if (connectionStore.getConfig(tab.connectionId)?.db_type === "redis") {@@ -862,6 +885,9 @@ function tabGroupTabDepthStyle(entry: Extract<StripEntry, { kind: "tab" }>): CSSfunction isEntryHidden(entry: StripEntry) {if (tabSearchQuery.value.trim() || settingsStore.editorSettings.tabGroupMode === "none") return false;+ // Two-row flat modes have no collapsible header left in the strip (the group+ // header lives on the rail), so a stale collapsed id must not hide pills.+ if (isTwoRowLayout.value && settingsStore.editorSettings.tabGroupMode !== "sidebar") return false;const ids = entry.kind === "header" ? entry.ancestorIds : [...entry.ancestorIds, entry.groupId];return ids.some((id) => collapsedTabGroups.value.has(id));}@@ -951,16 +977,30 @@ const tabOrganizationItems = computed(() => [separatorBefore: index === 0,groupLabel: index === 0 ? t("settings.tabGroup") : undefined,})),+ ...tabGroupRowsItems.value.map((item, index) => ({+ ...item,+ value: `rows:${item.value}`,+ icon: { single: Ungroup, "two-row": Rows2 }[item.value],+ separatorBefore: index === 0,+ groupLabel: index === 0 ? t("settings.tabGroupRows") : undefined,+ })),...tabSortItems.value.map((item, index) => ({ ...item, value: `sort:${item.value}`, icon: { manual: ListOrdered, "created-asc": Clock3, "title-asc": ArrowDownAZ }[item.value], separatorBefore: index === 0, groupLabel: index === 0 ? t("settings.tabSort") : undefined })),...tabMaxWidthItems.value.map((item, index) => ({ ...item, value: `maxwidth:${item.value}`, icon: item.value === 0 ? Maximize2 : FoldHorizontal, separatorBefore: index === 0, groupLabel: index === 0 ? t("settings.tabMaxWidth") : undefined })),]);-const selectedTabOrganizationItems = computed(() => [`placement:${settingsStore.editorSettings.tabPlacement}`, `group:${settingsStore.editorSettings.tabGroupMode}`, `sort:${settingsStore.editorSettings.tabSortMode}`, `maxwidth:${settingsStore.editorSettings.tabMaxWidth}`]);+const selectedTabOrganizationItems = computed(() => [+ `placement:${settingsStore.editorSettings.tabPlacement}`,+ `group:${settingsStore.editorSettings.tabGroupMode}`,+ `rows:${settingsStore.editorSettings.tabGroupRows}`,+ `sort:${settingsStore.editorSettings.tabSortMode}`,+ `maxwidth:${settingsStore.editorSettings.tabMaxWidth}`,+]);function selectTabOrganizationItem(value: string) {const [section, option] = value.split(":");if (!option) return;if (section === "placement") updateTabPlacement(option);else if (section === "group") updateTabGroupMode(option);+ else if (section === "rows") updateTabGroupRows(option);else if (section === "sort") updateTabSortMode(option);else if (section === "maxwidth") updateTabMaxWidth(Number(option));}@@ -1115,7 +1155,166 @@ function buildStripEntries(section: QueryTab[], pinned: boolean): StripEntry[] {const pinnedStripEntries = computed(() => buildStripEntries(filteredPinnedTabs.value, true));const regularStripEntries = computed(() => buildStripEntries(filteredRegularTabs.value, false));++interface TwoRowGroupItem {+ key: string;+ label: string;+ count: number;+ /** Representative tab, used for group customization and icon lookups. */+ tab: QueryTab;+ tabIds: string[];+ colorStyle: CSSProperties;+}++/**+ * The rail's groups: the semantic cluster each tab belongs to, in the strip's+ * display order. Pinned and regular members share a cluster here — the master+ * rail has no fixed/regular split; pinned pills keep their marker in the+ * detail row instead.+ */+const twoRowGroupItems = computed<TwoRowGroupItem[]>(() => {+ if (!isTwoRowLayout.value) return [];+ const groups = new Map<string, QueryTab[]>();+ for (const tab of [...filteredPinnedTabs.value, ...filteredRegularTabs.value]) {+ const key = tabGroupKey(tab);+ const bucket = groups.get(key);+ if (bucket) bucket.push(tab);+ else groups.set(key, [tab]);+ }+ return [...groups.entries()].map(([key, tabs]) => {+ const tab = tabs[0]!;+ return {+ key,+ // An unlabeled cluster is usually connectionless plugin tabs: a lone one+ // names itself, several of them read better as "Plugins" than "Ungrouped".+ label: tabGroupLabel(tab) || (tabs.length === 1 ? tabTitleText(tab) : tabs.every(isConnectionlessPluginTab) ? t("tabs.pluginTabs") : t("tabs.ungroupedTabs")),+ count: tabs.length,+ tab,+ tabIds: tabs.map((item) => item.id),+ colorStyle: tabGroupStyle(tab),+ };+ });+});++// The group last picked on the rail. Kept as the fallback while a special+// page (Settings, Driver Manager…) owns the active slot and no group does.+const twoRowFocusedGroupKey = ref<string | null>(null);+// The last active tab of each group, so re-selecting a group restores it.+const twoRowGroupActiveTabs = new Map<string, string>();+const twoRowRailRef = ref<HTMLElement | null>(null);+// Same wheel handling as the tab strip below: onTabsWheel maps the dominant+// axis onto scrollLeft, so a vertical mouse wheel (Windows) scrolls the rail+// horizontally instead of being swallowed by onHorizontalTabWheel. The scroll+// state also drives the rail's own drag scrollbar and edge fades.+const {+ hasTabOverflow: railHasOverflow,+ scrollThumbLeftPercent: railScrollThumbLeftPercent,+ scrollThumbWidthPercent: railScrollThumbWidthPercent,+ isScrollbarDragging: railIsScrollbarDragging,+ updateScrollButtons: updateRailScroll,+ onTabsWheel: onRailWheel,+ startScrollbarDrag: startRailScrollbarDrag,+} = useTabScroll(twoRowRailRef);+const railCanScrollStart = computed(() => railScrollThumbLeftPercent.value > 0.5);+const railCanScrollEnd = computed(() => railScrollThumbLeftPercent.value + railScrollThumbWidthPercent.value < 99.5);+const railScrollbarThumbStyle = computed<CSSProperties>(() => ({+ insetInlineStart: `${railScrollThumbLeftPercent.value}%`,+ width: `${railScrollThumbWidthPercent.value}%`,+}));++const twoRowSelectedKey = computed<string | null>(() => {+ const items = twoRowGroupItems.value;+ if (!items.length) return null;+ const activeTab = props.tabs.find((tab) => isTabActive(tab));+ if (activeTab) {+ const key = tabGroupKey(activeTab);+ if (items.some((item) => item.key === key)) return key;+ }+ if (twoRowFocusedGroupKey.value !== null && items.some((item) => item.key === twoRowFocusedGroupKey.value)) return twoRowFocusedGroupKey.value;+ return items[0]!.key;+});++type SpecialPageSurface = "pluginCenter" | "settings" | "driverStore";++/**+ * App-level surfaces pinned to the right end of the group rail. They are+ * contexts on par with the groups — not tabs inside one — so the detail row+ * no longer spends width on them.+ */+const railSpecialPageItems = computed<{ surface: SpecialPageSurface; label: string; icon: Component; iconClass: string; active: boolean; badge: number }[]>(() => {+ if (!isTwoRowLayout.value || !showSpecialPageTabs.value) return [];+ const pages = props.specialPageTabs;+ if (!pages) return [];+ const items: { surface: SpecialPageSurface; label: string; icon: Component; iconClass: string; active: boolean; badge: number }[] = [];+ if (pages.pluginCenterOpen) items.push({ surface: "pluginCenter", label: t("toolbar.pluginCenter"), icon: PlugZap, iconClass: "text-violet-600 dark:text-violet-400", active: !!pages.pluginCenterActive, badge: 0 });+ if (pages.settingsOpen) items.push({ surface: "settings", label: t("settings.title"), icon: Settings, iconClass: "text-sky-600 dark:text-sky-400", active: !!pages.settingsActive, badge: 0 });+ if (pages.driverStoreOpen) items.push({ surface: "driverStore", label: t("toolbar.driverManager"), icon: Package, iconClass: "text-amber-600 dark:text-amber-400", active: !!pages.driverStoreActive, badge: pages.driverUpdateCount ?? 0 });+ return items;+});++function activateSpecialPage(surface: SpecialPageSurface) {+ if (surface === "settings") emit("activate-settings");+ else if (surface === "driverStore") emit("activate-driver-store");+ else emit("activate-plugin-center");+}++function closeSpecialPage(surface: SpecialPageSurface) {+ if (surface === "settings") emit("close-settings");+ else if (surface === "driverStore") emit("close-driver-store");+ else emit("close-plugin-center");+}++function selectTwoRowGroup(group: TwoRowGroupItem) {+ if (twoRowSelectedKey.value === group.key && !specialPageActive.value) return;+ twoRowFocusedGroupKey.value = group.key;+ const remembered = twoRowGroupActiveTabs.get(group.key);+ const targetId = remembered && group.tabIds.includes(remembered) ? remembered : group.tabIds[0];+ if (targetId) activateTab(targetId);+}++/**+ * The detail row: only the selected group's tabs. In sidebar mode the+ * database-level headers stay (their group collapse still works); the+ * connection header lives on the rail, so entries drop that ancestor level.+ */+const twoRowTabEntries = computed<StripEntry[]>(() => {+ const selected = twoRowSelectedKey.value;+ if (selected === null) return [];+ const merged = [...filteredPinnedTabs.value, ...filteredRegularTabs.value];+ const groupTabs = merged.filter((tab) => tabGroupKey(tab) === selected);+ if (settingsStore.editorSettings.tabGroupMode === "sidebar") {+ const connectionlessEntries: StripEntry[] = groupTabs.filter((tab) => !tab.connectionId).map((tab) => ({ kind: "tab", key: tab.id, tab, groupId: "", depth: 0, ancestorIds: [], groupFirst: false, groupLast: false, grouping: false }));+ const hierarchyEntries = buildConnectionDatabaseTabGroupStripEntries(+ groupTabs.filter((tab) => tab.connectionId),+ false,+ )+ .filter((entry) => !(entry.kind === "header" && entry.level === "connection"))+ .map((entry): StripEntry => {+ const ancestorIds = entry.kind === "header" ? [] : entry.ancestorIds.slice(1);+ if (entry.kind === "tab") return { ...entry, ancestorIds };+ return { ...entry, label: hierarchyDatabaseLabel(entry.tab), ancestorIds };+ });+ return [...connectionlessEntries, ...hierarchyEntries];+ }+ return groupTabs.map((tab, index): StripEntry => ({ kind: "tab", key: tab.id, tab, groupId: tabGroupId(tab), depth: 0, ancestorIds: [], groupFirst: index === 0, groupLast: index === groupTabs.length - 1, grouping: true }));+});++function getTwoRowGroupMenuItems(group: TwoRowGroupItem): ContextMenuItem[] {+ const customization = group.key ? tabGroupCustomization(group.tab) : undefined;+ return [+ { label: t("contextMenu.editTabGroup"), action: () => openTabGroupEditor(group.tab), icon: Pencil, visible: !!group.key },+ { label: t("contextMenu.resetTabGroup"), action: () => resetTabGroupCustomization(group.tab), icon: RotateCcw, visible: !!group.key && !!(customization?.name || customization?.color) },+ { label: "", separator: true, visible: !!group.key },+ { label: t("contextMenu.collapseAll"), action: collapseAllTabGroups, icon: ChevronsDownUp, visible: settingsStore.editorSettings.tabGroupMode === "sidebar" },+ { label: t("contextMenu.expandAll"), action: expandAllTabGroups, icon: ChevronsUpDown, visible: settingsStore.editorSettings.tabGroupMode === "sidebar" },+ { label: "", separator: true },+ { label: t("contextMenu.closeTabGroup"), action: () => closeTabsByIds(group.tabIds), icon: X, variant: "destructive" },+ ];+}+const stripSections = computed(() => {+ // The master-detail strip owns a single section: the selected group's tabs.+ if (isTwoRowLayout.value) return [{ key: "regular", pinned: false, entries: twoRowTabEntries.value }];const fixed = { key: "fixed", pinned: true, entries: pinnedStripEntries.value };const regular = { key: "regular", pinned: false, entries: regularStripEntries.value };if (isVerticalLayout.value) return [fixed, regular];@@ -1738,6 +1937,14 @@ watch(lastDispatchedSwitchTabId = null;// A tab that just became active must be visible: reveal its group if collapsed.expandTabGroupForTab(tabId);+ if (isTwoRowLayout.value && tabId) {+ const tab = queryStore.tabs.find((item) => item.id === tabId);+ if (tab) {+ const key = tabGroupKey(tab);+ twoRowGroupActiveTabs.set(key, tabId);+ twoRowFocusedGroupKey.value = key;+ }+ }nextTick(() => {if (!isWrapLayout.value) {const container = tabsContainerRef.value;@@ -1758,6 +1965,16 @@ watch(isVerticalLayout, (vertical) => {if (!vertical) tabSearchQuery.value = "";});+watch(twoRowSelectedKey, () => {+ nextTick(() => {+ twoRowRailRef.value?.querySelector(".tab-group-header--active")?.scrollIntoView({ behavior: tabScrollBehavior.value, block: "nearest", inline: "nearest" });+ });+});++// Adding/removing rail items changes scrollWidth without resizing the rail's+// box, which ResizeObserver cannot see — refresh the overflow state explicitly.+watch([twoRowGroupItems, railSpecialPageItems], () => updateRailScroll(), { flush: "post" });+watch(() => [props.tabs.map((tab) => `${tab.id}:${tab.pinned ? "1" : "0"}:${tab.title}:${tab.mode}`).join("|"),@@ -1860,9 +2077,94 @@ watch([() => props.specialPageTabs?.settingsActive, () => props.specialPageTabs?<component :is="tabBarCollapseIcon" class="h-4 w-4" /></button></div>+ <!-- Master-detail group rail: one pill per semantic group, the strip below renders only the selected group. -->+ <div v-if="isTwoRowLayout" class="tab-group-rail flex shrink-0 items-stretch" :class="isClassicLayout ? 'h-9 border-b border-border/80 dark:border-border/45' : 'h-8 border-b border-border/50'">+ <LightDropdown+ model-value=""+ :items="tabOrganizationItems"+ :selected-values="selectedTabOrganizationItems"+ :aria-label="t('settings.tabOrganization')"+ :trigger-title="t('settings.tabOrganization')"+ :trigger-icon="ListFilter"+ trigger-class="tab-organization-button"+ trigger-icon-class="h-4 w-4"+ item-icon-class="h-3.5 w-3.5"+ content-class="w-max min-w-0"+ selected-item-class="bg-primary/10 text-primary"+ selected-check-class="text-primary"+ :show-trigger-label="false"+ :show-chevron="false"+ :close-on-select="false"+ :match-trigger-width="false"+ max-height="min(600px, calc(100vh - 16px))"+ @update:model-value="selectTabOrganizationItem"+ />+ <div class="relative min-w-0 flex-1">+ <div v-if="railHasOverflow" class="app-tab-scrollbar" :class="{ 'app-tab-scrollbar--dragging': railIsScrollbarDragging }" @pointerdown="startRailScrollbarDrag">+ <div class="app-tab-scrollbar__thumb" :style="railScrollbarThumbStyle" />+ </div>+ <div+ ref="twoRowRailRef"+ class="tab-group-rail-scroll flex h-full items-center gap-0.5 overflow-x-auto overflow-y-hidden px-1"+ :class="{ 'tab-group-rail-scroll--overflow-start': railCanScrollStart, 'tab-group-rail-scroll--overflow-end': railCanScrollEnd }"+ :style="tabsContainerStyle"+ @scroll="updateRailScroll"+ @wheel="onRailWheel"+ >+ <CustomContextMenu v-for="group in twoRowGroupItems" :key="group.key" :items="() => getTwoRowGroupMenuItems(group)" v-slot="{ onContextMenu }">+ <button+ type="button"+ class="tab-group-header"+ :class="{ 'tab-group-header--active': twoRowSelectedKey === group.key }"+ :style="group.colorStyle"+ :title="group.label"+ :aria-pressed="twoRowSelectedKey === group.key"+ @click="selectTwoRowGroup(group)"+ @contextmenu="openTabGroupContextMenu($event, onContextMenu)"+ >+ <span class="tab-group-header-content">+ <span class="tab-group-marker" aria-hidden="true" />+ <ConnectionIcon v-if="group.key && settingsStore.editorSettings.tabGroupMode === 'sidebar'" :connection="connectionStore.getConfig(group.tab.connectionId)" class="tab-group-database-icon" aria-hidden="true" />+ <DatabaseIcon v-else :db-type="tabDatabaseIconType(group.tab)" class="tab-group-database-icon" aria-hidden="true" />+ <span class="tab-group-label">{{ group.label }}</span>+ <span class="tab-group-count">{{ group.count }}</span>+ </span>+ </button>+ </CustomContextMenu>+ <!-- App surfaces are rail-level contexts, not tabs of the selected group: they trail the group pills in the same scroll row. -->+ <CustomContextMenu v-for="page in railSpecialPageItems" :key="page.surface" :items="() => getSpecialPageTabMenuItems(page.surface)" v-slot="{ onContextMenu }">+ <div+ class="app-tab-pill group flex shrink-0 cursor-default items-center gap-1 px-2 text-xs transition-colors whitespace-nowrap select-none"+ :class="specialPageTabClass(page.active)"+ :style="specialPageTabStyle(page.active)"+ :data-active-tab="page.active"+ :title="page.label"+ :aria-label="page.label"+ :aria-pressed="page.active"+ role="button"+ tabindex="0"+ @click="activateSpecialPage(page.surface)"+ @keydown.enter.self.prevent="activateSpecialPage(page.surface)"+ @keydown.space.self.prevent="activateSpecialPage(page.surface)"+ @contextmenu="onContextMenu"+ @mousedown.middle.prevent="closeSpecialPage(page.surface)"+ >+ <component :is="page.icon" class="h-3.5 w-3.5 shrink-0" :class="page.iconClass" />+ <span class="min-w-0 flex-1 truncate">{{ page.label }}</span>+ <span v-if="page.badge > 0" class="inline-flex h-4 min-w-4 shrink-0 items-center justify-center rounded-full bg-red-500 px-1 text-[10px] font-medium leading-none text-white" :aria-label="t('toolbar.updatableDriverCount')">+ {{ page.badge > 99 ? "99+" : page.badge }}+ </span>+ <button class="shrink-0 rounded p-0.5 hover:bg-muted-foreground/20" :aria-label="t('common.close')" :title="t('common.close')" @click.stop="closeSpecialPage(page.surface)">+ <X class="h-3 w-3" />+ </button>+ </div>+ </CustomContextMenu>+ </div>+ </div>+ </div><div class="relative flex w-full min-w-0 shrink-0 overflow-hidden" :class="[isVerticalLayout ? ['min-h-0 flex-1 flex-col items-stretch'] : isClassicLayout ? 'h-9 items-stretch' : 'h-10 items-center px-2', { 'has-tab-overflow-control': showOverflowControl }]"><LightDropdown- v-if="!isVerticalLayout"+ v-if="!isVerticalLayout && !isTwoRowLayout"model-value="":items="tabOrganizationItems":selected-values="selectedTabOrganizationItems"@@ -2043,7 +2345,7 @@ watch([() => props.specialPageTabs?.settingsActive, () => props.specialPageTabs?</div></CustomContextMenu></template>- <template v-if="!section.pinned && showSpecialPageTabs">+ <template v-if="!section.pinned && showSpecialPageTabs && !isTwoRowLayout"><CustomContextMenu v-if="specialPageTabs?.pluginCenterOpen" :items="getSpecialPageTabMenuItems('pluginCenter')" v-slot="{ onContextMenu }"><Tooltip :open="openTabTooltipId === 'special:plugin-center'" @update:open="updateTabTooltipOpen('special:plugin-center', $event)"><TooltipTrigger as-child>diff --git a/apps/desktop/src/components/layout/__tests__/EditorGroupTabBar.groups.spec.ts b/apps/desktop/src/components/layout/__tests__/EditorGroupTabBar.groups.spec.tsindex 0ca704d042..afea164ff0 100644--- a/apps/desktop/src/components/layout/__tests__/EditorGroupTabBar.groups.spec.ts+++ b/apps/desktop/src/components/layout/__tests__/EditorGroupTabBar.groups.spec.ts@@ -878,6 +878,23 @@ describe("EditorGroupTabBar special page navigation", () => {return { ...mounted, store, settings, tabId, specialPageTabs, events };}+ it("returns from a special page when the current two-row group is clicked", async () => {+ const activate = vi.fn();+ const { app, host, settings, tabId } = mountSpecialBar({ "onActivate-tab": activate });+ settings.editorSettings.tabGroupRows = "two-row";+ try {+ await settle();+ const group = host.querySelector<HTMLButtonElement>(".tab-group-rail-scroll .tab-group-header");+ expect(group).not.toBeNull();+ group!.click();+ await settle();+ expect(activate).toHaveBeenCalledWith(tabId);+ } finally {+ app.unmount();+ host.remove();+ }+ });+it.each(["classic", "separated"] as const)("keeps grouped tabs and both special pages at every placement in %s layout", async (layout) => {const { app, host, settings, store, tabId } = mountSpecialBar();settings.editorSettings.appLayout = layout;diff --git a/apps/desktop/src/components/layout/appTabBar.css b/apps/desktop/src/components/layout/appTabBar.cssindex 60e6e00f7d..28356aa015 100644--- a/apps/desktop/src/components/layout/appTabBar.css+++ b/apps/desktop/src/components/layout/appTabBar.css@@ -951,6 +951,69 @@transition: none !important;}+/* ------------------------------------------------------------------ */+/* Master-detail two-row group rail (issue #10034) */+/* ------------------------------------------------------------------ */++/* The rail reuses the semantic group header pill on its own scroll row, so a+ * group can overflow horizontally exactly like the tab strip beneath it. */+.tab-group-rail {+ scrollbar-width: none;+}++/* The scroller is .tab-group-rail-scroll, not .tab-group-rail itself. */+.tab-group-rail-scroll::-webkit-scrollbar {+ display: none;+}++/* Same reveal contract as .app-tab-strip: the rail's drag scrollbar stays+ * hidden until the row is hovered/focused; --dragging is already global. */+.tab-group-rail:hover .app-tab-scrollbar,+.tab-group-rail:focus-within .app-tab-scrollbar {+ opacity: 1;+ pointer-events: auto;+}++/* Long connection names must not eat the whole rail. Respect the user's tab+ * width cap when one is configured; otherwise keep a sane 16rem default. */+.tab-group-rail .tab-group-header-content {+ max-width: var(--tab-max-width, 16rem);+}++/* The base ::after pushes the accent 0.2rem past the pill's right edge so a+ * header's underline visually joins its tabs in the single-row strip. Rail+ * pills stand alone, so the overlap reads as a stray overhang there. The+ * :not() prefix keeps specificity above the base header rule. */+.app-tab-bar:not(.vertical-tab-layout) .tab-group-rail .tab-group-header::after {+ right: 0;+}++/* Group headers carry an asymmetric 0.15rem/0.05rem inline margin tuned for+ * the single-row strip, while .app-tab-pill pages carry none — mixing them in+ * the rail produced uneven gaps. Zero the margin here so the container's gap+ * spaces every pill identically. Same :not() specificity trick as ::after. */+.app-tab-bar:not(.vertical-tab-layout) .tab-group-rail .tab-group-header {+ margin-inline: 0;+}++/* The rail hides its scrollbar, so clipped pills need another affordance:+ * fade the overflowing edge(s). Driven by the rail's own useTabScroll state.+ * -webkit- prefix keeps the fade on older WKWebView (macOS 12). */+.tab-group-rail-scroll--overflow-start {+ -webkit-mask-image: linear-gradient(to right, transparent, #000 1.25rem);+ mask-image: linear-gradient(to right, transparent, #000 1.25rem);+}++.tab-group-rail-scroll--overflow-end {+ -webkit-mask-image: linear-gradient(to left, transparent, #000 1.25rem);+ mask-image: linear-gradient(to left, transparent, #000 1.25rem);+}++.tab-group-rail-scroll--overflow-start.tab-group-rail-scroll--overflow-end {+ -webkit-mask-image: linear-gradient(to right, transparent, #000 1.25rem, #000 calc(100% - 1.25rem), transparent);+ mask-image: linear-gradient(to right, transparent, #000 1.25rem, #000 calc(100% - 1.25rem), transparent);+}+.tab-group-color-option,.tab-group-custom-color {position: relative;diff --git a/apps/desktop/src/i18n/locales/en.ts b/apps/desktop/src/i18n/locales/en.tsindex e713085054..23e27445d9 100644--- a/apps/desktop/src/i18n/locales/en.ts+++ b/apps/desktop/src/i18n/locales/en.ts@@ -2423,6 +2423,8 @@ export default {closeWindow: "Close",searchOpenTabs: "Search open tabs...",collapseTabBar: "Collapse tab bar",+ ungroupedTabs: "Ungrouped",+ pluginTabs: "Plugins",expandTabBar: "Expand tab bar",switcherTitle: "Switch Tab",switcherHint: "keep pressing to move, release to switch",@@ -9242,6 +9244,10 @@ export default {tabGroupDatabase: "Group by database",tabGroupConnection: "Group by connection",tabGroupSidebar: "Group by connection, database and table",+ tabGroupRows: "Group rows",+ tabGroupRowsSingle: "Single row",+ tabGroupRowsTwoRow: "Two rows (groups on their own row)",+ tabGroupRowsDescription: "Only applies to a top or bottom tab bar with grouping enabled: groups get their own row and the selected group's tabs appear on the next row.",tabSort: "Sort by",tabSortManual: "Manual order",tabSortCreated: "Creation time",diff --git a/apps/desktop/src/i18n/locales/es.ts b/apps/desktop/src/i18n/locales/es.tsindex aceeb90c6f..3b48ab2a0f 100644--- a/apps/desktop/src/i18n/locales/es.ts+++ b/apps/desktop/src/i18n/locales/es.ts@@ -2295,6 +2295,8 @@ export default withEnglishFallback({etcdDashboard: "Panel de etcd",etcdAccessControl: "Control de acceso de etcd",...nacosAccessControlTabs,+ ungroupedTabs: "Sin agrupar",+ pluginTabs: "Plugins",},executionSummary: {empty: "Sin resumen",@@ -9560,6 +9562,10 @@ export default withEnglishFallback({shortcutSelectLineEnds: "Seleccionar finales de línea",openQueryOnConnectionOpen: "Abrir la página de consulta al abrir la conexión",openQueryOnConnectionOpenDescription: "Al abrir una conexión o base de datos, abre su consulta default.sql y guarda los cambios automáticamente.",+ tabGroupRows: "Filas de grupos",+ tabGroupRowsSingle: "Una fila",+ tabGroupRowsTwoRow: "Dos filas (grupos en su propia fila)",+ tabGroupRowsDescription: "Solo se aplica a una barra de pestañas superior o inferior con la agrupación activada: los grupos ocupan su propia fila y las pestañas del grupo seleccionado aparecen en la fila siguiente.",},driverStore: {jreDirRemoveFailed: "No se pudo eliminar el directorio JRE antiguo: {path} (error original: {error})",diff --git a/apps/desktop/src/i18n/locales/it.ts b/apps/desktop/src/i18n/locales/it.tsindex f83449782a..2e1eeb94d3 100644--- a/apps/desktop/src/i18n/locales/it.ts+++ b/apps/desktop/src/i18n/locales/it.ts@@ -2194,6 +2194,8 @@ export default withEnglishFallback({etcdDashboard: "etcd dashboard",etcdAccessControl: "controllo accessi etcd",...nacosAccessControlTabs,+ ungroupedTabs: "Non raggruppate",+ pluginTabs: "Plugin",},executionSummary: {empty: "Nessun riepilogo",@@ -9309,6 +9311,10 @@ export default withEnglishFallback({shortcutSelectLineEnds: "Seleziona fine riga",openQueryOnConnectionOpen: "Apri la pagina Query all'apertura della connessione",openQueryOnConnectionOpenDescription: "Apre la query default.sql quando si apre una connessione o un database e salva automaticamente le modifiche.",+ tabGroupRows: "Righe dei gruppi",+ tabGroupRowsSingle: "Riga singola",+ tabGroupRowsTwoRow: "Due righe (gruppi su una riga dedicata)",+ tabGroupRowsDescription: "Si applica solo a una barra delle schede superiore o inferiore con raggruppamento attivo: i gruppi occupano una riga dedicata e le schede del gruppo selezionato compaiono nella riga successiva.",},driverStore: {jreDirRemoveFailed: "Impossibile rimuovere la vecchia directory JRE: {path} (errore originale: {error})",diff --git a/apps/desktop/src/i18n/locales/ja.ts b/apps/desktop/src/i18n/locales/ja.tsindex 90576973b7..122fe077a5 100644--- a/apps/desktop/src/i18n/locales/ja.ts+++ b/apps/desktop/src/i18n/locales/ja.ts@@ -2216,6 +2216,8 @@ export default withEnglishFallback({etcdDashboard: "etcd ダッシュボード",etcdAccessControl: "etcd アクセス制御",...nacosAccessControlTabs,+ ungroupedTabs: "未グループ",+ pluginTabs: "プラグイン",},executionSummary: {empty: "サマリーはありません",@@ -9346,6 +9348,10 @@ export default withEnglishFallback({shortcutSelectLineEnds: "行末を選択",openQueryOnConnectionOpen: "接続を開いたときにクエリページを開く",openQueryOnConnectionOpenDescription: "有効にすると、接続またはデータベースを開いたときに default.sql を開き、変更を自動保存します。",+ tabGroupRows: "グループ行数",+ tabGroupRowsSingle: "1行",+ tabGroupRowsTwoRow: "2行(グループを独立した行に表示)",+ tabGroupRowsDescription: "タブバーが上または下に配置されていて、グループ化が有効な場合にのみ適用されます。グループは専用の行に表示され、選択したグループのタブは次の行に表示されます。",},driverStore: {jreDirRemoveFailed: "古い JRE ディレクトリを削除できませんでした: {path}(元のエラー: {error})",diff --git a/apps/desktop/src/i18n/locales/ko.ts b/apps/desktop/src/i18n/locales/ko.tsindex 97bfe0fbd0..ff5f288e2f 100644--- a/apps/desktop/src/i18n/locales/ko.ts+++ b/apps/desktop/src/i18n/locales/ko.ts@@ -2111,6 +2111,8 @@ export default withEnglishFallback({suffixDuplicateBack: "접미사 변경",suffixDuplicateUseAnyway: "그대로 사용",settingsSaveFailed: "탭 설정을 저장하지 못했습니다: {message}",+ ungroupedTabs: "그룹 없음",+ pluginTabs: "플러그인",},databaseBrowser: {search: "데이터베이스 검색...",@@ -9244,6 +9246,10 @@ export default withEnglishFallback({shortcutSelectLineEnds: "줄 끝 선택",openQueryOnConnectionOpen: "연결을 열 때 쿼리 페이지로 이동",openQueryOnConnectionOpenDescription: "활성화하면 연결 또는 데이터베이스를 열 때 default.sql 쿼리를 열고 변경 사항을 자동 저장합니다.",+ tabGroupRows: "그룹 행 수",+ tabGroupRowsSingle: "한 줄",+ tabGroupRowsTwoRow: "두 줄 (그룹을 별도 줄에 표시)",+ tabGroupRowsDescription: "탭 표시줄이 위쪽 또는 아래쪽에 있고 그룹화가 활성화된 경우에만 적용됩니다. 그룹은 별도의 줄에 표시되고 선택한 그룹의 탭은 다음 줄에 표시됩니다.",},driverStore: {jreDirRemoveFailed: "이전 JRE 디렉터리 제거 실패: {path} (원래 오류: {error})",diff --git a/apps/desktop/src/i18n/locales/pt-BR.ts b/apps/desktop/src/i18n/locales/pt-BR.tsindex 28af871993..b25d53c3b2 100644--- a/apps/desktop/src/i18n/locales/pt-BR.ts+++ b/apps/desktop/src/i18n/locales/pt-BR.ts@@ -2196,6 +2196,8 @@ export default withEnglishFallback({etcdDashboard: "painel etcd",etcdAccessControl: "controle de acesso do etcd",...nacosAccessControlTabs,+ ungroupedTabs: "Não agrupadas",+ pluginTabs: "Plugins",},executionSummary: {empty: "Nenhum resumo",@@ -9306,6 +9308,10 @@ export default withEnglishFallback({shortcutSelectLineEnds: "Selecionar fins de linha",openQueryOnConnectionOpen: "Abrir consulta ao abrir a conexão",openQueryOnConnectionOpenDescription: "Ao abrir uma conexão ou banco de dados, abre a consulta default.sql e salva as alterações automaticamente.",+ tabGroupRows: "Linhas de grupos",+ tabGroupRowsSingle: "Uma linha",+ tabGroupRowsTwoRow: "Duas linhas (grupos em linha própria)",+ tabGroupRowsDescription: "Aplica-se apenas a uma barra de abas no topo ou na base com agrupamento ativado: os grupos ocupam uma linha própria e as abas do grupo selecionado aparecem na linha seguinte.",},driverStore: {jreDirRemoveFailed: "Não foi possível remover o diretório JRE antigo: {path} (erro original: {error})",diff --git a/apps/desktop/src/i18n/locales/ru.ts b/apps/desktop/src/i18n/locales/ru.tsindex d45b540e0b..92aa60fb10 100644--- a/apps/desktop/src/i18n/locales/ru.ts+++ b/apps/desktop/src/i18n/locales/ru.ts@@ -2205,6 +2205,8 @@ export default withEnglishFallback({suffixDuplicateBack: "Изменить суффикс",suffixDuplicateUseAnyway: "Всё равно использовать",settingsSaveFailed: "Не удалось сохранить настройки вкладок: {message}",+ ungroupedTabs: "Без группы",+ pluginTabs: "Плагины",},databaseBrowser: {search: "Поиск баз данных...",@@ -10732,6 +10734,10 @@ export default withEnglishFallback({dataGridColumnCommentsInInfoAreaDescription: "Переносить комментарии выбранных столбцов в нижнюю строку состояния и не отображать их в заголовке таблицы.",dataGridTransposeMetadataInInfoColumn: "Отдельный информационный столбец в транспонированном представлении",dataGridTransposeMetadataInInfoColumnDescription: "В транспонированном представлении данных таблицы и результатов запроса размещать тип, допустимость NULL и комментарии в отдельном информационном столбце справа от значений; имена полей остаются в одной строке.",+ tabGroupRows: "Строки групп",+ tabGroupRowsSingle: "Одна строка",+ tabGroupRowsTwoRow: "Две строки (группы на отдельной строке)",+ tabGroupRowsDescription: "Действует только для верхней или нижней панели вкладок с включённой группировкой: группы занимают отдельную строку, а вкладки выбранной группы отображаются на следующей строке.",},driverStore: {jreDirRemoveFailed: "Не удалось удалить старый каталог JRE: {path} (исходная ошибка: {error})",diff --git a/apps/desktop/src/i18n/locales/th.ts b/apps/desktop/src/i18n/locales/th.tsindex 3a8e7a8586..0fe4061e26 100644--- a/apps/desktop/src/i18n/locales/th.ts+++ b/apps/desktop/src/i18n/locales/th.ts@@ -2401,6 +2401,8 @@ export default withEnglishFallback({suffixDuplicateBack: "เปลี่ยน Suffix",suffixDuplicateUseAnyway: "ใช้ต่อไป",settingsSaveFailed: "บันทึกการตั้งค่าแท็บไม่สำเร็จ: {message}",+ ungroupedTabs: "ไม่ได้จัดกลุ่ม",+ pluginTabs: "ปลั๊กอิน",},databaseBrowser: {search: "ค้นหาฐานข้อมูล...",@@ -11150,6 +11152,10 @@ export default withEnglishFallback({dataGridColumnCommentsInInfoAreaDescription: "ย้ายคำอธิบายของคอลัมน์ที่เลือกไปยังแถบสถานะด้านล่าง และไม่แสดงในส่วนหัวอีกต่อไป",dataGridTransposeMetadataInInfoColumn: "มุมมองทรานสโพสใช้คอลัมน์ข้อมูลแยกต่างหาก",dataGridTransposeMetadataInInfoColumnDescription: "ในมุมมองทรานสโพสของข้อมูลตารางและผลลัพธ์คิวรี ให้วางประเภท การเป็นค่าว่างได้ และคำอธิบายไว้ในคอลัมน์ข้อมูลแยกทางด้านขวาของค่า โดยชื่อคอลัมน์คงอยู่ในบรรทัดเดียว",+ tabGroupRows: "จำนวนแถวกลุ่ม",+ tabGroupRowsSingle: "แถวเดียว",+ tabGroupRowsTwoRow: "สองแถว (กลุ่มแสดงในแถวของตัวเอง)",+ tabGroupRowsDescription: "ใช้เฉพาะเมื่อแถบแท็บอยู่ด้านบนหรือด้านล่างและเปิดใช้งานการจัดกลุ่ม: กลุ่มจะแสดงในแถวของตัวเอง และแท็บของกลุ่มที่เลือกจะแสดงในแถวถัดไป",},driverStore: {jreDirRemoveFailed: "ลบไดเรกทอรี JRE เก่าไม่สำเร็จ: {path} (ข้อผิดพลาดเดิม: {error})",diff --git a/apps/desktop/src/i18n/locales/zh-CN.ts b/apps/desktop/src/i18n/locales/zh-CN.tsindex c0ffb20690..c2320fe48d 100644--- a/apps/desktop/src/i18n/locales/zh-CN.ts+++ b/apps/desktop/src/i18n/locales/zh-CN.ts@@ -2356,6 +2356,8 @@ export default withEnglishFallback({closeWindow: "关闭",searchOpenTabs: "搜索...",collapseTabBar: "收起标签栏",+ ungroupedTabs: "未分组",+ pluginTabs: "插件",expandTabBar: "展开标签栏",switcherTitle: "切换标签页",switcherHint: "继续按选择,松开修饰键切换",@@ -9210,6 +9212,10 @@ export default withEnglishFallback({tabGroupDatabase: "按数据库分组",tabGroupConnection: "按连接分组",tabGroupSidebar: "按连接、库和表分组",+ tabGroupRows: "分组行数",+ tabGroupRowsSingle: "单行",+ tabGroupRowsTwoRow: "两行(分组单独一行)",+ tabGroupRowsDescription: "仅在标签栏位于上方或下方且启用分组时生效:分组单独占一行,所选分组的标签页显示在下一行。",tabSort: "排序方式",tabSortManual: "手动排序",tabSortCreated: "按创建时间",diff --git a/apps/desktop/src/i18n/locales/zh-TW.ts b/apps/desktop/src/i18n/locales/zh-TW.tsindex 59fb46bc7b..213b801661 100644--- a/apps/desktop/src/i18n/locales/zh-TW.ts+++ b/apps/desktop/src/i18n/locales/zh-TW.ts@@ -2172,6 +2172,8 @@ export default withEnglishFallback({openInNewWindow: "在新視窗中開啟",searchOpenTabs: "搜尋已開啟的分頁...",collapseTabBar: "收合分頁列",+ ungroupedTabs: "未分組",+ pluginTabs: "外掛",expandTabBar: "展開分頁列",switcherTitle: "切換分頁",switcherHint: "繼續按選擇,放開修飾鍵切換",@@ -7377,6 +7379,10 @@ export default withEnglishFallback({tabGroupDatabase: "依資料庫分組",tabGroupConnection: "依連線分組",tabGroupSidebar: "依連線、資料庫與資料表分組",+ tabGroupRows: "分組行數",+ tabGroupRowsSingle: "單行",+ tabGroupRowsTwoRow: "兩行(分組單獨一行)",+ tabGroupRowsDescription: "僅在標籤欄位於上方或下方且啟用分組時生效:分組單獨佔一行,所選分組的標籤頁顯示在下一行。",tabSort: "排序方式",tabSortManual: "手動排序",tabSortCreated: "依建立時間",diff --git a/apps/desktop/src/lib/settings/editorSettingsDraft.ts b/apps/desktop/src/lib/settings/editorSettingsDraft.tsindex cdf2484a04..9834771352 100644--- a/apps/desktop/src/lib/settings/editorSettingsDraft.ts+++ b/apps/desktop/src/lib/settings/editorSettingsDraft.ts@@ -60,6 +60,7 @@ export const EDITOR_SETTINGS_DRAFT_KEYS = ["tabGroupMode","tabSortMode","tabMaxWidth",+ "tabGroupRows","showColumnCommentsInHeader","dataGridColumnCommentsInInfoArea","showColumnTypesInHeader",diff --git a/apps/desktop/src/lib/settings/settingsSearch.ts b/apps/desktop/src/lib/settings/settingsSearch.tsindex ac98b0308e..169cfeb9e5 100644--- a/apps/desktop/src/lib/settings/settingsSearch.ts+++ b/apps/desktop/src/lib/settings/settingsSearch.ts@@ -749,6 +749,7 @@ export const SETTINGS_SEARCH_DEFINITIONS: readonly SettingsSearchDefinition[] =keywordKeys: ["settings.tabPlacementTop", "settings.tabPlacementBottom", "settings.tabPlacementLeft", "settings.tabPlacementRight"],},{ id: "appearance-tab-group", category: "appearance", titleKey: "settings.tabGroup", targetId: "appearance", keywordKeys: ["settings.tabGroupNone", "settings.tabGroupDatabaseType", "settings.tabGroupDatabase", "settings.tabGroupConnection", "settings.tabGroupSidebar"] },+ { id: "appearance-tab-group-rows", category: "appearance", titleKey: "settings.tabGroupRows", descriptionKey: "settings.tabGroupRowsDescription", targetId: "appearance", keywordKeys: ["settings.tabGroupRowsSingle", "settings.tabGroupRowsTwoRow"] },{ id: "appearance-tab-sort", category: "appearance", titleKey: "settings.tabSort", targetId: "appearance", keywordKeys: ["settings.tabSortManual", "settings.tabSortCreated", "settings.tabSortTitle"] },{ id: "appearance-background-image", category: "appearance", titleKey: "settings.backgroundImage", descriptionKey: "settings.backgroundImageDescription", targetId: "appearance", visible: desktopOnly },{diff --git a/apps/desktop/src/lib/settings/settingsTransfer.ts b/apps/desktop/src/lib/settings/settingsTransfer.tsindex 381eae863f..a619f3a5e7 100644--- a/apps/desktop/src/lib/settings/settingsTransfer.ts+++ b/apps/desktop/src/lib/settings/settingsTransfer.ts@@ -126,6 +126,7 @@ const SETTINGS_TRANSFER_CATEGORY_KEYS: Record<SettingsTransferCategoryId, readon"colorizeConnectionTabs","tabSortMode","tabMaxWidth",+ "tabGroupRows","sidebarActivation","sidebarObjectDisplay","routineSourceOpenMode",diff --git a/apps/desktop/src/stores/settingsStore.ts b/apps/desktop/src/stores/settingsStore.tsindex e2fa5c52f6..f15731f602 100644--- a/apps/desktop/src/stores/settingsStore.ts+++ b/apps/desktop/src/stores/settingsStore.ts@@ -820,6 +820,8 @@ export interface TabGroupCustomization {}const TAB_SORT_MODES = ["manual", "created-asc", "title-asc"] as const;export type TabSortMode = (typeof TAB_SORT_MODES)[number];+const TAB_GROUP_ROW_MODES = ["single", "two-row"] as const;+export type TabGroupRowMode = (typeof TAB_GROUP_ROW_MODES)[number];const DATA_GRID_RENDER_MODES = ["dom", "canvas"] as const;export type DataGridRenderMode = (typeof DATA_GRID_RENDER_MODES)[number];const DATA_GRID_SEARCH_MODES = ["filter", "highlight"] as const;@@ -1029,6 +1031,8 @@ export interface EditorSettings {tabSortMode: TabSortMode;/** 水平标签页最大显示宽度(像素,0 表示不限制)。 */tabMaxWidth: number;+ /** 分组标签在水平标签栏中的行数:single 为分组与标签混排一行,two-row 为分组独占一行。 */+ tabGroupRows: TabGroupRowMode;appLayout: "separated" | "classic";webLogoPosition: WebLogoPosition;pageSize: number;@@ -1409,6 +1413,7 @@ export const DEFAULT_EDITOR_SETTINGS: EditorSettings = {tabGroupCustomizations: {},tabSortMode: "manual",tabMaxWidth: 0,+ tabGroupRows: "single",appLayout: "classic",webLogoPosition: "left",pageSize: 100,@@ -1666,6 +1671,10 @@ export function normalizeTabMaxWidth(value: unknown): number {return DEFAULT_EDITOR_SETTINGS.tabMaxWidth;}+function normalizeTabGroupRows(value: unknown): TabGroupRowMode {+ return TAB_GROUP_ROW_MODES.includes(value as TabGroupRowMode) ? (value as TabGroupRowMode) : DEFAULT_EDITOR_SETTINGS.tabGroupRows;+}+function normalizeCellDetailPanelLayout(value: unknown): CellDetailPanelLayout {return CELL_DETAIL_PANEL_LAYOUTS.includes(value as CellDetailPanelLayout) ? (value as CellDetailPanelLayout) : DEFAULT_EDITOR_SETTINGS.cellDetailPanelLayout;}@@ -2077,6 +2086,7 @@ export function normalizeEditorSettings(settings: Partial<EditorSettings>, existtabGroupCustomizations: normalizeTabGroupCustomizations(settings.tabGroupCustomizations),tabSortMode: normalizeTabSortMode(settings.tabSortMode),tabMaxWidth: normalizeTabMaxWidth(settings.tabMaxWidth),+ tabGroupRows: normalizeTabGroupRows(settings.tabGroupRows),appLayout: settings.appLayout ?? DEFAULT_EDITOR_SETTINGS.appLayout,webLogoPosition: normalizeWebLogoPosition(settings.webLogoPosition),pageSize: normalizeResultPageSize(settings.pageSize),@@ -3000,6 +3010,7 @@ export const useSettingsStore = defineStore("settings", () => {if (partial.tabGroupCustomizations !== undefined) editorSettings.value.tabGroupCustomizations = normalizeTabGroupCustomizations(partial.tabGroupCustomizations);if (partial.tabSortMode !== undefined) editorSettings.value.tabSortMode = normalizeTabSortMode(partial.tabSortMode);if (partial.tabMaxWidth !== undefined) editorSettings.value.tabMaxWidth = normalizeTabMaxWidth(partial.tabMaxWidth);+ if (partial.tabGroupRows !== undefined) editorSettings.value.tabGroupRows = normalizeTabGroupRows(partial.tabGroupRows);if (partial.appLayout !== undefined) editorSettings.value.appLayout = partial.appLayout;if (partial.webLogoPosition !== undefined) editorSettings.value.webLogoPosition = normalizeWebLogoPosition(partial.webLogoPosition);if (partial.pageSize !== undefined) editorSettings.value.pageSize = normalizeResultPageSize(partial.pageSize);