From b908a0b10d15b229a64d8e06e9e4acfa077b8d6c Mon Sep 17 00:00:00 2001 From: umsangdon Date: Thu, 3 Sep 2026 19:35:21 +0900 Subject: [PATCH] =?UTF-8?q?feat(B06):=20=EC=A2=85=EB=8B=A8=EB=A9=B4?= =?UTF-8?q?=EB=8F=84=20=EA=B5=AC=EC=A1=B0=EB=AC=BC=20=EB=9D=BC=EB=B2=A8?= =?UTF-8?q?=EB=8F=84=20=EB=B0=B0=EC=88=98=EA=B4=80=20=ED=91=9C=EA=B8=B0?= =?UTF-8?q?=EB=A1=9C=20=ED=86=B5=EC=9D=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 관종·관경(`파형강관 D1200`) 대신 `배수관` 을 적음 — 횡단 카드와 같은 규칙. 판정을 `structureDisplayName()`(`_UI_Section_Common`) 한 곳으로 모아 두 렌더러가 같은 문자열을 쓰게 함. 저장 라벨은 그대로 — 재진입 이관이 라벨로 종류를 되짚음. Co-Authored-By: Claude Opus 5 (1M context) --- B06_Section/B06_Section_UI_Cross_Card_Chrome.ts | 15 ++++++++------- B06_Section/B06_Section_UI_Longitudinal.ts | 4 +++- B06_Section/B06_Section_UI_Section_Common.ts | 13 +++++++++++++ 3 files changed, 24 insertions(+), 8 deletions(-) diff --git a/B06_Section/B06_Section_UI_Cross_Card_Chrome.ts b/B06_Section/B06_Section_UI_Cross_Card_Chrome.ts index a8300581..d7cd8c5c 100644 --- a/B06_Section/B06_Section_UI_Cross_Card_Chrome.ts +++ b/B06_Section/B06_Section_UI_Cross_Card_Chrome.ts @@ -6,8 +6,6 @@ * 만든다. 여기 있는 것은 전부 **읽어서 붙이는 값**이라 카드 상태(줌·선택)를 건드리지 않는다. * ========================================================================== */ -import { PIPE_TYPES } from "@config/config_frontend"; -import { PIPE_DISPLAY_NAME } from "../B05_Profile/B05_Profile_UI_IrregularStations"; import type { CrossSection } from "./B06_Section_Api_Fetch"; import type { RockBoundaryControl } from "./B06_Section_UI_Cross_Design"; import { @@ -16,7 +14,12 @@ import { sectionModeLabel, } from "./B06_Section_UI_Cross_Design"; import { type FillSlopeLength, fillSlopeLengths } from "./B06_Section_UI_Cross_Fit"; -import { type DesignChangeHandler, L, stationLabel } from "./B06_Section_UI_Section_Common"; +import { + type DesignChangeHandler, + L, + stationLabel, + structureDisplayName, +} from "./B06_Section_UI_Section_Common"; /** * 성토사면 경사길이 표기 칸 — 성토측이 없으면 null. @@ -87,10 +90,8 @@ export function appendCardHeader( const structure = document.createElement("span"); structure.className = "b06-cross-card__structure"; // 배수관은 관종·관경(`파형강관 D1200`)이 아니라 표시 이름 하나로 적는다 - // (2026-09-03 사용자 지시 — 2026-08-17 확정한 `PIPE_DISPLAY_NAME` 규칙과 같다). - // 관종·관경은 툴팁에 남긴다. - const isPipe = PIPE_TYPES.some((kind) => structureName.startsWith(`${kind} D`)); - structure.textContent = isPipe ? PIPE_DISPLAY_NAME : structureName; + // (2026-09-03 사용자 지시). 관종·관경은 툴팁에 남긴다. + structure.textContent = structureDisplayName(structureName); structure.title = `구조물: ${structureName}`; meta.append(structure); } diff --git a/B06_Section/B06_Section_UI_Longitudinal.ts b/B06_Section/B06_Section_UI_Longitudinal.ts index 5cccae88..0db4f492 100644 --- a/B06_Section/B06_Section_UI_Longitudinal.ts +++ b/B06_Section/B06_Section_UI_Longitudinal.ts @@ -17,6 +17,7 @@ import { longitudinalMaxChainage, niceTickStep, stationLabel, + structureDisplayName, svgElement, svgText, validElevation, @@ -327,7 +328,8 @@ export function createLongitudinalProfile( // 이미 쓰고 있어 서로 겹쳤다(2026-08-02 사용자 지시). if (station.structure) { structureLabels.push( - svgText(station.structure, { + // 배수관은 관종·관경 대신 표시 이름 하나로 적는다(2026-09-03 — 횡단 카드와 같은 규칙). + svgText(structureDisplayName(station.structure), { x: stationX, y: heightPx - padBottom - 5, "text-anchor": "middle", diff --git a/B06_Section/B06_Section_UI_Section_Common.ts b/B06_Section/B06_Section_UI_Section_Common.ts index 9f8016fb..09a7c62a 100644 --- a/B06_Section/B06_Section_UI_Section_Common.ts +++ b/B06_Section/B06_Section_UI_Section_Common.ts @@ -7,6 +7,8 @@ * 이 모듈을 참조한다. 색상 하드코딩 금지 원칙은 그대로이며 여기서는 지오메트리 계산만 다룬다. * ========================================================================== */ +import { PIPE_TYPES } from "@config/config_frontend"; +import { PIPE_DISPLAY_NAME } from "../B05_Profile/B05_Profile_UI_IrregularStations"; import type { CrossDesignChange } from "./B06_Section_UI_Cross_Design"; import type { DesignProfile, @@ -56,6 +58,17 @@ export interface YScaleOptions { globalMaxElevation: number; } +/** + * 구조물 라벨의 **표시 이름** — 배수관은 관종·관경(`파형강관 D1200`) 대신 `배수관` 하나로 + * 적는다(2026-08-17 확정한 `PIPE_DISPLAY_NAME` 규칙, 2026-09-03 종·횡단 표기에 적용). + * + * 저장 라벨은 그대로 두어야 한다 — 재진입 이관(`B05_Profile_Structures_Migration`)이 라벨 + * 문자열로 구조물 종류를 되짚는다. 그래서 바꾸는 것은 화면에 찍는 순간뿐이다. + */ +export function structureDisplayName(label: string): string { + return PIPE_TYPES.some((kind) => label.startsWith(`${kind} D`)) ? PIPE_DISPLAY_NAME : label; +} + export function validElevation( sample: SectionSample, ): sample is SectionSample & { elevation_m: number } {