From 318507c88d0eeb59faf38e262d62464cf7f548f8 Mon Sep 17 00:00:00 2001 From: umsangdon Date: Sun, 6 Sep 2026 23:58:53 +0900 Subject: [PATCH] =?UTF-8?q?fix(B05,B06):=20=EC=A2=85=EB=8B=A8=20=EC=95=8C?= =?UTF-8?q?=EC=95=BD=EC=9C=BC=EB=A1=9C=20=EA=B3=A0=EB=A5=B8=20=EA=B5=AC?= =?UTF-8?q?=EC=A1=B0=EB=AC=BC=EC=9D=B4=20B06=20=ED=9A=A1=EB=8B=A8=EB=8F=84?= =?UTF-8?q?=EC=97=90=20=EC=95=88=20=EC=9E=A1=ED=9E=88=EB=8D=98=20=EA=B2=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 계획서 2-2. 3D 픽·사이드 목록에는 structure-pick 기록이 있는데 종단 그래프 알약 경로에만 빠져 있었음 — 세션 키가 아예 안 써져 B06 이 잡을 값이 없었음(보조 창 추적). - 구조물 브리지에 markChainage 추가 — 알약 id 의 누가거리를 구조물 정본·관 정본 양쪽에서 되읽음. - Page 의 onStructureSelect 가 writeStructurePick 으로 그 자리를 남김(사이드 목록 경로와 같은 창구). 자체검증(공용 브라우저, 용화) — 알약 18개 중 셋을 눌러 세션 키가 찰쌓기 1 -> {at:40} · 찰쌓기 3 -> {at:80} · 옹벽 -> {at:120} 으로 써짐(전에는 null). 그 상태로 B06 진입 시 측점 6+0.0(120m) 카드가 선택된 채로 뜸. typecheck 통과. Co-Authored-By: Claude Opus 5 (1M context) --- B05_Profile/B05_Profile_UI_Page.ts | 3 +++ B05_Profile/B05_Profile_UI_Page_Structures.ts | 15 +++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/B05_Profile/B05_Profile_UI_Page.ts b/B05_Profile/B05_Profile_UI_Page.ts index 2420d947..a841c47a 100644 --- a/B05_Profile/B05_Profile_UI_Page.ts +++ b/B05_Profile/B05_Profile_UI_Page.ts @@ -151,6 +151,9 @@ export async function renderB05Route(root: HTMLElement): Promise { // 구조물 알약 — 그래프에서 고르면 사이드 폼도 같은 항목을 연다. 계곡 통과 시설 // (가상 id `pipe-*`)은 관 정본 소관이라 누가거리로 되돌려 보낸다(2026-08-17). onStructureSelect: (structureId) => { + // 고른 자리를 B06 으로 넘긴다 — 사이드 목록·3D 픽에는 있던 기록이 **알약에만 + // 빠져 있어** 종단에서 고른 구조물이 B06 횡단도에서 안 잡혔다(2026-09-06). + writeStructurePick(activeProjectId, bridge.markChainage(structureId)); const chainage = bridge.pipeMarkChainage(structureId); if (chainage !== null) { panel.structures.selectPipeByChainage(chainage); diff --git a/B05_Profile/B05_Profile_UI_Page_Structures.ts b/B05_Profile/B05_Profile_UI_Page_Structures.ts index efb7662f..30407218 100644 --- a/B05_Profile/B05_Profile_UI_Page_Structures.ts +++ b/B05_Profile/B05_Profile_UI_Page_Structures.ts @@ -157,6 +157,19 @@ export function createStructuresBridge(deps: StructuresBridgeDeps) { applyIrregularStations([...pipeStations, ...crossDrainStationsOf(ownStructures)]); } + /** 알약 id의 누가거리 — 구조물이면 정본에서, 관이면 id 에서 되읽는다(없으면 null). + * 3D·사이드 목록과 마찬가지로 **종단 알약 선택도 B06 으로 이어져야** 해서 둔다 + * (2026-09-06: 알약만 `structure-pick` 을 안 써 B06 이 못 잡았음). */ + function markChainage(structureId: string | null): number | null { + if (!structureId) return null; + const pipe = pipeMarkChainage(structureId); + if (pipe !== null) return pipe; + const found = ownStructures.find((item) => item.structure_id === structureId); + if (!found) return null; + const chainage = found.chainage_m ?? found.start_m ?? null; + return typeof chainage === "number" && Number.isFinite(chainage) ? chainage : null; + } + /** 알약 id가 계곡 통과 시설(관 정본)이면 그 누가거리, 아니면 null. */ function pipeMarkChainage(structureId: string | null): number | null { if (!structureId?.startsWith("pipe-")) return null; @@ -345,6 +358,8 @@ export function createStructuresBridge(deps: StructuresBridgeDeps) { clearProjectedStations, /** 알약 식별자에서 관 누가거리를 되읽는다(관이 아니면 null). */ pipeMarkChainage, + /** 알약 식별자의 누가거리(구조물·관 공통). B06 으로 넘길 선택값을 만들 때 쓴다. */ + markChainage, /** 사이드 목록이 바뀜 — 화면을 맞추고 서버 정본에 저장한다. */ applyStructures, saveStructuresIfDirty,