feat(B05,B06): 구조물 배치를 실시간 반영으로 바꾸고 이식 행·강조를 정리한다

2026-08-29 사용자 지시 3건:
1. 유입구·유출구로 옮겨 온 단 수·옵션 행을 폼 양식(라벨+한 덩어리 컨트롤)으로
   맞추고 2열 격자로 세운다.
2. 이미 고른 항목은 값이 바뀔 때마다 곧바로 반영한다([수정] 버튼 불필요).
   버튼은 visibility만 꺼 자리를 남겨 삭제·리셋의 위치·크기가 흔들리지 않게 했다.
   정본 주입이 되먹임으로 돌아와도 편집 중인 폼은 닫지 않는다.
3. 도면에서 구조물을 고르면 그쪽 그룹(유입구/유출구)을 붉은 계열로 강조한다.
   카드만 고른 경우는 강조하지 않는다 — 대표 벽은 조용히 딸려 오고, 그 벽을
   다시 눌러 선택을 풀면 강조만 꺼지고 행은 남는다.

검증: 슬롯 grid 2열, 카드 선택 시 강조 없음·행 2개, 다른 벽 클릭 시 유입구 그룹
붉은 테두리(rgb(192,57,43)), 재클릭 시 강조 해제·행 복귀. 길이 + 즉시 캐시
반영(11) 후 - 원복(10), 폼 유지. typecheck 통과.
This commit is contained in:
2026-08-29 16:00:04 +09:00
parent 889f746a61
commit 5d0d2f0918
5 changed files with 178 additions and 14 deletions
+21 -3
View File
@@ -21,6 +21,20 @@ export function setAdjustSideSlots(next: { inlet: HTMLElement; outlet: HTMLEleme
sideSlots = next;
}
/** 지금 붙는 사본이 **자동 선택**(카드를 골라 대표 벽이 딸려 온 경우)인가.
* 자동이면 그룹 강조를 켜지 않는다 — 강조는 도면에서 구조물을 직접 고를 때만
* 쓴다(2026-08-29 사용자 지시). */
let autoAdopt = false;
export function withAutoAdopt(run: () => void): void {
autoAdopt = true;
try {
run();
} finally {
autoAdopt = false;
}
}
/** 이식 자리가 지금 화면에 서 있는지 — 숨겨진 그룹(다른 시설)이면 옮기지 않는다. */
function slotUsable(target: HTMLElement | undefined): target is HTMLElement {
if (!target) return false;
@@ -28,10 +42,12 @@ function slotUsable(target: HTMLElement | undefined): target is HTMLElement {
return !!group && !group.hidden;
}
/** 옮겨 놨던 행을 비운다 — 사본이 갈릴 때마다 옛 행을 남기지 않는다. */
/** 옮겨 놨던 행을 비운다 — 사본이 갈릴 때마다 옛 행을 남기지 않는다. 그룹 강조도 끈다. */
function clearSideSlots(): void {
sideSlots?.inlet.replaceChildren();
sideSlots?.outlet.replaceChildren();
for (const target of [sideSlots?.inlet, sideSlots?.outlet]) {
target?.replaceChildren();
target?.closest("fieldset")?.classList.remove("is-active");
}
}
/**
@@ -51,6 +67,8 @@ function relocateSideRows(panelRoot: HTMLElement): void {
if (row.classList.contains("is-hidden")) return;
target.append(row);
});
// 도면에서 직접 고른 구조물만 그룹 테두리로 알린다(2026-08-29 사용자 지시 3).
if (!autoAdopt) target.closest("fieldset")?.classList.add("is-active");
}
function ensureDock(): void {