Files
GhiVideo_v4/docs/history/2026-06-24_2032_스테이션바시종점-routejson-name분리.md
b23042andClaude Fable 5 d38b842e8d GhiVideo 소스 복제 — v4 작업 시작 기준
기존 GhiVideo 저장소 HEAD의 트래킹 소스 362개 파일을 복제.
(node_modules·storage·빌드 산출물·대용량 미디어는 .gitignore 규칙대로 제외)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-09 14:32:51 +09:00

36 lines
1.7 KiB
Markdown

# 스테이션바 시/종점 역명 = route.json name 의 '-' 좌/우 + 좌상단 타이틀 routeInfo 매핑 확인
**날짜**: 2026-06-24
**수정 파일**: `client/src/stationbar/StationBar.tsx`
## 요구
1. 스테이션바 시작은 측점값(157K900 등)이 아니라 route.json `name`("회덕-대전조차장")의 '-' **왼쪽=회덕**,
끝은 **오른쪽=대전조차장**.
2. 좌측 상단 타이틀은 각 항목에 맞는 routeInfo 변수로.
## 조치
### 1) 시/종점 역명 = name '-' 분리 (StationBar)
```ts
const nm = routeMeta?.routeInfo?.name ?? ''; // "회덕-대전조차장"
const dash = nm.indexOf('-');
const leftName = dash >= 0 ? nm.slice(0, dash).trim() : ''; // 회덕
const rightName = dash >= 0 ? nm.slice(dash + 1).trim() : ''; // 대전조차장
startStationName: leftName || routeInfo.startStationName || 측점첫;
endStationName: rightName || routeInfo.endStationName || 측점끝;
```
- name 분리값 우선(요구). 없으면 startStationName/endStationName → 측점 첫/끝 폴백.
### 2) 좌상단 타이틀 (변경 없음 — 이미 매핑)
`RouteInfoOverlay` 가 이미 routeInfo 각 변수를 매핑: 방향=direction, 노선명=name, 연장=lengthKm,
소요=durationSec. route.json 만 폴더에 있으면 표출됨 → 추가 작업 불필요.
## 확인
- 폴더의 `하행)회덕-대전조차장.route.json` 은 UTF-8 정상. `parseRouteMeta`(file.text, base.route.json 매칭)로 로드.
- name="회덕-대전조차장", direction="하 행", lengthKm=4.25, durationSec=672(=11분12초).
## 검증
- `npm run build -w client` (node20) tsc + vite build 통과.
**소요 시간**: 약 10분
**Context 사용량**: input ~1350k / output ~5k tokens