diff --git a/B05_Profile/B05_Profile_UI_Structures_Panel_Types.ts b/B05_Profile/B05_Profile_UI_Structures_Panel_Types.ts index 36db77ddf..2e4734543 100644 --- a/B05_Profile/B05_Profile_UI_Structures_Panel_Types.ts +++ b/B05_Profile/B05_Profile_UI_Structures_Panel_Types.ts @@ -100,6 +100,8 @@ export const DEFAULT_INTERVAL_LENGTH_M = 15; /** 계곡 통과 시설 1건 — 관 지점 정본에서 온 병합 표시·폼 편집용 항목. */ export interface PipeFacilityItem { + /** 관 고정 id(측점 열쇠 `pipe:` · 옮겨도 그대로 — 초안에 안 실으면 옮긴 측점이 앞 설계를 잃음 · 445 H2). */ + id?: string | null; chainage_m: number; facility: PipeFacility; start_m?: number; diff --git a/B06_Section/B06_Section_UI_Page_Structures_Panel.ts b/B06_Section/B06_Section_UI_Page_Structures_Panel.ts index 42d898bde..eef1873f8 100644 --- a/B06_Section/B06_Section_UI_Page_Structures_Panel.ts +++ b/B06_Section/B06_Section_UI_Page_Structures_Panel.ts @@ -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:` — 초안까지 들고 감(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, diff --git a/resources/tester/test_445_save_patch.py b/resources/tester/test_445_save_patch.py index 5efa33002..c95e83dc8 100644 --- a/resources/tester/test_445_save_patch.py +++ b/resources/tester/test_445_save_patch.py @@ -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]