From f154f57880e85ce45a0efe46105226d0ce317bce Mon Sep 17 00:00:00 2001 From: umsangdon Date: Sat, 17 Oct 2026 12:58:16 +0900 Subject: [PATCH] =?UTF-8?q?fix(B05=20=EC=A2=85=EB=8B=A8):=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80=20=EC=B8=A1=EC=A0=90=20=ED=99=94=EB=A9=B4=20=ED=99=95?= =?UTF-8?q?=EC=9D=B8=20=EA=B3=A0=EC=B9=A8=20=E2=80=94=20=EB=90=98=EB=8F=8C?= =?UTF-8?q?=EB=A6=AC=EA=B8=B0=20=EC=8B=A0=ED=98=B8=20=C2=B7=20=EC=97=B4=20?= =?UTF-8?q?=EB=95=8C=20=EB=8B=A4=EC=8B=9C=20=EB=A7=9E=EC=B6=A4=20=C2=B7=20?= =?UTF-8?q?=EC=98=9B=20=EC=B8=A1=EC=A0=90=20=EC=98=AE=EA=B8=B0=EA=B8=B0=20?= =?UTF-8?q?=EC=A0=9C=EC=99=B8=20(368-3)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 되돌리기 · 다시하기 뒤 추가 측점 바뀜 신호(다른 되살림 뒤 한 차례 늦춤) - 종단 보기 열 때 저장분 도착 뒤 측점 계획 다시 맞춤 - 옛 비정규 측점 옮기기(migrate)가 저장된 추가 측점을 「기타」 구조물로 만들던 흠 — 심는 자리에 추가 측점 포함 Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013QyNXY2TUKXCFMwAca2APG --- A00_Common/design/design_view_profile.ts | 7 +++++++ B05_Profile/B05_Profile_Api_PlusStations.ts | 7 ++++++- B05_Profile/B05_Profile_Structures_Router.py | 7 ++++++- resources/tester/test_368_2_plus_stations.py | 6 ++++++ 4 files changed, 25 insertions(+), 2 deletions(-) diff --git a/A00_Common/design/design_view_profile.ts b/A00_Common/design/design_view_profile.ts index eb68b34c7..2293d6b97 100644 --- a/A00_Common/design/design_view_profile.ts +++ b/A00_Common/design/design_view_profile.ts @@ -77,6 +77,11 @@ import "../../B05_Profile/B05_Profile_UI_Style_Drainage.css"; import "../../B05_Profile/B05_Profile_UI_Style_Structures.css"; import { movePipeId, pipeIdAt } from "./design_pipe_ids"; import { useDesignStore } from "./design_store"; +import { setPlusStations } from "../../common_util/common_util_structure_station"; +import { + loadSavedPlusStations, + plusStationsOf, +} from "../../B05_Profile/B05_Profile_Api_PlusStations"; import { followPipeReports } from "../../B05_Profile/logic/B05_Profile_Pipeline_Follow"; import { STRUCTURE_ROUTE_DRIFT_MAX_M } from "../../common_util/common_util_route_follow"; import { @@ -423,6 +428,8 @@ export async function mountProfileView( host.onDispose( useDesignStore(activeProjectId, null).subscribe("plusStations", () => bridge.resyncStations()), ); + setPlusStations(() => plusStationsOf(activeProjectId)); // 저장분이 늦게 와도 한 번 다시 맞춤 + void loadSavedPlusStations(activeProjectId).then(() => bridge.resyncStations()); // 한 페이지 두 보기 — 숨김 · 보임 · 떠남(계획서 24-3a · 24-3b). bindProfileViewLife(host, { projectId: activeProjectId, diff --git a/B05_Profile/B05_Profile_Api_PlusStations.ts b/B05_Profile/B05_Profile_Api_PlusStations.ts index 3f1ebd26c..dcec5bfbd 100644 --- a/B05_Profile/B05_Profile_Api_PlusStations.ts +++ b/B05_Profile/B05_Profile_Api_PlusStations.ts @@ -8,7 +8,8 @@ * ========================================================================== */ import { API_BASE_URL, API_TIMEOUT_MS } from "../config/config_frontend"; -import { useDesignStore } from "../A00_Common/design/design_store"; +import { draftProjectId, useDesignStore } from "../A00_Common/design/design_store"; +import { onPageHistory } from "./B05_Profile_UI_Profile_History"; const saved = new Map(); const loaded = new Map>(); @@ -50,6 +51,10 @@ function notify(projectId: string): void { useDesignStore(projectId, null).set("plusStations", readPlusDraft(projectId)); } +// 되돌리기 · 다시하기는 세션을 바로 되씀 — 바뀜 신호를 다시 냄(종단 측점선 · B06 목록) · 다른 되살림이 +// 측점 목록을 다시 세운 뒤(같은 차례 안에서 덮이지 않게) +onPageHistory({ restore: () => void setTimeout(() => notify(draftProjectId()), 0) }); + /** 저장분을 한 번 받음(못 받으면 빈 목록) — 읽는 곳 두기(`setPlusStations`)는 횡단 상세 가게 몫. */ export function loadSavedPlusStations(projectId: string): Promise { if (!loaded.has(projectId)) diff --git a/B05_Profile/B05_Profile_Structures_Router.py b/B05_Profile/B05_Profile_Structures_Router.py index 0b1e81ab1..d425b0240 100644 --- a/B05_Profile/B05_Profile_Structures_Router.py +++ b/B05_Profile/B05_Profile_Structures_Router.py @@ -256,10 +256,15 @@ async def migrate_structures(project_id: UUID, payload: StructureMigrateRequest) revision, existing = load_structures(root) migrated_before = load_migrated_legacy(root) # 정본이 이미 심는 자리(측점 계획 · 323-7) — 이름이 아니라 자리로 가름(옛 이름 되짚기 걷음) + # · 추가 측점(368-2 · 이름 없는 일반측점)도 심는 자리 — 「기타」 구조물로 옮기지 않음 + from B05_Profile.B05_Profile_Plus_Stations import plus_chainages + planted = [ float(station["chainage_m"]) for station in plan_stations( - read_pipe_points_file(pipe_points_path_in(Path(root))), existing + read_pipe_points_file(pipe_points_path_in(Path(root))), + existing, + plus_chainages(root), ) ] plan = migrate_irregular_stations(payload.stations, planted) diff --git a/resources/tester/test_368_2_plus_stations.py b/resources/tester/test_368_2_plus_stations.py index 5a6c3fc72..6f0db4116 100644 --- a/resources/tester/test_368_2_plus_stations.py +++ b/resources/tester/test_368_2_plus_stations.py @@ -37,3 +37,9 @@ def test_저장_차례_계획고_앞() -> None: save = (ROOT / "A00_Common/design/design_save.ts").read_text(encoding="utf-8") order = save[save.index("DESIGN_SAVE_ORDER = [") :] assert order.index('"structures"') < order.index('"plusStations"') < order.index('"alignment"') + +def test_옛_측점_옮기기는_추가_측점을_구조물로_안_만듦() -> None: + # 저장된 추가 측점 = 이름 "" 비정규 측점 — 옛 자유 글 옮기기가 「기타」 구조물로 바꾸면 안 됨 + router = (ROOT / "B05_Profile/B05_Profile_Structures_Router.py").read_text(encoding="utf-8") + block = router[router.index("async def migrate_structures") :] + assert "plus_chainages(root)" in block[: block.index("migrate_irregular_stations(")]