diff --git a/B05_Profile/B05_Profile_UI_Structure_Pick_Session.ts b/B05_Profile/B05_Profile_UI_Structure_Pick_Session.ts index d19da5f3..a0214bf3 100644 --- a/B05_Profile/B05_Profile_UI_Structure_Pick_Session.ts +++ b/B05_Profile/B05_Profile_UI_Structure_Pick_Session.ts @@ -38,7 +38,12 @@ export function writeStructurePick( key?: string, ): void { if (!projectId) return; - writeState("structure-pick", at === null ? null : { at, key }, projectId); + if (at === null) return writeState("structure-pick", null, projectId); + // 부재키 없이 **측점만** 오는 길(사이드 목록·선택 동기화)이 3D 로 고른 부재키를 지웠다 + // (2026-09-05 진단). 같은 측점이면 이미 적힌 부재키를 지킨다 — 3D 로 고른 직후 선택 + // 동기화가 이 길을 타도 조정창이 그대로 열린다. + const kept = key ?? readStructurePick(projectId)?.key; + writeState("structure-pick", { at, key: kept }, projectId); } /** 세션에 남은 선택을 읽는다(지우지 않는다). 없으면 null. */ diff --git a/B06_Section/B06_Section_UI_Page.ts b/B06_Section/B06_Section_UI_Page.ts index 572bd29c..fca207d7 100644 --- a/B06_Section/B06_Section_UI_Page.ts +++ b/B06_Section/B06_Section_UI_Page.ts @@ -521,13 +521,16 @@ export async function renderB06ProfileCross(root: HTMLElement): Promise { } /** 세션에 남은 선택을 이어받는다(2026-09-04 — 두 화면이 한 페이지처럼). - * 진입당 한 번만 — 재렌더마다 다시 돌면 사용자가 옮긴 스크롤이 튄다. 관 목록이 - * 늦게 오는 몫은 패널 load()가 스스로 다시 세운다. */ - let pickRestored = false; + * **넘김값이 바뀌었을 때만** 적용한다 — 재렌더마다 다시 돌면 사용자가 옮긴 스크롤이 + * 튀고, 진입당 한 번으로 막으면 자료가 늦게 온 경우 영영 안 열린다(2026-09-06). */ + let appliedPick: string | null = null; function restoreStructurePick(): void { - if (pickRestored || !sectionDetail) return; - pickRestored = true; - applyStructurePick(readStructurePick(projectId), sectionDetail, { + if (!sectionDetail) return; + const handoff = readStructurePick(projectId); + const signature = handoff ? `${handoff.at}|${handoff.key ?? ""}` : null; + if (signature === null || signature === appliedPick) return; + appliedPick = signature; + applyStructurePick(handoff, sectionDetail, { focusStation: (stationId) => sectionView.focusStation(stationId), refreshCard: (chainageM) => sectionView.refreshCard(chainageM), revetSelect: (chainageM, key) => stationControls.revetOffset.select(chainageM, key), diff --git a/B06_Section/B06_Section_UI_Page_Structure_Pick.ts b/B06_Section/B06_Section_UI_Page_Structure_Pick.ts index 8682eac3..45f45bcb 100644 --- a/B06_Section/B06_Section_UI_Page_Structure_Pick.ts +++ b/B06_Section/B06_Section_UI_Page_Structure_Pick.ts @@ -38,8 +38,10 @@ export function applyStructurePick( targets: PickTargets, ): void { if (!handoff) return; + // 허용오차는 같은 화면의 다른 대조와 같은 0.05m 다 — 0.01m 로는 3D 가 준 누가거리가 + // 소수점 아래에서 조금만 달라도 그 측점을 못 찾고 조용히 끝났다(2026-09-05 진단). const target = detail?.cross_sections.find( - (section) => Math.abs(section.chainage_m - handoff.at) < 0.01, + (section) => Math.abs(section.chainage_m - handoff.at) < 0.05, ); if (!target) return; // 조정창은 앞칸(측 이름)만 본다 — 뒤칸은 3D 강조를 부재 하나로 좁히는 몫이다.