fix(flushing): 收紧空阀门区域高度
Generic Container CI/CD / test-build-publish (push) Successful in 1m1s
Frontend CI/CD v2 / build-test-publish-and-deploy (push) Successful in 1m1s

This commit is contained in:
2026-08-17 19:44:11 +08:00
parent f34d81c933
commit 6d505ca461
3 changed files with 22 additions and 1 deletions
@@ -53,6 +53,7 @@ import {
VALVE_STATUS_OPTIONS, VALVE_STATUS_OPTIONS,
validateValveSetting, validateValveSetting,
} from "@components/olmap/core/Controls/valveControl"; } from "@components/olmap/core/Controls/valveControl";
import { getValveListClassName } from "./analysisParametersLayout";
export interface ValveItem { export interface ValveItem {
id: string; id: string;
@@ -582,7 +583,10 @@ const AnalysisParameters: React.FC<AnalysisParametersProps> = ({
💡 💡
</Box> </Box>
)} )}
<Stack spacing={1} className="max-h-50 h-48 overflow-auto"> <Stack
spacing={1}
className={getValveListClassName(valves.length)}
>
{valves.map((valve) => { {valves.map((valve) => {
const settingValidation = const settingValidation =
valve.status === "ACTIVE" valve.status === "ACTIVE"
@@ -0,0 +1,13 @@
import { getValveListClassName } from "./analysisParametersLayout";
describe("getValveListClassName", () => {
it("uses compact height when no valves are selected", () => {
expect(getValveListClassName(0)).toBe("min-h-16 overflow-auto");
});
it("restores the fixed scroll region when valves are selected", () => {
expect(getValveListClassName(1)).toBe(
"max-h-50 h-48 overflow-auto",
);
});
});
@@ -0,0 +1,4 @@
export const getValveListClassName = (valveCount: number): string =>
valveCount > 0
? "max-h-50 h-48 overflow-auto"
: "min-h-16 overflow-auto";