From 9192948fffe8be075d971e732ab48eb6bbb84a30 Mon Sep 17 00:00:00 2001 From: umsangdon Date: Thu, 8 Oct 2026 20:03:17 +0900 Subject: [PATCH] =?UTF-8?q?feat(B08):=20=EC=88=98=EB=A6=AC=20=ED=8C=90?= =?UTF-8?q?=EC=A0=95=20=EA=B8=80=EC=9E=90=EC=83=89=20=E2=80=94=20O=20K=20?= =?UTF-8?q?=EC=B4=88=EB=A1=9D=20=C2=B7=20N=20G=20=EB=B6=89=EC=9D=8C=20?= =?UTF-8?q?=C2=B7=20=ED=8C=90=EC=A0=95=20=EC=97=86=EC=9D=8C=20=EA=B8=B0?= =?UTF-8?q?=EB=B3=B8=20=EA=B8=80=20=C2=B7=20=EB=B0=B0=EA=B2=BD=20=EC=B9=A0?= =?UTF-8?q?=20=EC=97=86=EC=95=B0(132-1)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01BVPp2o6Mh2FZJr72yW3ofZ --- B08_Quantity/B08_Quantity_UI_Hydro.css | 17 +++++--- B08_Quantity/B08_Quantity_UI_Hydro_Sheet.ts | 6 ++- .../test_132_b08_hydro_verdict_color.py | 43 +++++++++++++++++++ 3 files changed, 57 insertions(+), 9 deletions(-) create mode 100644 resources/tester/test_132_b08_hydro_verdict_color.py diff --git a/B08_Quantity/B08_Quantity_UI_Hydro.css b/B08_Quantity/B08_Quantity_UI_Hydro.css index 0619750ab..01a53d34a 100644 --- a/B08_Quantity/B08_Quantity_UI_Hydro.css +++ b/B08_Quantity/B08_Quantity_UI_Hydro.css @@ -143,13 +143,21 @@ width: 112px; } -/* 중요 결과 — Qd · 유출량 · 판정 · 유출율 */ +/* 중요 결과 — Qd · 유출량 · 판정 · 유출율 · 글자색은 판정 따라(O K 초록 · N G 붉음 · 없으면 기본) */ .is-key.b08-hydro__out, .is-key.b08-hydro__verdict { - color: var(--color-danger); + color: var(--color-text-body); font-weight: var(--font-weight-bold); } +.b08-hydro__sheet.is-ok .is-key { + color: var(--color-success); +} + +.b08-hydro__sheet.is-ng .is-key { + color: var(--color-danger); +} + .b08-hydro__figure { display: grid; grid-template-columns: minmax(0, 1fr); @@ -197,11 +205,6 @@ text-align: center; } -.b08-hydro__verdict.is-ng { - background: color-mix(in srgb, var(--color-danger) 12%, transparent); - border-radius: var(--radius-lg); -} - .b08-hydro__status { margin: var(--spacing-8) 0 0; color: var(--color-danger); diff --git a/B08_Quantity/B08_Quantity_UI_Hydro_Sheet.ts b/B08_Quantity/B08_Quantity_UI_Hydro_Sheet.ts index a1d5ee66e..bc0e84a06 100644 --- a/B08_Quantity/B08_Quantity_UI_Hydro_Sheet.ts +++ b/B08_Quantity/B08_Quantity_UI_Hydro_Sheet.ts @@ -6,7 +6,8 @@ * 오른쪽 카드 「2. 단면 검토」 관 단면 그림 · 단면적 · 윤변 · 경심 · 경사 · n · 유속 · 유출량 · 판정 * 장(sheet) 갈래 — 박스 = 사각 내공 B · H · 수심비(73-11) · 세월교 · 물넘이 = 월류 폭 → 월류 높이(73-12) * 테두리는 입력 · 선택 칸만(공용 ui-input · ui-select) · 계산 칸은 글자만 - * 굵게 + 붉은 계열은 중요 결과(Qd · 유출량 · 판정 · 유출율)만 · 빈칸에 기대는 계산 칸은 「-」. + * 굵게는 중요 결과(Qd · 유출량 · 판정 · 유출율)만 · 글자색은 판정 따라 O K 초록 · N G 붉음(132-1) + * · 빈칸에 기대는 계산 칸은 「-」. * 연결값과 같은 칸은 이름 옆 작은 원천 표 — 「B05」(풍선 「B05 분석」) · 하상경사는 「B06」 * (풍선 「B06 횡단 경사」 · 110) · Qd · T 옆에 B05 값 참고(96-2). * @@ -547,7 +548,8 @@ export function buildHydroSheet( set("ratio_pct", fmt(r?.ratio_pct, 0)); const judged = r != null && r.ok != null; verdict.classList.toggle("is-key", judged); - verdict.classList.toggle("is-ng", judged && !r.ok); + sheet.classList.toggle("is-ok", judged && r.ok === true); + sheet.classList.toggle("is-ng", judged && !r.ok); verdict.textContent = judged ? `${fmt(r.capacity, 3)} ㎥/s ${r.ok ? "≥" : "<"} Qd ${fmt(r.design_flow, 2)} ㎥/s — ${r.ok ? "O K" : "N G"}` : `판정 ${DASH}`; diff --git a/resources/tester/test_132_b08_hydro_verdict_color.py b/resources/tester/test_132_b08_hydro_verdict_color.py new file mode 100644 index 000000000..5ee50e3ce --- /dev/null +++ b/resources/tester/test_132_b08_hydro_verdict_color.py @@ -0,0 +1,43 @@ +"""B08 수리 판정 글자색 (PLAN 132-1). + +O K = 초록 글(success) · N G = 붉은 글(danger) · 판정 없음 = 기본 글 · 배경 칠 없음. +""" + +from __future__ import annotations + +import re +from pathlib import Path + +ROOT = Path(__file__).resolve().parents[2] +CSS = (ROOT / "B08_Quantity" / "B08_Quantity_UI_Hydro.css").read_text(encoding="utf-8") +TS = (ROOT / "B08_Quantity" / "B08_Quantity_UI_Hydro_Sheet.ts").read_text(encoding="utf-8") + + +def rule(selector: str) -> str: + match = re.search(re.escape(selector) + r"\s*\{([^}]*)\}", CSS) + assert match, selector + return match.group(1) + + +def test_OK_는_success_글() -> None: + assert "color: var(--color-success)" in rule(".b08-hydro__sheet.is-ok .is-key") + + +def test_NG_는_danger_글() -> None: + assert "color: var(--color-danger)" in rule(".b08-hydro__sheet.is-ng .is-key") + + +def test_판정_없음은_기본_글() -> None: + body = rule(".is-key.b08-hydro__out,\n.is-key.b08-hydro__verdict") + assert "color: var(--color-text-body)" in body + assert "--color-danger" not in body + + +def test_배경_칠_없음() -> None: + assert ".b08-hydro__verdict.is-ng" not in CSS + assert "background" not in rule(".b08-hydro__sheet.is-ng .is-key") + + +def test_판정이_장에_칠_갈래를_붙임() -> None: + assert 'sheet.classList.toggle("is-ok", judged && r.ok === true)' in TS + assert 'sheet.classList.toggle("is-ng", judged && !r.ok)' in TS