feat(b06): 노면공 고름 = 범위 카드 전부 테두리 · 카드 하나 안 고름 · 첫 카드로 스크롤만 (177-4)
- applySpan 노면공도 --span · revealStation(리스너 없이 옛 카드 풂 · 폼 유지) - focusChainage revealOnly · 세션 고름은 패널이 직접 - test_165 · test_106 기대값 고침 · 새 시험 test_177_4_pavement_span_box Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015sDZSjFvoiDjdGpgj3muc3
This commit is contained in:
@@ -202,6 +202,13 @@ const view = {
|
||||
profile.showCard(CARDS.find((card) => card.station_id === this.selected) ?? null);
|
||||
if (this.selected !== previous) this.listener(this.selected);
|
||||
},
|
||||
revealed: null,
|
||||
revealStation(id) {
|
||||
// 노면공 목록 고름 = 카드 하나 안 고름 · 리스너 없이 풂 · 스크롤만(177-4 · Section_View `revealStation`)
|
||||
this.selected = null;
|
||||
profile.showCard(null);
|
||||
this.revealed = id;
|
||||
},
|
||||
focusStation(id) {
|
||||
if (id === null) this.selected = null;
|
||||
else if (this.selected !== id) this.selectStation(id);
|
||||
@@ -214,11 +221,12 @@ const view = {
|
||||
};
|
||||
|
||||
let wallSelecting = false;
|
||||
const focusStationAt = (at) => {
|
||||
const focusStationAt = (at, revealOnly = false) => {
|
||||
const nearest = CARDS.reduce((best, card) =>
|
||||
Math.abs(card.chainage_m - at) < Math.abs(best.chainage_m - at) ? card : best,
|
||||
);
|
||||
view.focusStation(nearest.station_id);
|
||||
if (revealOnly) view.revealStation(nearest.station_id);
|
||||
else view.focusStation(nearest.station_id);
|
||||
};
|
||||
|
||||
const current = { structures: [PAVE] };
|
||||
@@ -248,6 +256,7 @@ async function build(list) {
|
||||
form.id = null;
|
||||
form.pipe = null;
|
||||
view.selected = null;
|
||||
view.revealed = null;
|
||||
view.spanMarkId = null;
|
||||
profile.markedId = null;
|
||||
profile.pill = null;
|
||||
@@ -256,8 +265,8 @@ async function build(list) {
|
||||
shared: { view: () => "cross" },
|
||||
detail: () => ({ cross_sections: CARDS }),
|
||||
stationInterval: () => 20,
|
||||
focusChainage: (at) => {
|
||||
if (!wallSelecting) focusStationAt(at);
|
||||
focusChainage: (at, revealOnly) => {
|
||||
if (!wallSelecting) focusStationAt(at, revealOnly);
|
||||
},
|
||||
markStructure: (id) => view.selectMark(id),
|
||||
onMarks: (next, types) => {
|
||||
@@ -308,7 +317,11 @@ const wallPick = (cardAtM, ownerM) => {
|
||||
await build([PAVE, { structure_id: "sign", type_id: "hazard_sign", chainage_m: 127.86 }]);
|
||||
listPick("pave");
|
||||
out.step1 = snap();
|
||||
cardPick(40); // 고름이 이미 연 범위 첫 카드 재누름(브레인 ORCA ②)
|
||||
out.reveal1 = view.revealed; // 고르지 않고 스크롤만 한 카드(177-4)
|
||||
out.pick1 = selection.readSelection(PID);
|
||||
cardPick(40); // 스크롤만 한 범위 첫 카드 누름
|
||||
out.step2first = snap();
|
||||
cardPick(40); // 고른 범위 카드 재누름(167-3 · 브레인 ORCA ②)
|
||||
out.step2re = snap();
|
||||
cardPick(140);
|
||||
out.step2 = snap();
|
||||
@@ -318,6 +331,7 @@ const wallPick = (cardAtM, ownerM) => {
|
||||
out.step3 = snap();
|
||||
pillPick("pave");
|
||||
out.step4 = snap();
|
||||
out.reveal4 = view.revealed;
|
||||
cardPick(80); // 관 자리 카드 = 관(지금처럼)
|
||||
out.pipeCard = snap();
|
||||
pillPick("pave");
|
||||
@@ -339,6 +353,7 @@ const wallPick = (cardAtM, ownerM) => {
|
||||
await build([PAVE, PAVE2]);
|
||||
listPick("pave2");
|
||||
out.step6 = snap();
|
||||
out.reveal6 = view.revealed;
|
||||
cardPick(160);
|
||||
out.step6b = snap();
|
||||
process.stdout.write(JSON.stringify(out));
|
||||
|
||||
@@ -32,8 +32,8 @@ def test_범위_강조_클래스는_고름_목록갱신_카드재생성_세_길
|
||||
r"spanMarks = structures;\s+spanTypes = types;\s+syncSpanHighlights\(\);", VIEW
|
||||
)
|
||||
assert VIEW.count("applySpan(card, section);") == 2
|
||||
# 152-5 노면공(G군)은 테두리 대신 포장층
|
||||
assert 'card.classList.toggle("b06-cross-card--span", span && !pave);' in VIEW
|
||||
# 152-5 노면공(G군) 포장층 · 177-4 범위 카드 테두리도 함께
|
||||
assert 'card.classList.toggle("b06-cross-card--span", span);' in VIEW
|
||||
|
||||
|
||||
def test_측점_고름은_카드_하나_목록_고름은_여럿():
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"""165 B06 노면공 고름 일관성 — 조사 K 재현 차례 6단계.
|
||||
|
||||
못박는 것(단계마다 폼 · 알약 · 포장층 · 고른 카드 · 세션 sid 가 같은 것을 가리킴)
|
||||
1. 목록 노면공 = 범위 안 카드 · 포장층 · 알약 · 폼 · sid 모두 노면공(기준점이 범위 경계여도 범위 밖 카드로 안 감).
|
||||
1. 목록 노면공 = 포장층 · 알약 · 폼 · sid 모두 노면공 · 카드는 안 고름(스크롤만 · 177-4 · 기준점이 범위 경계여도 범위 밖 카드로 안 감).
|
||||
2. 범위 안 빈 카드(관 · 덮는 구조물 없음) = 노면공 그대로 · 카드만 옮김(165-1).
|
||||
3. 고른 카드의 벽 = 관 폼 + 관 알약(알약이 꺼진 채 폼만 남지 않음 · 165-2) · 포장층 풂.
|
||||
4. 알약 다시 = 1 과 같음. 관 자리 카드 = 관 · 범위 밖 카드 = 모두 풂(지금처럼).
|
||||
@@ -55,10 +55,12 @@ PIPE = {"form": "pipe-80.17", "pill": "pipe-80.17", "paveLayer": None, "paveCard
|
||||
|
||||
|
||||
def test_1_목록_노면공(out):
|
||||
assert out["step1"] == _pave(40) # 기준점 30 = 범위 경계 → 범위 안 첫 카드(20 아님)
|
||||
assert out["step1"] == _pave(None) # 카드 하나 안 고름(177-4)
|
||||
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)
|
||||
@@ -69,7 +71,7 @@ def test_3_벽은_관_폼과_관_알약_함께(out):
|
||||
|
||||
|
||||
def test_4_알약_다시_관_카드_범위_밖(out):
|
||||
assert out["step4"] == _pave(40)
|
||||
assert out["step4"] == _pave(None)
|
||||
assert out["pipeCard"] == {**PIPE, "card": 80, "sid": None}
|
||||
assert out["outside"] == {
|
||||
"form": None,
|
||||
@@ -83,17 +85,17 @@ def test_4_알약_다시_관_카드_범위_밖(out):
|
||||
|
||||
|
||||
def test_5_B05_복귀(out):
|
||||
assert out["step5"] == _pave(40)
|
||||
assert out["step5"] == _pave(None)
|
||||
|
||||
|
||||
def test_6_겹친_노면공(out):
|
||||
assert out["step6"] == _pave(100, "pave2", 6)
|
||||
assert out["step6"] == _pave(None, "pave2", 6)
|
||||
assert out["step6b"] == _pave(160, "pave2", 6)
|
||||
|
||||
|
||||
def test_배선():
|
||||
panel = _read("B06_Section", "B06_Section_UI_Page_Structures_Panel.ts")
|
||||
assert "deps.focusChainage(focusOf(structure));" in panel
|
||||
assert "deps.focusChainage(focusOf(structure), pave);" in panel
|
||||
assert "return { chainageM, structureId: openId };" in panel
|
||||
# 관 알약은 폼 뒤(폼이 연 구조물을 닫으며 알약을 끔)
|
||||
at = panel.index("section.selectPipeByChainage(hit.pipeChainageM);")
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""177-4 B06 노면공 목록 · 알약 고름 = 범위 카드 전부 테두리(박스) · 카드 하나 안 고름.
|
||||
|
||||
못박는 것
|
||||
- 노면공 고름 = 범위 안 카드 전부 `b06-cross-card--span`(다른 구간형과 같음) + 포장층 강조 그대로.
|
||||
- 카드 하나 고르기(`--selected`) 없음 · 범위 첫 카드로 스크롤만 · 옛 고른 카드는 리스너 없이 풂(폼 · 알약 유지).
|
||||
- 세션 고름은 노면공 + 스크롤한 카드 측점(B05 로 가도 그 노면공).
|
||||
|
||||
Node 헬퍼 `helper_165_pavement_flow.cjs`(진짜 SPN) 결과를 같이 씀. 화면은 사용자 확인.
|
||||
"""
|
||||
|
||||
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, "..", ".."))
|
||||
|
||||
|
||||
def _read(*parts: str) -> str:
|
||||
with open(os.path.join(ROOT, *parts), encoding="utf-8") as handle:
|
||||
return handle.read()
|
||||
|
||||
|
||||
@pytest.fixture(scope="module")
|
||||
def out():
|
||||
proc = subprocess.run(
|
||||
["node", os.path.join(HERE, "helper_165_pavement_flow.cjs")],
|
||||
capture_output=True,
|
||||
text=True,
|
||||
encoding="utf-8",
|
||||
timeout=60,
|
||||
)
|
||||
assert proc.returncode == 0, proc.stderr
|
||||
return json.loads(proc.stdout)
|
||||
|
||||
|
||||
def test_노면공_고름은_카드_안_고르고_스크롤만(out):
|
||||
for step, reveal, layer, cards in (
|
||||
("step1", "reveal1", "pave", 12),
|
||||
("step4", "reveal4", "pave", 12),
|
||||
("step6", "reveal6", "pave2", 6),
|
||||
):
|
||||
snap = out[step]
|
||||
assert snap["card"] is None # --selected 0
|
||||
assert snap["form"] == layer and snap["pill"] == layer # 폼 · 알약 유지
|
||||
assert snap["paveCards"] == cards # 범위 카드 전부
|
||||
assert out[reveal] in ("s40", "s100")
|
||||
assert out["pick1"] == {"chainageM": 40, "structureId": "pave"}
|
||||
|
||||
|
||||
def test_범위_카드_테두리는_노면공도():
|
||||
view = _read("B06_Section", "B06_Section_UI_Section_View.ts")
|
||||
assert 'card.classList.toggle("b06-cross-card--span", span);' in view
|
||||
assert "highlightPavement(card, pave ? mark : undefined);" in view
|
||||
|
||||
|
||||
def test_스크롤만_길은_리스너를_안_거침():
|
||||
view = _read("B06_Section", "B06_Section_UI_Section_View.ts")
|
||||
body = re.search(r"revealStation\(stationId\) \{(.*?)\n \},", view, re.S)
|
||||
assert body, "revealStation 없음"
|
||||
text = body.group(1)
|
||||
assert "selectedStationId = null;" in text
|
||||
assert "profile.showCard(null);" in text
|
||||
assert 'revealCard(stationId, "smooth");' in text
|
||||
assert "stationSelectListener" not in text # 폼을 닫지 않음
|
||||
cross = _read("A00_Common", "design", "design_view_cross.ts")
|
||||
assert "if (revealOnly) sectionView.revealStation(nearest.station_id);" in cross
|
||||
panel = _read("B06_Section", "B06_Section_UI_Page_Structures_Panel.ts")
|
||||
assert "const pave = !coverable(structure);" in panel
|
||||
assert 'if (pave) selectDesign(deps.projectId, at, { from: "b06" });' in panel
|
||||
Reference in New Issue
Block a user