Merge remote-tracking branch 'origin/sub_laptop_6' into main_laptop_1

This commit is contained in:
2026-11-01 12:29:17 +09:00
14 changed files with 317 additions and 178 deletions
@@ -55,6 +55,8 @@ DRAW_NAMES_READ = {m for _, n in DRAW_READS for m in re.findall(r"--draw-[a-z-]+
DECL = re.compile(r"^\s*(stroke|fill|stop-color|--b06-tag)\s*:(.*);", re.M)
VAR = re.compile(r"var\((--[a-z0-9-]+)(?:\s*,\s*([^()]*(?:\([^()]*\))?[^()]*))?\)")
HEX = re.compile(r"#[0-9a-f]{6}")
#: 색이 아닌 그림 값 — 불투명(테마 안 따름 · 밝음 블록에만)
DRAW_ALPHAS = {"--draw-map-dim"}
def _blocks(css: str) -> dict[str, dict[str, str]]:
@@ -125,6 +127,9 @@ def test_draw_values_are_literal_hex():
draws = {k: v for k, v in env.items() if k.startswith("--draw-")}
assert draws, mode
for name, value in draws.items():
if name in DRAW_ALPHAS: # 불투명 값(색 아님 · 635-3)
assert 0 < float(value) < 1, (mode, name, value)
continue
assert HEX.fullmatch(value), (mode, name, value)
# 밝음 블록이 전부 정의 · 어두움 · 시스템 어두움은 그 안의 것만 덮음(고정 개수 아님)
light = {k for k in blocks["light"] if k.startswith("--draw-")}
@@ -179,6 +184,8 @@ def test_map_drawing_colors_fixed_and_readable_on_dark_map():
if re.fullmatch(r"--draw-map-(sketch|measure|warn|route-\d|slope-(up|down))", k)
]
assert len(names) == 10, names
for name in DRAW_ALPHAS: # 635-3 어둡게 = 밝음 블록 하나(어두움 · 시스템 어두움 덮지 않음)
assert name in blocks["light"] and all(name not in blocks[m] for m in ("dark", "auto"))
ground = _lum("#1f2937")
for name in names:
for mode in ("dark", "auto"):
-4
View File
@@ -55,8 +55,6 @@ def test_단추_목록_아이콘_차례():
"footprint",
"measure",
"station-snap",
"expected-draw",
"expected-original",
]
names = _icon_names()
assert all(icon in names for _, icon, _ in rows)
@@ -68,8 +66,6 @@ def test_단추_목록_아이콘_차례():
"footprint",
"measure",
"station-snap",
"expected-draw",
"expected-original",
}
+19 -18
View File
@@ -1,11 +1,11 @@
"""626-3 B05 평면 예정노선 변경 → 다시 추적 → 편집기 한 걸음 → [저장](요구 530 · 531 · 535-1 · 536 · 결정 D3 · D4 · D9).
- 예정노선 페이지(D03) 긋기 · 고르기 · 메뉴 · 속성 판 함수를 그대로 부름(숨김 = 기능 표 「b05」 — 한 선 · 갈래 · 연도 ·
지점 · 635-1) · 지도 입력 = 키트 `bindPlanInput` capture.
- 예정노선 키트 `createPlanKit` 「b05」 한 벌(긋기 · 고르기 · 메뉴 · 속성 판 · 칸 · 숨김 = 기능 표 — 한 선 · 갈래 · 연도 ·
지점 · 635-1 · 635-3) · 지도 입력 = 키트 `bindPlanInput` capture.
- 지킴(글 대조) — 다시 추적 = `/route/follow` 만(저장 0) · `/route/replan` · `as_initial` · `expected_route.csv` 안 부름 ·
결과 = 편집기 `restoreSnapshot(…, true)` 한 걸음 · [저장] = 손 편집 같은 길(`bindRouteApply`) + 초안 `expected` ·
걸음 사진 · 노선 초안에 고친 예정노선 실림(되돌리기 · 세션 되살림) · 같은 선 판정에 예정노선 · 켠 동안 캔버스 누름을
먼저 받음(재기 · 계획선 고르기 막음) · 원본 켬끔 · RouteEdit 700 줄 안.
먼저 받음(재기 · 계획선 고르기 막음) · 받은 노선 켬끔(왼쪽 「그리기」 칸 · 635-3) · RouteEdit 700 줄 안.
./venv/Scripts/python.exe -m pytest resources/tester/test_626_3_expected_edit.py -q
"""
@@ -69,18 +69,18 @@ def test_걸음_사진_초안_같은_선에_예정노선():
def test_D03_긋기_고르기_메뉴_속성판_그대로_한_선():
ui = _src(B05 / "B05_Profile_UI_ExpectedDraw.ts")
for call in ("createPlanDraw({", "createPlanEdit(", "createPlanMenu({", "createPlanProps({"):
assert call in ui, call
assert ui.count('page: "b05",') == 3 # 긋기 · 메뉴 · 속성 판 = 기능 표(635-1)
assert "createPlanKit({" in ui and ui.count('page: "b05",') == 1 # 키트 한 벌(635-3)
kit = _src(D03 / "D03_PlanAnalysis_UI_Kit.ts")
for call in ("createPlanDraw({", "createPlanEdit({", "createPlanMenu({", "createPlanProps({"):
assert call in kit, call
for fake in ("NO_POINTS", "epsg: () => 0", "addPoint: () => undefined", "oneLine"):
assert fake not in ui, fake
assert "draw.key(event) || editor.key(event)" in ui # 같은 단축키
assert "if (!kit.key(event)) return;" in ui # 같은 단축키(키트)
assert (
'keyIs(event, "plan.undo") || keyIs(event, "plan.redo")' in ui
) # 되돌리기 = 페이지 사진첩
# 지도 입력 = 키트 한 함수 · 잡기 단계(capture) — 재기 · 계획선 고르기보다 먼저
assert "capture: { active: () => open, busy: () => busy }," in ui
kit = _src(D03 / "D03_PlanAnalysis_UI_Kit.ts")
assert "canvas.addEventListener(type, run, !!capture)" in kit
assert "event.stopImmediatePropagation()" in kit
assert "event.buttons & (capture ? 6 : 4)" in kit # 오른쪽 · 가운데 끌기 = 지도 이동 그대로
@@ -114,20 +114,21 @@ def test_D03_긋기_고르기_메뉴_속성판_그대로_한_선():
("draw", "use"),
):
assert re.search(rf'key: "{key}",[^}}]*b05: "{b05}"', table, re.S), key
tools = _src(ROOT / "A00_Common" / "map" / "map_toolbar.ts")
# 634-2 — 표 줄에 호버제목(title) · 걷음은 635-3
assert re.search(
r'key: "expected-draw",\s+title: "[^"]+",\s+does: "[^"]+",\s+pages: B05', tools
)
assert re.search(
r'key: "expected-original",\s+title: "[^"]+",\s+does: "[^"]+",\s+pages: B05', tools
)
# 635-3 — 도구줄 「예정노선 변경」 · 「원본」 걷음(왼쪽 「그리기」 칸 「예정노선 수정」)
for path in (
ROOT / "A00_Common" / "map" / "map_toolbar.ts",
ROOT / "ui_template" / "ui_template_map_tools.ts",
B05 / "B05_Profile_UI_RouteEdit_Chrome.ts",
):
assert "expected-draw" not in _src(path) and "expected-original" not in _src(path), path
render = _src(B05 / "B05_Profile_UI_RouteEdit_Render.ts")
# 맨 위 = 구조물 마커 뒤 · 회전 끝 앞
assert render.index("scene.overAll?.(context);") < render.index("context.restore(); // 회전 끝")
assert render.index("scene.overAll?.paint(context);") < render.index(
"context.restore(); // 회전 끝"
)
def test_원본_예정노선_안_덮음_옅은_점선_켬끔():
def test_받은_예정노선_안_덮음_옅은_점선_켬끔():
ui = _src(B05 / "B05_Profile_UI_ExpectedDraw.ts")
assert "showOriginal && original.length > 1 && line() !== original" in ui
assert "expected_route.csv" in ui.split("*/")[0] # 머리 = 원본 안 덮음 적음
+1 -3
View File
@@ -51,8 +51,6 @@ GROUP2 = [
("measure", "길이측정"),
("station-snap", "스냅"),
("snap-step", "스냅 간격"),
("expected-draw", "예정노선 변경"),
("expected-original", "예정노선 원본"),
("recommend", "추천노선"),
("terrain", "수치지형도/라이다"),
]
@@ -73,7 +71,7 @@ def test_그룹2_표_호버():
rows = re.findall(r'key: "([\w-]+)",\s+title: "([^"]+)"', src)
assert rows == GROUP2
tools = _read(ROOT / "ui_template" / "ui_template_map_tools.ts")
for key, title in GROUP2[1:-4]:
for key, title in GROUP2[1:-2]: # 추천 · 지형 = 페이지 요소
if key != "snap-step":
assert re.search(rf'"?{key}"?: \{{ icon: "\w+", title: "{title}"', tools), key
@@ -0,0 +1,77 @@
"""635-3 B05 왼쪽 「위치」 · 「그리기」 칸 · 「예정노선 수정」 · 받은 노선 비교 · [받은 노선으로] · 어둡게(요구 546).
- 칸 = 예정노선 키트(`createPlanKit` 「b05」) 칸 · 자리 = `registerPanelSection` order 1 · 2(종단 보기) · 편집기가 채움.
- 위치 = 찾기 → 지도 이동만(지형 받기 · 기준점 없음) · 고칠 선 = 받은 원본 꼭짓점(`GET /route/plan/source` · 635-2).
- [받은 노선으로] = 받은 꼭짓점 다시 추적 + 초안 `expected` [](고친 예정노선 지움) — 한 걸음 · 페이지 [초기화] 그대로.
- 켬 = 아래 계획노선 그림 불투명 `--draw-map-dim`(0.35) · 등고 높이값 · 예정노선 그림은 그대로.
- 큰 파일 안 늘림(RouteEdit 683 · Render 648 + 10 안).
./venv/Scripts/python.exe -m pytest resources/tester/test_635_3_b05_plan_panel.py -q
"""
from __future__ import annotations
import re
from pathlib import Path
ROOT = Path(__file__).resolve().parents[2]
B05 = ROOT / "B05_Profile"
def _src(path: Path) -> str:
return path.read_text(encoding="utf-8")
def test_왼쪽_칸_둘_종단_보기_위():
panel = _src(B05 / "B05_Profile_UI_Panel_Plan.ts")
assert '["site", 1, "위치"]' in panel and '["draw", 2, "그리기"]' in panel
assert 'views: ["profile"]' in panel and "id: `plan-${slot}`" in panel
assert "export function fillPlanPanel(" in panel
assert "holder.hidden = !card;" in panel # 비면 자리 숨김
# 다른 칸(구조물 배치 10 · 페이지 설정 20)보다 위
assert "order: 10" in _src(ROOT / "A00_Common" / "design" / "design_sections.ts")
assert "order: 20" in _src(B05 / "B05_Profile_UI_Panel_Sections.ts")
def test_키트_칸_위치_찾기_이동만_원본_꼭짓점():
ui = _src(B05 / "B05_Profile_UI_ExpectedDraw.ts")
body = ui.split("*/", 1)[1]
assert 'page: "b05",' in body and "cards: { site: { parts: [find.root] } }," in body
assert "fillPlanPanel({" in body and "createPlaceFind(" in body
assert "normOfLonLat(createTmNormalizer(meta), hit.lon, hit.lat)" in body # 지도 이동만
for banned in ("createPlanTerrain", "ensureCovered", "createPlanSite", "createFloatPanel"):
assert banned not in body, banned
assert "/route/plan/source" in body and "expected_source" in body
assert "shown === original ? received() : shown" in body # 안 고친 선 = 원본 꼭짓점
features = _src(ROOT / "D03_PlanAnalysis" / "D03_PlanAnalysis_UI_Features.ts")
assert re.search(r'key: "site",[^}]*b05: "use"', features)
assert re.search(r'key: "terrain",[^}]*b05: "hide"', features, re.S)
def test_수정_켬끔_받은_노선_비교_되돌림():
body = _src(B05 / "B05_Profile_UI_ExpectedDraw.ts").split("*/", 1)[1]
assert 'label: "예정노선 수정"' in body and 'label: "받은 노선"' in body
assert "drawCard.firstElementChild!.append(toggle.root);" in body # 그리기 칸 머리
assert "event.stopPropagation()" in body # 켬끔 누름 = 칸 접기 아님
assert "받은 노선 ${meters(received())} m → 고친 노선 ${meters(line())} m" in body
assert 'label: "받은 노선으로"' in body and "follow(received(), [])" in body
assert "resetButton.disabled = !edited || busy;" in body
assert "if (!sameLine(points, base)) await follow(points, points);" in body
main = _src(B05 / "B05_Profile_UI_RouteEdit.ts")
assert "frame: () => ({ meta, setView: (next: ViewState) => (view = next) })," in main
assert len(main.splitlines()) <= 683
def test_켬_때_아래_노선_어둡게():
body = _src(B05 / "B05_Profile_UI_ExpectedDraw.ts").split("*/", 1)[1]
assert 'dim: () => (open ? parseFloat(themeColor("--draw-map-dim", "0.35"))' in body
theme = _src(ROOT / "ui_template" / "ui_template_theme.css")
assert "--draw-map-dim: 0.35;" in theme
render = _src(B05 / "B05_Profile_UI_RouteEdit_Render.ts")
dim = render.index("context.globalAlpha = dim;\n drawFootprint(")
labels = render.index("context.globalAlpha = 1; // 등고 높이값")
top = render.index("context.globalAlpha = 1;\n scene.overAll?.paint(context);")
assert dim < render.index("scene.underRoute?.(context);") < labels < top # 추천 보기도 어둡게
assert render.index("drawStructureMarks(context, scene, line, style);") < top
assert len(render.splitlines()) <= 658
assert "overAll: expectedDraw," in _src(B05 / "B05_Profile_UI_RouteEdit.ts")