fix(B05): 46-5 옵션 그룹 상자 — 숨은 칸은 안 옮김 · 시설 갈래가 바뀌면 다시 세움

- 화면 검증에서 찾음: 숨어 있던 독립 기슭막이 칸(같은 키)까지 상자로 옮겨 두 벌로 보임
- 숨은 조상이 있는 칸은 제자리 · 유입구 구조 등 시설 칸이 바뀌면 그룹 상자도 다시 세움

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MPcuokNm1ZR2kqgGGDfaJA
This commit is contained in:
2026-10-05 14:03:19 +09:00
co-authored by Claude Opus 5.5
parent 79ca220823
commit 322cd150cc
2 changed files with 12 additions and 3 deletions
@@ -102,8 +102,16 @@ export function createGroupBoxes(): GroupBoxes {
body.className = "b05-structure__grid";
for (const scope of scopes) {
const marked = [...scope.querySelectorAll<HTMLElement>("[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)))) {
@@ -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,