优化终端侧边栏展开性能

This commit is contained in:
2569718930@qq.com
2026-06-01 16:15:20 +08:00
parent 2fd8027a41
commit f1e577ea8a
2 changed files with 110 additions and 89 deletions
@@ -165,6 +165,13 @@ export function runTests() {
chartCanvasSource.includes("TemperatureChartCanvasComponent"),
"temperature chart canvas must be memoized so unrelated terminal state does not remount Recharts",
);
assert(
dashboardSource.includes("const TerminalSidebar = memo(function TerminalSidebar") &&
dashboardSource.includes("const [navExpanded, setNavExpanded] = useState(false);") &&
dashboardSource.includes("transition-colors duration-150") &&
!dashboardSource.includes("transition-all duration-200"),
"terminal sidebar expand state must be isolated from the chart grid and must not animate width through transition-all",
);
assert(
__shouldKeepTemperatureChartLoadingForTest({
row: { city: "Moscow" } as any,