fix(ui)旧版UI左侧列表无法通过鼠标扩大问题修复

This commit is contained in:
Arthur
2026-06-11 16:04:04 +08:00
parent c9053bccc5
commit 5fc0a6504a
2 changed files with 14 additions and 0 deletions

View File

@@ -685,3 +685,9 @@ body[data-theme='dark'] .gonavi-query-editor-column-token {
body[data-theme='dark'] .gonavi-query-editor-db-token {
color: #c4b5fd;
}
/* Legacy sidebar resize bounds — mirror v2 .gn-v2-app-sider so Ant Design inline width locks do not collapse drag range. */
body[data-ui-version="legacy"] .ant-layout-sider {
min-width: 232px !important;
max-width: 420px !important;
}

View File

@@ -6,6 +6,10 @@ const appSource = readFileSync(
fileURLToPath(new globalThis.URL('./App.tsx', import.meta.url)),
'utf8',
);
const appCss = readFileSync(
fileURLToPath(new globalThis.URL('./App.css', import.meta.url)),
'utf8',
);
const linuxCJKFontBannerSource = readFileSync(
fileURLToPath(new globalThis.URL('./components/LinuxCJKFontBanner.tsx', import.meta.url)),
'utf8',
@@ -116,6 +120,10 @@ describe('tool center menu entries', () => {
expect(appSource).toContain('ghostRef.current.style.left = `${startGuideLeft + (newWidth - startWidth)}px`;');
});
it('keeps legacy sidebar resize bounds aligned with the v2 sider CSS limits', () => {
expect(appCss).toMatch(/body\[data-ui-version="legacy"\]\s+\.ant-layout-sider\s*\{[^}]*min-width:\s*232px\s*!important;[^}]*max-width:\s*420px\s*!important;/s);
});
it('keeps connection modal warm-mounted while leaving the other heavyweight modals conditional', () => {
expect(appSource).toContain('const [isConnectionModalMounted, setIsConnectionModalMounted] = useState(false);');
expect(appSource).toContain('{isConnectionModalMounted && (');