From 8dde4c3c6df46acb34d02da52478d3f0bf9cd1d3 Mon Sep 17 00:00:00 2001 From: Syngnat Date: Thu, 25 Jun 2026 18:42:53 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix(tool-center):=20=E7=A7=BB?= =?UTF-8?q?=E9=99=A4=E5=86=85=E5=B5=8C=E5=B7=A5=E5=85=B7=E9=87=8D=E5=A4=8D?= =?UTF-8?q?=E6=A0=87=E9=A2=98=E5=A4=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 工具中心详情页统一承载入口标题和说明 - 数据同步、表结构比对和数据比对嵌入时隐藏内部 hero - 数据目录、快捷键、连接包和安全更新嵌入时隐藏内部 Modal 标题 - 补充工具中心全 pane 标题归属回归断言 --- frontend/src/App.tool-center.test.ts | 54 ++++++++ frontend/src/App.tsx | 14 +- .../ConnectionPackagePasswordModal.tsx | 3 +- .../src/components/DataSyncModal.i18n.test.ts | 6 + frontend/src/components/DataSyncModal.tsx | 124 +++++++++--------- .../SecurityUpdateSettingsModal.i18n.test.tsx | 5 + .../SecurityUpdateSettingsModal.tsx | 3 +- frontend/src/i18n/catalog.test.ts | 2 + 8 files changed, 138 insertions(+), 73 deletions(-) diff --git a/frontend/src/App.tool-center.test.ts b/frontend/src/App.tool-center.test.ts index 114710f..3536462 100644 --- a/frontend/src/App.tool-center.test.ts +++ b/frontend/src/App.tool-center.test.ts @@ -103,6 +103,60 @@ describe('tool center menu entries', () => { expect(appSource).toContain("borderBottom: `1px solid ${overlayTheme.divider}`"); }); + it('lets the tool center detail header own embedded tool titles', () => { + const renderPaneStart = appSource.indexOf('const renderToolCenterPane = () => {'); + const renderPaneSource = appSource.slice( + renderPaneStart, + appSource.indexOf('};\n\n return (', renderPaneStart), + ); + const connectionPackageSource = renderPaneSource.slice( + renderPaneSource.indexOf("if (activeToolCenterPane.key === 'connection-package')"), + renderPaneSource.indexOf("if (activeToolCenterPane.key === 'data-root')"), + ); + const dataRootSource = renderPaneSource.slice( + renderPaneSource.indexOf("if (activeToolCenterPane.key === 'data-root')"), + renderPaneSource.indexOf("if (activeToolCenterPane.key === 'security-update')"), + ); + const securityUpdateSource = renderPaneSource.slice( + renderPaneSource.indexOf("if (activeToolCenterPane.key === 'security-update')"), + renderPaneSource.indexOf("activeToolCenterPane.key === 'schema-compare'"), + ); + const dataSyncSource = renderPaneSource.slice( + renderPaneSource.indexOf("activeToolCenterPane.key === 'schema-compare'"), + renderPaneSource.indexOf("if (activeToolCenterPane.key === 'drivers')"), + ); + const driverSource = renderPaneSource.slice( + renderPaneSource.indexOf("if (activeToolCenterPane.key === 'drivers')"), + renderPaneSource.indexOf("if (activeToolCenterPane.key === 'snippet-settings')"), + ); + const snippetSource = renderPaneSource.slice( + renderPaneSource.indexOf("if (activeToolCenterPane.key === 'snippet-settings')"), + renderPaneSource.indexOf("if (activeToolCenterPane.key === 'shortcut-settings')"), + ); + const shortcutSource = renderPaneSource.slice( + renderPaneSource.indexOf("if (activeToolCenterPane.key === 'shortcut-settings')"), + renderPaneSource.indexOf('return null;', renderPaneSource.indexOf("if (activeToolCenterPane.key === 'shortcut-settings')")), + ); + + expect(appSource).toContain('activeToolCenterPaneItem?.title ?? activeToolCenterGroup.title'); + expect(connectionPackageSource).toContain(' { expect(appSource).toContain('onToggleAI={toggleAIPanel}'); expect(appSource).toContain('renderLegacyAIEdgeHandle'); diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 52d17a8..7221d62 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -3401,11 +3401,8 @@ function App() { , - t('app.data_root.title'), - t('app.data_root.description'), - )} + title={null} + closable={false} onCancel={closeToolCenterPane} footer={[