fix(B06·B05): 노면공 고름 세 갈래 · 형상 누름 = 목록 고름 · 카드 하나 = 그 측점(189-1)

- ② 카드 안 노면공 포장층 누름 = 목록 고름과 같은 길(범위 카드 전부 · 포장층 강조) — 카드 고름보다 먼저 가로챔
- ③ 카드 하나 누름 = 연 노면공 · 범위 강조 풂 · 그 카드 하나(165-1 노면공 지킴 · 167-3 재누름 그대로 없앰)
- 카드 고름 세션 = 그 측점(구조물 id 는 목록 · 알약 · 넘김이 고른 것만)
- 종단: 구조물 넘김이면 측점선 · 3D 띠 안 켬
- 새 시험 test_189_1_pave_pick · test_165 · test_188_1 기대값 41번 규칙으로

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01STqEqztUthVFBmEP18wBSz
This commit is contained in:
2026-10-10 13:21:23 +09:00
co-authored by Claude Opus 5.5
parent e744da8af1
commit 9e69bec512
12 changed files with 301 additions and 72 deletions
+33 -9
View File
@@ -163,11 +163,16 @@ let marks = [];
const profile = {
markedId: null,
pill: null,
line: null, // 종단 측점선(design_profile selectedStationId)
selectMark(id) {
this.markedId = id;
this.pill = id;
// setSelectedStructure(id, keepStation) — 선 있는 구조물(관)만 그 선 · 아니면 카드 선 지킴(177-3)
const pipe = PIPES.find((entry) => `pipe-${entry.chainage_m.toFixed(2)}` === id);
if (pipe) this.line = cardAt(pipe.chainage_m).station_id;
},
showCard(card) {
this.line = card ? card.station_id : null;
if (!card) return;
const pipe = PIPES.find((entry) => Math.abs(entry.chainage_m - card.chainage_m) < 0.51);
// 관 측점 = 그 측점선 짝 알약 · 일반 측점 = 꺼짐 — 고른 구조물이 덮으면 지킴(53-1)
@@ -189,14 +194,7 @@ const view = {
return !!mark && markTypes.find((type) => type.type_id === mark.type_id)?.group === "G";
},
selectStation(id) {
// 고른 노면공 범위 안 카드 재누름 = 그대로(167-3 · Section_View `selectStation`)
const card = CARDS.find((entry) => entry.station_id === id);
const mark = marks.find((entry) => entry.structure_id === this.spanMarkId);
const held =
this.isPavement(this.spanMarkId) &&
card.chainage_m >= Math.min(mark.start_m, mark.end_m) - 0.01 &&
card.chainage_m <= Math.max(mark.start_m, mark.end_m) + 0.01;
if (this.selected === id && held) return;
// 카드 하나 고름 = 그 측점 · 같은 카드 재누름 = 풂(189-1 · Section_View `selectStation`)
const previous = this.selected;
this.selected = this.selected === id ? null : id;
profile.showCard(CARDS.find((card) => card.station_id === this.selected) ?? null);
@@ -243,8 +241,11 @@ view.listener = (stationId) => {
return;
}
const owner = wallSelecting ? ownerOf(target) : null;
const preferred = panel.preferred() !== null;
const opened = panel.showAtChainage(owner?.chainage_m ?? target.chainage_m);
if (!wallSelecting) selection.selectDesign(PID, opened, { from: "b06" });
// 카드 하나 고름 = 그 측점(구조물 id 는 목록 · 알약 · 넘김이 고른 것만 · 189-1)
const picked = preferred ? opened : { chainageM: opened.chainageM, structureId: null };
if (!wallSelecting) selection.selectDesign(PID, picked, { from: "b06" });
const pipeAt = panel.currentChainage();
const mark = opened.structureId ?? (pipeAt === null ? null : `pipe-${pipeAt.toFixed(2)}`);
view.selectMark(mark, false);
@@ -260,6 +261,7 @@ async function build(list) {
view.spanMarkId = null;
profile.markedId = null;
profile.pill = null;
profile.line = null;
panel = panelModule.createB06StructuresPanel({
projectId: PID,
shared: { view: () => "cross" },
@@ -292,6 +294,7 @@ function snap() {
paveCards: pave ? CARDS.filter((entry) => inSpan(entry.chainage_m)).length : 0,
card: card ? card.chainage_m : null,
sid: selection.readSelection(PID)?.structureId ?? null,
line: profile.line,
};
}
@@ -302,6 +305,8 @@ const pillPick = (id) => {
panel.selectStructure(id);
};
const cardPick = (at) => view.selectStation(cardAt(at).station_id);
/** 카드 안 노면공 형상 누름 — Section_View 가 카드 고름 전에 가로채 design_view_cross 가 목록 길로(189-1). */
const shapePick = (id) => panel.selectStructure(id);
/** 벽 누름 — SPS `revetOffset.select` 감싸개(소유 측점 폼) 뒤 카드 고름(벽 고르는 턴). */
const wallPick = (cardAtM, ownerM) => {
wallOwner = { card: cardAtM, chainage_m: ownerM };
@@ -340,6 +345,25 @@ const wallPick = (cardAtM, ownerM) => {
cardPick(280); // 범위 밖 카드 재누름 = 카드 풂(옛 규칙 그대로)
out.outsideRe = snap();
// 189-1 세 갈래 — ① 목록 · ② 형상 · ③ 카드 하나 · 종단 측점선 · 세션
await build([PAVE, { structure_id: "sign", type_id: "hazard_sign", chainage_m: 127.86 }]);
listPick("pave");
out.r1 = snap();
cardPick(140); // ③ 범위 안 카드 = 목록 고름 · 범위 강조 풂 · 그 카드 하나
out.r3 = snap();
shapePick("pave"); // ② 고른 카드 안 형상 = ① 과 같음(옛 카드 풂)
out.r2 = snap();
out.r2reveal = view.revealed;
cardPick(100); // ③ 다시
out.r3b = snap();
cardPick(100); // 같은 카드 재누름 = 풂(옛 167-3 「그대로」 없앰)
out.r3re = snap();
await build([PAVE]);
shapePick("pave"); // ② 처음부터 형상 누름
out.r2first = snap();
cardPick(80); // ③ 관 자리 카드 = 관
out.r3pipe = snap();
// 5. B05 알약 → B06 복귀 — 넘김값 {범위 첫 카드 · sid} · `restoreStructurePick` 의 focusStation 차례
await build([PAVE]);
selection.selectDesign(PID, { chainageM: 40, structureId: "pave" }, { from: "b05" });
+3 -1
View File
@@ -88,7 +88,9 @@ const sb = sync.createSelectionSync({
sb.syncIrregularSelection(id);
},
selectGraph: (id, c) => {
const target = sync.graphTargetAt(id, c ?? null, pipes, cards);
// 구조물 고름은 측점선 없음(189-1 · view 의 selectGraphAt 과 같음)
const sections = sel.readSelection(P)?.structureId ? [] : cards;
const target = sync.graphTargetAt(id, c ?? null, pipes, sections);
if ("pipeChainageM" in target) graph.mark = `pipe-${target.pipeChainageM.toFixed(2)}`;
else {
graph.station = target.stationId;
@@ -0,0 +1,39 @@
/* PLAN 189-1 단위검증 헬퍼 — 카드 안 누른 포장층 → 그 노면공(`pavementAt`) · 범위 표식으로 겹친 노면공 가름.
* 화면 TS(`B06_Section_UI_Cross_Design_Surface.ts`)를 그 자리에서 트랜스파일해 Node 로 돌림 · 결과 = 표준출력 JSON.
* 짝 = `test_189_1_pave_pick.py`(세 갈래 상태는 `helper_165_pavement_flow.cjs` 가 냄).
*/
const fs = require("fs");
const path = require("path");
const ts = require(path.join(__dirname, "..", "..", "config", "node_modules", "typescript"));
const ROOT = path.join(__dirname, "..", "..");
const file = path.join(ROOT, "B06_Section", "B06_Section_UI_Cross_Design_Surface.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, () => ({}));
const { pavementAt } = box.exports;
const marks = [
{ structure_id: "pave", type_id: "pavement_concrete", start_m: 30, end_m: 250 },
{ structure_id: "pave2", type_id: "pavement_concrete", start_m: 100, end_m: 200 },
{ structure_id: "wall", type_id: "retaining_wall", start_m: 100, end_m: 200 },
];
/** 누른 요소 흉내 — `closest(".b06-chart__pavement")` 가 그 층(없으면 null). */
const hit = (dataset) => ({ closest: () => (dataset ? { dataset } : null) });
const layer = (type, start, end) => ({
paveType: type,
paveStart: String(start),
paveEnd: String(end),
});
const out = {
pave: pavementAt(hit(layer("pavement_concrete", 30, 250)), marks)?.structure_id ?? null,
pave2: pavementAt(hit(layer("pavement_concrete", 100, 200)), marks)?.structure_id ?? null,
plainLayer: pavementAt(hit({}), marks)?.structure_id ?? null, // 범위 표식 없는 카드 포장
outside: pavementAt(hit(null), marks)?.structure_id ?? null,
noTarget: pavementAt(null, marks)?.structure_id ?? null,
unknown: pavementAt(hit(layer("pavement_concrete", 0, 10)), marks)?.structure_id ?? null,
};
process.stdout.write(JSON.stringify(out));
+34 -19
View File
@@ -3,11 +3,11 @@
못박는 것(단계마다 폼 · 알약 · 포장층 · 고른 카드 · 세션 sid 가 같은 것을 가리킴)
1. 목록 노면공 = 포장층 · 알약 · 폼 · sid 모두 노면공 · 카드는 안 고름(스크롤만 · 177-4 · 기준점이 범위 경계여도 범위 밖 카드로 안 감).
2. 범위 안 빈 카드(관 · 덮는 구조물 없음) = 노면공 그대로 · 카드만 옮김(165-1).
2. 범위 안 빈 카드 = 카드 하나 고름 · 노면공 풂 · 세션 = 그 측점(189-1 이 165-1 · 167-3 을 바꿈).
3. 고른 카드의 벽 = 관 폼 + 관 알약(알약이 꺼진 채 폼만 남지 않음 · 165-2) · 포장층 풂.
4. 알약 다시 = 1 과 같음. 관 자리 카드 = 관 · 범위 밖 카드 = 모두 풂(지금처럼).
5. B05 알약 → B06 복귀 = 1 과 같음 · 넘김 카드에서 안 튐.
6. 겹친 노면공 둘 = 고른 층만 · 범위 안 카드 눌러도 그 층 그대로.
6. 겹친 노면공 둘 = 고른 층만 · 범위 안 카드 누름 = 카드 하나(189-1).
Node 헬퍼 `helper_165_pavement_flow.cjs` 가 진짜 SPN 에 폼 · 카드 · 알약 흉내를 붙여 돌림. 화면은 사용자 확인.
"""
@@ -41,6 +41,7 @@ def out():
def _pave(card, layer="pave", cards=12):
# 노면공 고름 = 카드 하나 안 고름 · 종단 측점선 없음(189-1)
return {
"form": layer,
"pill": layer,
@@ -48,10 +49,31 @@ def _pave(card, layer="pave", cards=12):
"paveCards": cards,
"card": card,
"sid": layer,
"line": None,
}
PIPE = {"form": "pipe-80.17", "pill": "pipe-80.17", "paveLayer": None, "paveCards": 0}
def _card(at):
# 카드 하나 고름 = 그 측점 기준 · 노면공 · 범위 강조 풂 · 세션 sid 없음(189-1)
line = None if at is None else f"s{at}"
return {
"form": None,
"pill": None,
"paveLayer": None,
"paveCards": 0,
"card": at,
"sid": None,
"line": line,
}
PIPE = {
"form": "pipe-80.17",
"pill": "pipe-80.17",
"paveLayer": None,
"paveCards": 0,
"line": "s80.17",
}
def test_1_목록_노면공(out):
@@ -59,11 +81,11 @@ def test_1_목록_노면공(out):
assert out["reveal1"] == "s40" # 기준점 30 = 범위 경계 → 범위 안 첫 카드(20 아님)
def test_2_범위_안_빈_카드는_노면공_그대로(out):
assert out["step2first"] == _pave(40)
assert out["step2re"] == _pave(40) # 이미 고른 카드 재누름도 그대로(167-3)
assert out["step2"] == _pave(140)
assert out["step2b"] == _pave(100)
def test_2_범위_안_빈_카드는_카드_하나(out):
assert out["step2first"] == _card(40)
assert out["step2re"] == _card(None) # 같은 카드 재누름 = 풂(189-1)
assert out["step2"] == _card(140)
assert out["step2b"] == _card(100)
def test_3_벽은_관_폼과_관_알약_함께(out):
@@ -73,14 +95,7 @@ def test_3_벽은_관_폼과_관_알약_함께(out):
def test_4_알약_다시_관_카드_범위_밖(out):
assert out["step4"] == _pave(None)
assert out["pipeCard"] == {**PIPE, "card": 80, "sid": None}
assert out["outside"] == {
"form": None,
"pill": None,
"paveLayer": None,
"paveCards": 0,
"card": 280,
"sid": None,
}
assert out["outside"] == _card(280)
assert out["outsideRe"]["card"] is None
@@ -90,16 +105,16 @@ def test_5_B05_복귀(out):
def test_6_겹친_노면공(out):
assert out["step6"] == _pave(None, "pave2", 6)
assert out["step6b"] == _pave(160, "pave2", 6)
assert out["step6b"] == _card(160)
def test_배선():
panel = _read("B06_Section", "B06_Section_UI_Page_Structures_Panel.ts")
assert "deps.focusChainage(focusOf(structure), pave);" in panel
assert "return { chainageM, structureId: openId };" in panel
assert "openId" not in panel # 범위 안 빈 카드 = 연 노면공 지킴(165-1) 없앰 · 189-1
# 관 알약은 폼 뒤(폼이 연 구조물을 닫으며 알약을 끔)
at = panel.index("section.selectPipeByChainage(hit.pipeChainageM);")
assert at < panel.index("deps.markStructure?.(`pipe-${hit.pipeChainageM.toFixed(2)}`);", at)
view = _read("B06_Section", "B06_Section_UI_Section_View.ts")
assert "spanMarkId = span || isPavement(structureId) ? structureId : null;" in view
assert "if (selectedStationId === stationId && held) return;" in view
assert "held" not in view # 범위 카드 재누름 = 그대로(167-3) 없앰 · 189-1
+5 -1
View File
@@ -74,9 +74,12 @@ def test_횡단_배관은_종단_배관_측점선_측점선_없는_관은_알약
assert out["b06BarePipe"]["graph"] == {"station": None, "mark": "pipe-50.00"}
def test_횡단_구조물은_종단에서_그_구조물을_열고_고름_한_칸을_안_덮음(out) -> None:
def test_횡단_구조물은_종단에서_그_구조물을_열고_측점선_없이_고름_한_칸을_안_덮음(out) -> None:
structure = out["b06Structure"]
assert structure["opened"] == ["wall"]
# 구조물 고름 = 종단 측점선 · 3D 띠 없음(189-1 · 여러 측점이라 한 측점 기준 없음)
assert structure["graph"] == {"station": None, "mark": None}
assert structure["marker"] is None
# 되살리며 3D 띠 리스너가 되불러도(동기화 중) 구조물 id · 부재키가 남음
assert structure["pick"] == {"chainageM": 60, "structureId": "wall", "partKey": "own"}
@@ -99,3 +102,4 @@ def test_종단_보기_배선() -> None:
assert "regularChainage:" in page
assert "remember: (chainageM) => rememberPick(chainageM, null)" in page
assert "graphTargetAt(id, chainageM, lastPipes ?? [], sections)" in page
assert "const sections = structurePick ? [] :" in page
+130
View File
@@ -0,0 +1,130 @@
# -*- coding: utf-8 -*-
"""PLAN 189-1 — 노면공(여러 측점 구간) 고름 세 갈래 · 종단 측점선(사용자 41번).
못박는 것
① 좌측 목록 노면공 = 범위 카드 전부 테두리 + 포장층 강조 · 카드 하나 안 고름 · 종단 측점선 없음.
② 카드 안 노면공 형상 누름 = ① 과 같음(고른 카드도 풂 · 카드 고름 리스너 안 돎).
③ 카드 하나 누름(형상 밖) = 목록 고름 · 범위 강조 풂 · 그 카드 하나 · 종단 측점선 = 그 카드 · 세션 sid 없음.
같은 카드 재누름 = 풂 · 관 자리 카드 = 관.
상태는 `helper_165_pavement_flow.cjs`(진짜 SPN) · 형상 → 노면공 찾기는 `helper_189_1_pave_shape.cjs`.
"""
import json
import os
import re
import subprocess
import pytest
HERE = os.path.dirname(os.path.abspath(__file__))
ROOT = os.path.abspath(os.path.join(HERE, "..", ".."))
pytestmark = pytest.mark.skipif(
not os.path.isdir(os.path.join(ROOT, "config", "node_modules")),
reason="프론트엔드 의존성 미설치",
)
def _node(name: str) -> dict:
proc = subprocess.run( # noqa: S603 — 고정 실행 파일
["node", os.path.join(HERE, name)],
capture_output=True,
text=True,
encoding="utf-8",
timeout=60,
)
assert proc.returncode == 0, proc.stderr
return json.loads(proc.stdout)
@pytest.fixture(scope="module")
def flow() -> dict:
return _node("helper_165_pavement_flow.cjs")
@pytest.fixture(scope="module")
def shape() -> dict:
return _node("helper_189_1_pave_shape.cjs")
def _read(*parts: str) -> str:
with open(os.path.join(ROOT, *parts), encoding="utf-8") as handle:
return handle.read()
PAVE = {
"form": "pave",
"pill": "pave",
"paveLayer": "pave",
"paveCards": 12,
"card": None,
"sid": "pave",
"line": None,
}
def _card(at):
return {
"form": None,
"pill": None,
"paveLayer": None,
"paveCards": 0,
"card": at,
"sid": None,
"line": None if at is None else f"s{at}",
}
def test_1_목록_고름은_범위_카드_전부_종단_선_없음(flow) -> None:
assert flow["r1"] == PAVE
def test_2_형상_누름은_목록_고름과_같음(flow) -> None:
assert flow["r2first"] == PAVE # 처음부터 형상
assert flow["r2"] == PAVE # 카드 하나 고른 뒤 형상 = 옛 카드 풂
assert flow["r2reveal"] == "s40"
def test_3_카드_하나는_목록_고름과_범위_강조를_풂(flow) -> None:
assert flow["r3"] == _card(140)
assert flow["r3b"] == _card(100)
assert flow["r3re"] == _card(None) # 같은 카드 재누름 = 풂
pipe = flow["r3pipe"]
assert (pipe["form"], pipe["pill"], pipe["paveCards"], pipe["sid"]) == (
"pipe-80.17",
"pipe-80.17",
0,
None,
)
def test_누른_포장층은_범위_표식으로_그_노면공(shape) -> None:
assert shape["pave"] == "pave"
assert shape["pave2"] == "pave2" # 겹친 노면공 = 누른 층
for key in ("plainLayer", "outside", "noTarget", "unknown"):
assert shape[key] is None, key
def test_배선() -> None:
view = _read("B06_Section", "B06_Section_UI_Section_View.ts")
# 형상 누름은 카드 고름보다 먼저 가로챔(잡기 단계 · 전파 멈춤)
body = re.search(
r"const pave = pavementAt\(event\.target, spanMarks\);(.*?)true,\n", view, re.S
)
assert body, "형상 누름 배선 없음"
assert "event.stopPropagation();" in body.group(1)
assert "pavementSelectListener?.(pave.structure_id);" in body.group(1)
cross = _read("A00_Common", "design", "design_view_cross.ts")
assert (
"sectionView.setPavementSelectListener((id) => structuresPanel.selectStructure(id));"
in cross
)
# 카드 하나 고름 = 그 측점(구조물 id 는 목록 · 알약 · 넘김만)
assert "const preferred = structuresPanel.preferred() !== null;" in cross
assert (
"const picked = preferred ? opened : { chainageM: opened.chainageM, structureId: null };"
in cross
)
profile = _read("A00_Common", "design", "design_view_profile.ts")
assert "const structurePick = !!readSelection(activeProjectId)?.structureId;" in profile