diff --git a/B05_Profile/B05_Profile_UI_RouteEdit_Recommend.ts b/B05_Profile/B05_Profile_UI_RouteEdit_Recommend.ts index 23cca6df3..1c8cf5d97 100644 --- a/B05_Profile/B05_Profile_UI_RouteEdit_Recommend.ts +++ b/B05_Profile/B05_Profile_UI_RouteEdit_Recommend.ts @@ -441,6 +441,7 @@ export function openRecommendModal(params: RecommendParams): void { const initial = view?.initialProfile ?? null; const initialShape = initial && !("error" in initial) ? initial : null; line("initial").textContent = initialLine(initial); + line("initial").title = initialShape?.warnings.join("\n") ?? ""; line("initial").classList.toggle("is-warn", !!initial && "error" in initial); line("initial").hidden = !initial; const svg = profileSvg(balance, initialShape); diff --git a/B05_Profile/B05_Profile_UI_RouteEdit_Recommend_Profile.ts b/B05_Profile/B05_Profile_UI_RouteEdit_Recommend_Profile.ts index 3ab830d7c..b96c4cf5e 100644 --- a/B05_Profile/B05_Profile_UI_RouteEdit_Recommend_Profile.ts +++ b/B05_Profile/B05_Profile_UI_RouteEdit_Recommend_Profile.ts @@ -113,7 +113,8 @@ export function parseInitialProfile(raw: unknown): InitialProfile | { error: str }; } -/** 한 줄 — 「초기 종단: 꼭짓점 12 · 종단곡선 10 · 직선화 3 · 최대 종단경사 11.2%(L 20)」 · 실패면 이유. */ +/** 한 줄 — 「초기 종단: 꼭짓점 12 · 종단곡선 10 · 직선화 3 · 최대 종단경사 11.2%(L 20) · 알림 2건」 · + * 실패면 이유. 알림 글은 줄 title(`initialProfile.warnings`). */ export function initialLine(initial: InitialProfile | { error: string } | null): string { if (!initial) return ""; if ("error" in initial) return `초기 종단을 셈하지 못했습니다 — ${initial.error}`; @@ -124,7 +125,8 @@ export function initialLine(initial: InitialProfile | { error: string } | null): initial.curveLengthM !== null ? `(L ${initial.curveLengthM})` : "" }`, ]; - return [parts.join(" · "), ...initial.warnings].join(" · "); + if (initial.warnings.length) parts.push(`알림 ${initial.warnings.length}건`); + return parts.join(" · "); } const m3 = (value: number): string => `${Math.round(value).toLocaleString("ko-KR")}㎥`; diff --git a/resources/tester/helper_476_2_initial_profile.cjs b/resources/tester/helper_476_2_initial_profile.cjs index 0c6a48967..74dc83276 100644 --- a/resources/tester/helper_476_2_initial_profile.cjs +++ b/resources/tester/helper_476_2_initial_profile.cjs @@ -107,6 +107,7 @@ process.stdout.write( failedLine: prof.initialLine(failed.initialProfile), missing: model.normalizeRouteInitial({ ...answer, initial_profile: undefined }, "follow", null) .initialProfile, + warnLine: prof.initialLine(prof.parseInitialProfile({ ...initialRaw, warnings: ["a", "b"] })), shortLine: prof.parseInitialProfile({ ...initialRaw, line: [[0, 100]] }), }), ); diff --git a/resources/tester/test_476_2_recommend_initial_line.py b/resources/tester/test_476_2_recommend_initial_line.py index c8fe799e1..e858c9277 100644 --- a/resources/tester/test_476_2_recommend_initial_line.py +++ b/resources/tester/test_476_2_recommend_initial_line.py @@ -34,6 +34,7 @@ def test_펴기와_캐시_빼기() -> None: def test_한_줄과_실패_글() -> None: out = _out() assert out["line"] == "초기 종단: 꼭짓점 3 · 종단곡선 1 · 직선화 2 · 최대 종단경사 10.0%(L 20)" + assert out["warnLine"].endswith("(L 20) · 알림 2건") # 알림 글은 title assert out["failed"] == {"error": "지반고 종단 — 측점이 모자랍니다"} assert out["failedLine"].startswith("초기 종단을 셈하지 못했습니다 — 지반고 종단")