feat(project): add group collapse and UI polish

This commit is contained in:
2026-10-03 05:26:41 +09:00
parent 44f6ca4ef7
commit 494d84f7c2
13 changed files with 306 additions and 51 deletions
+30
View File
@@ -552,6 +552,36 @@ function titleVal(d) { return d.getElementById("pj-t-title").value; }
check("[카드 완료] 읽기 전용 체크는 서버 요청을 보내지 않음", env.calls.length === before);
}
{
const env = makeEnv(); baseRoutes(env);
env.w.localStorage.setItem("pj_board_fold:1", '{"id:11":true}');
env.w.localStorage.setItem("pj_side_w", "100");
await boot(env);
const d = env.d, w = env.w;
const col = function () { return d.querySelector('.pj-col[data-stage-id="11"]'); };
const btn = function () { return col().querySelector(".pj-col-collapse"); };
check("[그룹 축소] 저장된 상태로 시작·확장 접근성 표시", col().classList.contains("is-collapsed") && btn().getAttribute("aria-expanded") === "false" && col().querySelector(".pj-col-body").inert);
const before = env.calls.length;
btn().click();
check("[그룹 축소] 펼치기는 작업 변경 없이 상태만 저장", !col().classList.contains("is-collapsed") && btn().getAttribute("aria-expanded") === "true" && env.calls.length === before);
btn().click();
w.dispatchEvent(new w.Event("resize")); await settle();
check("[그룹 축소] 보드 다시 그리기 뒤에도 축소 유지", col().classList.contains("is-collapsed") && /"id:11":true/.test(w.localStorage.getItem("pj_board_fold:1")));
const layout = d.querySelector(".pj-layout"), handle = d.querySelector(".pj-side-resizer");
check("[왼쪽 메뉴] 저장된 좁은 너비는 최소 170px", layout.style.getPropertyValue("--pj-side-w") === "170px");
handle.dispatchEvent(new w.MouseEvent("mousedown", { bubbles: true, button: 0, clientX: 200 }));
d.dispatchEvent(new w.MouseEvent("mousemove", { bubbles: true, clientX: 100 }));
d.dispatchEvent(new w.MouseEvent("mouseup", { bubbles: true }));
check("[왼쪽 메뉴] 드래그 최소 너비·저장", layout.style.getPropertyValue("--pj-side-w") === "170px" && w.localStorage.getItem("pj_side_w") === "170");
handle.dispatchEvent(new w.KeyboardEvent("keydown", { bubbles: true, key: "ArrowRight" }));
check("[왼쪽 메뉴] 방향키 너비 조절", layout.style.getPropertyValue("--pj-side-w") === "180px");
const input = d.getElementById("pj-cm-input");
Object.defineProperty(input, "scrollHeight", { value: 300 });
input.value = "첫 줄\n둘째 줄\n셋째 줄"; input.dispatchEvent(new w.Event("input", { bubbles: true }));
check("[댓글] 긴 글도 높이 70px·내부 스크롤", input.style.height === "70px" && input.style.overflowY === "auto");
input.value = ""; input.dispatchEvent(new w.Event("input", { bubbles: true }));
check("[댓글] 비운 뒤에도 높이 70px", input.style.height === "70px");
}
clearTimeout(WATCHDOG);
console.log(fails.length ? "\nFAILED: " + fails.join(", ") : "\nALL PASS");
process.exit(fails.length ? 1 : 0);