From c66a699aa7813cbe43358ab0393f86654ea628bf Mon Sep 17 00:00:00 2001 From: t8y2 <1156263951@qq.com> Date: Sat, 5 Sep 2026 12:39:41 +0800 Subject: [PATCH] fix(layout): merge special page tabs into the editor tab strip Settings and driver store no longer sit on a strip of their own: while open but inactive they append to the focused group's tab strip (v0.6.2 order), and while active the app-level strip re-renders the open tabs with mode icons and inactive styling as the mouse path back to the editors. Special tabs follow the classic/separated presentation, including the classic active underline. --- apps/desktop/src/App.vue | 20 ++++-- .../src/components/layout/AppTabBar.vue | 51 ++++++++++++-- .../src/components/layout/EditorGroup.vue | 9 ++- .../components/layout/EditorGroupTabBar.vue | 64 +++++++++++++++++ .../components/layout/SqlEditorWorkspace.vue | 7 +- .../src/components/layout/TabModeIcon.vue | 28 ++++++++ .../layout/__tests__/AppTabBar.spec.ts | 69 +++++++++++++++++++ .../__tests__/EditorGroup.mount.spec.ts | 44 ------------ .../appContentSurfaces.contract.spec.ts | 27 ++++---- .../components/layout/editorToolbarActions.ts | 23 +++++++ .../app-tests/specialSurfaceTabStrip.test.ts | 24 ------- 11 files changed, 266 insertions(+), 100 deletions(-) create mode 100644 apps/desktop/src/components/layout/TabModeIcon.vue delete mode 100644 packages/app-tests/specialSurfaceTabStrip.test.ts diff --git a/apps/desktop/src/App.vue b/apps/desktop/src/App.vue index 28f9b1b6ff..f0ca23d2ab 100644 --- a/apps/desktop/src/App.vue +++ b/apps/desktop/src/App.vue @@ -781,6 +781,15 @@ function requestActiveEditorExecuteInNewResultTab() { // Per-group editor toolbars call back into this App-owned orchestration. The // group focuses itself on pointerdown/focusin before any toolbar event, so the // acting tab is passed explicitly instead of relying on the focused group. +// Declared above the provide: the object references the variable itself, while +// the lazy getter safely reads later-declared update-count refs at render time. +const specialPageTabs = computed(() => ({ + settingsOpen: settingsPageTabOpen.value, + settingsActive: settingsStore.settingsPageActive, + driverStoreOpen: driverStoreTabOpen.value, + driverStoreActive: driverStoreActive.value, + driverUpdateCount: toolbarAgentDriverUpdateCount.value, +})); provide(EDITOR_TOOLBAR_ACTIONS, { explainMode, blockDangerousRedisCommands, @@ -804,6 +813,11 @@ provide(EDITOR_TOOLBAR_ACTIONS, { changeSchema: changeActiveSchema, setDefaultDatabase: setActiveDatabaseAsDefault, clearDefaultDatabase: clearActiveDefaultDatabase, + specialPageTabs, + activateSettingsPage, + closeSettingsPage, + activateDriverStore: () => openDriverStorePage(), + closeDriverStore: closeDriverStorePage, }); // Upstream "preview changes" entry: dormant until the group toolbar wires the @@ -3445,6 +3459,7 @@ onUnmounted(() => { :can-detach-tabs="isDesktop" @activate-driver-store="openDriverStorePage" @activate-settings-page="activateSettingsPage" + @activate-tab="activateQueryTab" @close-driver-store="closeDriverStorePage" @close-settings-page="closeSettingsPage" @save-tab="handleSaveTab" @@ -3495,12 +3510,9 @@ onUnmounted(() => { @update:open="(open: boolean) => (open ? activateSettingsPage() : closeSettingsPage())" @check-updates="checkUpdates()" /> - -