fix(B05 노선 편집 상태줄): 종단 판 열림 때 상태 · 범례를 판 위로 올림 (408-2)
- 판이 지도 아래를 덮은 높이 = logic InfoLift infoLiftPx · Chrome 이 판 크기 관찰로 --b05-profile-cover 적음 - 접힘 · 창 분할 = 제자리 · 판을 끝까지 올려도 지도 안 120 px 남김 - 시험 test_408_2_status_lift 새로 · test_345_5c 자리 규칙 고쳐 씀 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ji4nuyLVHcxrXWHTdb5nRD
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
/* 408-2 평면 상태줄 올림 — `logic/B05_Profile_RouteEdit_InfoLift.ts` 를 Node 로 돌려 JSON 한 줄
|
||||
* (`test_408_2_status_lift.py` 가 판정).
|
||||
* node helper_408_2_status_lift.cjs
|
||||
*/
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
const ts = require(path.join(__dirname, "..", "..", "config", "node_modules", "typescript"));
|
||||
|
||||
const file = path.join(
|
||||
__dirname,
|
||||
"..",
|
||||
"..",
|
||||
"B05_Profile",
|
||||
"logic",
|
||||
"B05_Profile_RouteEdit_InfoLift.ts",
|
||||
);
|
||||
const js = ts.transpileModule(fs.readFileSync(file, "utf8"), {
|
||||
compilerOptions: { module: ts.ModuleKind.CommonJS, target: ts.ScriptTarget.ES2020 },
|
||||
}).outputText;
|
||||
const box = { exports: {} };
|
||||
new Function("exports", "module", "require", js)(box.exports, box, require);
|
||||
const { infoLiftPx } = box.exports;
|
||||
|
||||
// 화면 1078 px · 지도 칸 0~1078
|
||||
process.stdout.write(
|
||||
JSON.stringify({
|
||||
open: infoLiftPx(1078, 1078, 430), // 종단 판 열림(648 px)
|
||||
collapsed: infoLiftPx(1078, 1078, 1077), // 접힘(테두리 1 px)
|
||||
popout: infoLiftPx(1078, 1078, null), // 창 분할 = 판 없음
|
||||
below: infoLiftPx(600, 600, 700), // 횡단 보기 = 판이 지도 아래 흐름
|
||||
tall: infoLiftPx(1078, 1078, 20), // 판을 끝까지 올림 = 지도 안에 남김
|
||||
}),
|
||||
);
|
||||
@@ -56,8 +56,8 @@ def test_상태_범례_접기_한_줄_기억() -> None:
|
||||
|
||||
def test_상태_글판_작게_반투명_자리() -> None:
|
||||
info = _rule(".b05-routeedit__info")
|
||||
# 왼쪽 아래 제자리 — 뜬 판이 덮으면 가려진 채(349-0) · 폭 줄임
|
||||
assert "bottom: var(--spacing-12);" in info
|
||||
# 왼쪽 아래 제자리 — 뜬 판이 덮으면 그 위로(408-2) · 폭 줄임
|
||||
assert "bottom: calc(var(--spacing-12) + var(--b05-profile-cover, 0px));" in info
|
||||
assert "max-width: min(460px, 46%);" in info and "grid-template-columns:" in info
|
||||
# 상태 글 두 줄에서 자름 · 범례는 옆 칸 두 줄
|
||||
assert "-webkit-line-clamp: 2;" in _rule(".b05-routeedit__status")
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
"""408-2 창 나눔(종단 판 열림) 때 평면 상태줄이 종단 표 밑에 깔림 — 판이 덮은 높이만큼 상태 · 범례를
|
||||
위로(`logic/B05_Profile_RouteEdit_InfoLift.ts` · `_Chrome` 이 판 크기 관찰로 `--b05-profile-cover` 적음).
|
||||
|
||||
TS 셈은 `helper_408_2_status_lift.cjs`(Node).
|
||||
|
||||
./venv/Scripts/python.exe -m pytest resources/tester/test_408_2_status_lift.py -q
|
||||
"""
|
||||
|
||||
import json
|
||||
import subprocess
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[2]
|
||||
B05 = ROOT / "B05_Profile"
|
||||
HELPER = Path(__file__).with_name("helper_408_2_status_lift.cjs")
|
||||
|
||||
|
||||
@pytest.fixture(scope="module")
|
||||
def got() -> dict:
|
||||
run = subprocess.run( # noqa: S603 — 고정 실행 파일
|
||||
["node", str(HELPER)], capture_output=True, text=True, encoding="utf-8", timeout=60
|
||||
)
|
||||
assert run.returncode == 0, run.stderr
|
||||
return json.loads(run.stdout)
|
||||
|
||||
|
||||
def test_올릴_높이(got) -> None:
|
||||
assert got["open"] == 648 # 판 윗변 위로
|
||||
assert got["collapsed"] == 1 and got["popout"] == 0 and got["below"] == 0
|
||||
assert got["tall"] == 1078 - 120 # 지도 안에 120 px 남김
|
||||
|
||||
|
||||
def test_상태_글판이_올림_값을_씀() -> None:
|
||||
css = (B05 / "B05_Profile_UI_Style_RouteEdit.css").read_text(encoding="utf-8")
|
||||
block = css[css.index(".b05-routeedit__info {\n bottom") :]
|
||||
assert block.startswith(
|
||||
".b05-routeedit__info {\n bottom: calc(var(--spacing-12) + var(--b05-profile-cover, 0px));"
|
||||
)
|
||||
|
||||
|
||||
def test_편집기가_판_크기를_관찰() -> None:
|
||||
chrome = (B05 / "B05_Profile_UI_RouteEdit_Chrome.ts").read_text(encoding="utf-8")
|
||||
assert "new ResizeObserver(liftInfo)" in chrome and "lift.observe(overlay)" in chrome
|
||||
assert '"--b05-profile-cover"' in chrome and ".b05-route-profile" in chrome
|
||||
assert "lift.disconnect" not in chrome # 붙기 전 첫 알림에 끊으면 영영 안 올라감
|
||||
Reference in New Issue
Block a user