feat(B08): 수리 판정 글자색 — O K 초록 · N G 붉음 · 판정 없음 기본 글 · 배경 칠 없앰(132-1)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BVPp2o6Mh2FZJr72yW3ofZ
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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}`;
|
||||
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user