feat(B05): 구조물 목록 항목 양식 — 측점 좌측·이름 우측, 그 외 정보 삭제

한 항목 = [측점(좌측 맞춤)][구조물 이름(우측 맞춤)]. 메모·"배수유역 연동" 등
부가 표기는 지운다(2026-08-18 사용자 지시).

- labelOfStructure/labelOfPipe("측점 · 이름" 결합 문자열) 폐지 —
  측점 표기만 stationOfStructure로 남기고 이름은 렌더에서 따로 그린다.
- 이름 span: margin-left:auto + text-align:right, 주 정보가 되었으므로
  본문색으로 승격(기존 muted 캡션은 메모용이었다).

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-08-18 17:29:11 +09:00
co-authored by Claude Opus 5
parent a3382212ea
commit d192343012
2 changed files with 19 additions and 31 deletions
+14 -30
View File
@@ -33,29 +33,11 @@ export interface StructureListParams {
onSelectPipe: (pipe: PipeFacilityItem) => void;
}
/** 구조물 한 건의 표시 이름 — 점형은 기준 측점, 구간형은 시작~종료 측점. */
export function labelOfStructure(
structure: StructureInstance,
typeMap: Map<string, StructureType>,
intervalM: number,
): string {
const name = typeMap.get(structure.type_id)?.name ?? structure.type_id;
const position =
structure.placement === "interval"
? `${formatStation(structure.start_m ?? 0, intervalM)}~${formatStation(structure.end_m ?? 0, intervalM)}`
: formatStation(structure.chainage_m ?? 0, intervalM);
return `${position} · ${name}`;
}
/** 계곡 통과 시설 한 건의 표시 이름 — 점형이라 기준 측점 하나로 적는다
* (2026-08-17 사용자 지시 2). */
export function labelOfPipe(
pipe: PipeFacilityItem,
typeMap: Map<string, StructureType>,
intervalM: number,
): string {
const name = typeMap.get(pipe.facility)?.name ?? pipe.facility;
return `${formatStation(pipe.chainage_m, intervalM)} · ${name}`;
/** 구조물 한 건의 측점 표기 — 점형은 기준 측점, 구간형은 시작~종료 측점. */
export function stationOfStructure(structure: StructureInstance, intervalM: number): string {
return structure.placement === "interval"
? `${formatStation(structure.start_m ?? 0, intervalM)}~${formatStation(structure.end_m ?? 0, intervalM)}`
: formatStation(structure.chainage_m ?? 0, intervalM);
}
export function renderStructureList(params: StructureListParams): void {
@@ -85,16 +67,18 @@ export function renderStructureList(params: StructureListParams): void {
list.append(empty);
return;
}
// 한 항목 = [측점(좌측 맞춤)][구조물 이름(우측 맞춤)] — 메모·연동 표기 등 그 외
// 정보는 적지 않는다(2026-08-18 사용자 지시).
rows.forEach((row) => {
const item = document.createElement("li");
item.className = "b05-route__irregular-item";
const name = document.createElement("strong");
const info = document.createElement("span");
const station = document.createElement("strong");
const name = document.createElement("span");
if (row.kind === "structure") {
const { structure } = row;
item.classList.toggle("is-selected", structure.structure_id === editingId);
name.textContent = labelOfStructure(structure, typeMap, intervalM);
info.textContent = structure.memo ?? "";
station.textContent = stationOfStructure(structure, intervalM);
name.textContent = typeMap.get(structure.type_id)?.name ?? structure.type_id;
item.addEventListener("click", () => params.onSelectStructure(structure));
if (structure.structure_id === editingId) item.scrollIntoView({ block: "nearest" });
} else {
@@ -103,11 +87,11 @@ export function renderStructureList(params: StructureListParams): void {
"is-selected",
selectedPipeChainage !== null && Math.abs(selectedPipeChainage - pipe.chainage_m) < 0.05,
);
name.textContent = labelOfPipe(pipe, typeMap, intervalM);
info.textContent = "배수유역 연동";
station.textContent = formatStation(pipe.chainage_m, intervalM);
name.textContent = typeMap.get(pipe.facility)?.name ?? pipe.facility;
item.addEventListener("click", () => params.onSelectPipe(pipe));
}
item.append(name, info);
item.append(station, name);
list.append(item);
});
}
+5 -1
View File
@@ -362,10 +362,14 @@
font-variant-numeric: tabular-nums;
}
/* 항목 = [측점(좌측)][구조물 이름(우측)] — 이름이 주 정보라 본문색, 남는 폭은
왼쪽 마진이 먹어 오른쪽 끝에 붙는다(2026-08-18 사용자 지시). */
.b05-route__irregular-item span {
overflow: hidden;
color: var(--color-text-muted);
margin-left: auto;
color: var(--color-text);
font-size: var(--text-caption);
text-align: right;
text-overflow: ellipsis;
white-space: nowrap;
}