fix(445 B06 관 폼): 관 초안에 관 id 실음 — 옮긴 관 측점이 앞 설계(지반 · 메모 · 조절)를 잃지 않게

- B06 구조물 패널이 관 초안을 쓸 때 id 를 빠뜨려 측점 열쇠가 pipe:<id> → pipe:pipe-<누가거리> 로 바뀜 · 갈아끼움이 앞 횡단을 못 찾아 새 기본 설계(리핑암 · 메모 없음)로 섬(화면 실측 관 351 → 356)
- PipeFacilityItem 에 id · 불러올 때 · 초안 쓸 때 실음(B05 초안과 같은 꼴)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013QyNXY2TUKXCFMwAca2APG
This commit is contained in:
2026-10-18 19:18:33 +09:00
co-authored by Claude Opus 5.5
parent 857b2d89d4
commit 48a376f211
3 changed files with 16 additions and 0 deletions
@@ -100,6 +100,8 @@ export const DEFAULT_INTERVAL_LENGTH_M = 15;
/** 계곡 통과 시설 1건 — 관 지점 정본에서 온 병합 표시·폼 편집용 항목. */
export interface PipeFacilityItem {
/** 관 고정 id(측점 열쇠 `pipe:<id>` · 옮겨도 그대로 — 초안에 안 실으면 옮긴 측점이 앞 설계를 잃음 · 445 H2). */
id?: string | null;
chainage_m: number;
facility: PipeFacility;
start_m?: number;
@@ -408,6 +408,7 @@ export function createB06StructuresPanel(deps: B06StructuresPanelDeps): B06Struc
// 이래야 B05 에서 넣고 B06 으로 넘어와도 같은 목록이 보인다(2026-09-12 사용자).
const pendingPipes = readPendingPipes(projectId);
pipeFacilities = (pendingPipes ?? pipeResponse.pipe_points).map((pipe) => ({
id: pipe.id, // 측점 열쇠 `pipe:<id>` — 초안까지 들고 감(445 H2)
chainage_m: pipe.chainage_m,
facility: pipe.facility ?? "pipe",
start_m: pipe.start_m,
@@ -496,6 +497,7 @@ export function createB06StructuresPanel(deps: B06StructuresPanelDeps): B06Struc
writePendingPipes(
deps.projectId,
pipeFacilities.map((pipe) => ({
...(pipe.id ? { id: pipe.id } : {}), // B05 초안과 같은 꼴(445 H2)
chainage_m: pipe.chainage_m,
source: pipe.source ?? "user",
facility: pipe.facility,
+12
View File
@@ -249,3 +249,15 @@ def test_H5_노선_저장_뒤_본문_M7_kindreset_옮김():
assert 'writeState("kindreset", rekey("revetx", resets), projectId)' in carry
idle = keys[keys.index("function moveIdleStates") :]
assert 'writeState("kindreset", move(resets), projectId)' in idle
def test_H2_B06_관_폼_초안이_관_id_를_실음():
"""B06 관 폼이 초안에 관 id 를 빠뜨리면 측점 열쇠가 `pipe:p…` → `pipe:pipe-356.00` 으로 바뀌어
옮긴 측점이 앞 설계(지반 · 메모 · 조절)를 잃음 — 화면 실측(관 351 → 356)."""
panel = (ROOT / "B06_Section" / "B06_Section_UI_Page_Structures_Panel.ts").read_text(
encoding="utf-8"
)
load = panel[panel.index("pipeFacilities = (pendingPipes ?? pipeResponse.pipe_points)") :]
assert "id: pipe.id" in load[:200]
persist = panel[panel.index("function persistPipes") :]
assert "...(pipe.id ? { id: pipe.id } : {})" in persist[:400]