fix(476-2 추천 초기 종단): 초기 종단 한 줄 = 알림 N건 · 알림 글은 마우스 올림
화면 확인(검증_sub1) 알림 37~94건이 한 줄에 다 붙어 줄이 넘침. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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")}㎥`;
|
||||
|
||||
@@ -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]] }),
|
||||
}),
|
||||
);
|
||||
|
||||
@@ -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("초기 종단을 셈하지 못했습니다 — 지반고 종단")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user