fix(structure): 고른 구조물 군 바꿈 = 횡단 카드 · 벽 · 세월교 · BOX 강조 · 넘김 되얹기 표시 · 선택 칸도 풂 · B05 에서 풀면 B06 들어올 때도 풂(54-38)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013rJwJMVL4EE31y77TB11AP
This commit is contained in:
2026-10-06 14:22:37 +09:00
co-authored by Claude Opus 5.5
parent ac544b3c38
commit bf92e56fef
3 changed files with 108 additions and 2 deletions
@@ -0,0 +1,80 @@
/* 54-38 고른 구조물에서 군 바꿈 = 횡단 강조(카드 · 벽 · 부재 · 조정 칸)도 풂
* 시작 화면: B06 횡단설계(#/b06-section) · 검증 프로젝트(sub4) · 로그인
* 부르는 법: 단계마다 `window.__m5438 = "단계";` 뒤 이 파일 본문을 eval
* a (B06) 배관 1 → 유입 벽 고름 → 군 바꿈 = 강조 0 · 돌쌓기(찰) 1 → 군 바꿈 = 강조 0
* b (B06) 배관 1 → 벽 고름 → B05 로 → 군 바꿈 → B06 로 = 강조 0 · 선택 칸 비어 있음
* 결과는 sessionStorage `__5438_out_{단계}` · 기대: fails 0
*/
(async () => {
const MODE = window.__m5438 || "a";
const w = (ms) => new Promise((r) => setTimeout(r, ms));
const pid = localStorage.getItem("frd_current_project_id");
const t = (e) => e.innerText.replace(/\s+/g, " ").trim();
const fails = [];
const out = {};
const fail = (m) => fails.push(m);
const sec = () => document.querySelector(".b05-structure-section");
const grid = () => sec().querySelectorAll(".b05-structure__grid select");
const rows = () => [...document.querySelectorAll(".b05-route__irregular-list li")];
const row = (head) => rows().find((li) => t(li).startsWith(head));
const fire = (el, value) => {
el.value = value;
el.dispatchEvent(new Event("input", { bubbles: true }));
el.dispatchEvent(new Event("change", { bubbles: true }));
};
const pick = async (head) => {
for (let k = 0; k < 40 && !row(head); k++) await w(300);
if (!row(head)?.classList.contains("is-selected")) row(head)?.click();
await w(2000);
};
const setGroup = async (g) => (fire(grid()[0], g), await w(2000));
/** 횡단 강조 수 — 고른 카드 · 그림 부재 · 조정 칸 */
const lit = () => ({
card: document.querySelectorAll(".b06-cross-card--selected").length,
part: document.querySelectorAll(".b06-cross-card svg .is-active").length,
box: document.querySelectorAll("fieldset[data-spec-container].is-active").length,
});
const total = (o) => o.card + o.part + o.box;
/** 고른 카드의 유입 벽을 누름 — 횡단에서 벽을 고른 길 */
const pickWall = async () => {
const shape = document.querySelector(".b06-cross-card--selected .b06-chart__culvert-revet-hit");
shape?.dispatchEvent(new MouseEvent("click", { bubbles: true }));
await w(1500);
return !!shape;
};
const go = async (hash) => ((location.hash = hash), await w(5000));
const pickState = () => sessionStorage.getItem(`aislo:draft:structure-pick:${pid}`);
if (MODE === "a") {
await pick("4+5 배관 1");
out.wallClicked = await pickWall();
out.pipeBefore = lit();
if (total(out.pipeBefore) === 0) fail("배관 고름 강조 없음");
await setGroup("C");
out.pipeAfter = lit();
if (total(out.pipeAfter) !== 0) fail(`배관 군 바꿈 강조 ${JSON.stringify(out.pipeAfter)}`);
await pick("4+0~4+10 돌쌓기(찰) 1");
out.structBefore = lit();
if (total(out.structBefore) === 0) fail("돌쌓기 고름 강조 없음");
await setGroup("B");
out.structAfter = lit();
if (total(out.structAfter) !== 0)
fail(`돌쌓기 군 바꿈 강조 ${JSON.stringify(out.structAfter)}`);
out.pick = pickState();
}
if (MODE === "b") {
await pick("4+5 배관 1");
out.wallClicked = await pickWall();
out.before = lit();
await go("#/b05-profile");
await pick("4+5 배관 1");
await setGroup("C");
out.pick = pickState();
await go("#/b06-section");
out.after = lit();
if (total(out.after) !== 0) fail(`B05 군 바꿈 뒤 B06 강조 ${JSON.stringify(out.after)}`);
}
sessionStorage.setItem(`__5438_out_${MODE}`, JSON.stringify({ fails, out }));
})();