diff --git a/frontend/src/components/TabManager.hover.test.tsx b/frontend/src/components/TabManager.hover.test.tsx index 1e3bed0..4e79d0d 100644 --- a/frontend/src/components/TabManager.hover.test.tsx +++ b/frontend/src/components/TabManager.hover.test.tsx @@ -3,7 +3,7 @@ import { readFileSync } from 'node:fs'; import { renderToStaticMarkup } from 'react-dom/server'; import { describe, expect, it, vi } from 'vitest'; -import { resolveTabHoverOpen, TabHoverInfo, stopTabHoverDragPropagation } from './TabManager'; +import { TAB_WORKBENCH_CLASS_NAME, resolveTabHoverOpen, TabHoverInfo, stopTabHoverDragPropagation } from './TabManager'; import type { TabData } from '../types'; describe('TabManager hover info', () => { @@ -13,6 +13,15 @@ describe('TabManager hover info', () => { expect(source).toContain('const TabManager: React.FC = React.memo(() => {'); }); + it('keeps the tab workbench as a full-height flex child in legacy and v2 UI', () => { + const source = readFileSync(new URL('./TabManager.tsx', import.meta.url), 'utf8'); + + expect(TAB_WORKBENCH_CLASS_NAME).toBe('tab-workbench'); + expect(source).toContain("className={`${TAB_WORKBENCH_CLASS_NAME}${isV2Ui ? ' gn-v2-tab-workbench' : ''}`}"); + expect(source).toContain('.${TAB_WORKBENCH_CLASS_NAME} {'); + expect(source).toMatch(/\.\$\{TAB_WORKBENCH_CLASS_NAME\} \{[\s\S]*height: 100%;[\s\S]*flex: 1 1 auto;[\s\S]*min-height: 0;[\s\S]*display: flex;[\s\S]*flex-direction: column;[\s\S]*overflow: hidden;/); + }); + it('renders full v2 tab hover context for table tabs', () => { const tab: TabData = { id: 'conn-1-main-users', diff --git a/frontend/src/components/TabManager.tsx b/frontend/src/components/TabManager.tsx index eec363d..584432c 100644 --- a/frontend/src/components/TabManager.tsx +++ b/frontend/src/components/TabManager.tsx @@ -40,6 +40,8 @@ const getTabKindLabel = (tab: TabData): string => { return 'TAB'; }; +export const TAB_WORKBENCH_CLASS_NAME = 'tab-workbench'; + const getTabKindIcon = (tab: TabData): React.ReactNode => { if (tab.type === 'query') return ; if (tab.type === 'table-overview') return ; @@ -532,8 +534,17 @@ const TabManager: React.FC = React.memo(() => { ); return ( -
+