diff --git a/B05_Profile/B05_Profile_UI_Structures_Groups.ts b/B05_Profile/B05_Profile_UI_Structures_Groups.ts index c4f75cb0d..1f7fce79d 100644 --- a/B05_Profile/B05_Profile_UI_Structures_Groups.ts +++ b/B05_Profile/B05_Profile_UI_Structures_Groups.ts @@ -102,8 +102,16 @@ export function createGroupBoxes(): GroupBoxes { body.className = "b05-structure__grid"; for (const scope of scopes) { const marked = [...scope.querySelectorAll("[data-option-keys]")]; - const fits = marked.filter((node) => - (node.dataset.optionKeys ?? "").split(" ").every((key) => key && keys.has(key)), + // 지금 숨은 칸(다른 시설 몫 · 안 고른 갈래)은 그 자리에 둠 — 같은 키 칸이 두 벌 옮겨 오지 않게 + const shown = (node: HTMLElement): boolean => { + for (let at: HTMLElement | null = node; at && at !== scope; at = at.parentElement) + if (at.hidden) return false; + return true; + }; + const fits = marked.filter( + (node) => + shown(node) && + (node.dataset.optionKeys ?? "").split(" ").every((key) => key && keys.has(key)), ); // 바깥 칸만 — 옮길 칸 안의 칸은 따라 옴 for (const node of fits.filter((n) => !fits.some((o) => o !== n && o.contains(n)))) { diff --git a/B05_Profile/B05_Profile_UI_Structures_Panel.ts b/B05_Profile/B05_Profile_UI_Structures_Panel.ts index 7989e539c..149903454 100644 --- a/B05_Profile/B05_Profile_UI_Structures_Panel.ts +++ b/B05_Profile/B05_Profile_UI_Structures_Panel.ts @@ -66,7 +66,8 @@ export function createStructuresSection( // 폼 뼈대는 전용 조립기가 세운다(2026-09-03 · 700줄 제한) — 여기서는 값·검증·저장만. const form = buildStructuresForm({ getInterval: () => callbacks.getInterval(), - onFacilityChange: () => liveCommit(), + // 갈래(유입구 구조 등)가 바뀌면 보이는 칸이 달라짐 — 그룹 상자도 다시 세움(PLAN 46-3) + onFacilityChange: () => (regroup(), liveCommit()), }); const { root,