From 79c53be5d3e6388ce9fa86b0cefb6c600408cffc Mon Sep 17 00:00:00 2001 From: umsangdon Date: Mon, 2 Nov 2026 23:32:05 +0900 Subject: [PATCH] =?UTF-8?q?fix(754-2):=20B05/B06=20=EA=B5=AC=EC=A1=B0?= =?UTF-8?q?=EB=AC=BC=20=ED=8F=BC=20=E2=80=94=20=EC=A2=85=EB=A5=98=20?= =?UTF-8?q?=EB=AA=A9=EB=A1=9D=EC=9D=B4=20=EB=8A=A6=EA=B2=8C=20=EC=99=80?= =?UTF-8?q?=EB=8F=84=20=EA=B3=A0=EB=A5=B8=20=EA=B4=80=20=ED=8F=BC=20?= =?UTF-8?q?=EB=8B=A4=EC=8B=9C=20=EC=97=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 까닭: 공용 폼 setTypes 가 군 · 종류를 빈칸으로 돌리고 고른 관(selectedPipeChainage)은 남김 · B06 에서 관 고른 뒤 처음 B05 를 열면(B05 보기 첫 구조물 불러오기) 5/5 빈 폼 · B05 에서 종류 받기 전 관을 누르면 3/5 빈 폼(카드 · 목록 고름은 남고 종류 목록 0) - 고침: setTypes 끝에서 고른 관이 있으면 그 관 폼 다시 엶 · 임시 배치 중은 둠 · 구조물 폼은 뒤따르는 setStructures 가 이미 다시 엶 - 시험: test_754_2_types_late_form.py - 검증: 새 탭 54 번(B05 · B06 시작 · 이른/늦은 고름 · 예정노선 수정 켬끔 · 새로고침) 빈 폼 0 Co-Authored-By: Claude Opus 5.5 --- .../B05_Profile_UI_Structures_Panel.ts | 8 ++++ .../tester/test_754_2_types_late_form.py | 37 +++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 resources/tester/test_754_2_types_late_form.py diff --git a/B05_Profile/B05_Profile_UI_Structures_Panel.ts b/B05_Profile/B05_Profile_UI_Structures_Panel.ts index e6342c6ee..03cf5124a 100644 --- a/B05_Profile/B05_Profile_UI_Structures_Panel.ts +++ b/B05_Profile/B05_Profile_UI_Structures_Panel.ts @@ -557,6 +557,14 @@ export function createStructuresSection( groupSelect.replaceChildren(new Option("— 선택 —", ""), ...groupOptions(next, pick)); groupSelect.value = ""; syncTypeOptions(); + // 늦게 온 종류 목록 = 고른 관 폼을 새 목록으로 다시 엶 — 고름만 남고 폼이 비던 흠(754-2) · + // 구조물 폼은 뒤따르는 `setStructures` 가 다시 엶 · 임시 배치 중 입력은 둠 + if (tempPipeChainage !== null) return; + const at = selectedPipeChainage; + const pipe = pipeFacilities.find( + (entry) => at !== null && Math.abs(entry.chainage_m - at) < PIPE_MATCH_M, + ); + if (pipe) loadPipeForm(pipe); }, setStructures(next) { // 서버 정본 주입 — onChange를 울리지 않는다. 울리면 Page가 다시 저장을 걸어 diff --git a/resources/tester/test_754_2_types_late_form.py b/resources/tester/test_754_2_types_late_form.py new file mode 100644 index 000000000..0f45c9c65 --- /dev/null +++ b/resources/tester/test_754_2_types_late_form.py @@ -0,0 +1,37 @@ +"""PLAN 754-2 — 구조물 종류 목록이 늦게 와도(`setTypes`) 고른 관 폼이 비지 않음. + +B05 · B06 한 폼(`B05_Profile_UI_Structures_Panel.ts`)을 두 보기가 따로 불러 `setTypes` 를 부름 — +종류 목록을 다시 세우며 군 · 종류를 빈칸으로 돌리므로, 고름이 남아 있으면 그 폼을 다시 열어야 함. +""" + +from __future__ import annotations + +import os +import re + +ROOT = os.path.join(os.path.dirname(__file__), "..", "..") + + +def _set_types_body() -> str: + path = os.path.join(ROOT, "B05_Profile", "B05_Profile_UI_Structures_Panel.ts") + with open(path, encoding="utf-8") as f: + src = f.read() + match = re.search( + r"\n setTypes\(next, pick = \(\) => true\) \{\n(.*?)\n \},\n", src, re.S + ) + assert match, "setTypes 본문을 못 찾음" + return match.group(1) + + +def test_종류를_다시_세운_뒤_고른_관_폼을_다시_엶() -> None: + body = _set_types_body() + reset = body.index("syncTypeOptions();") + assert body.index("loadPipeForm(pipe)", reset) > reset + assert "selectedPipeChainage" in body[reset:] + + +def test_임시_배치_중이면_폼을_다시_열지_않음() -> None: + """임시 배치(A군 우클릭 추가) 중 입력을 지우지 않게 — 옛 동작 그대로.""" + body = _set_types_body() + reset = body.index("syncTypeOptions();") + assert body.index("tempPipeChainage !== null", reset) < body.index("loadPipeForm(pipe)")