From a3d24cf494d3477bf5b24ea0b02db3e3853f84c8 Mon Sep 17 00:00:00 2001 From: umsangdon Date: Mon, 19 Oct 2026 12:34:38 +0900 Subject: [PATCH] =?UTF-8?q?fix(472-6=206-B=20=EC=A0=80=EC=9E=A5=20?= =?UTF-8?q?=EB=92=A4=20=EC=B4=88=EC=95=88=20=EB=90=98=EC=94=80):=20?= =?UTF-8?q?=EB=85=B8=EC=84=A0=20=EC=A0=80=EC=9E=A5=20=EC=84=B1=EA=B3=B5=20?= =?UTF-8?q?=EB=92=A4=20=EB=AC=B6=EC=9D=8C=EC=9D=B4=20=EB=85=B8=EC=84=A0=20?= =?UTF-8?q?=EC=B4=88=EC=95=88=20=EB=B9=84=EC=9B=80=EC=9D=84=20=E3=80=8C?= =?UTF-8?q?=EB=B2=84=EB=A6=BC=E3=80=8D=EC=9C=BC=EB=A1=9C=20=EB=B3=B4?= =?UTF-8?q?=EA=B3=A0=20=EC=B4=88=EC=95=88=20=EC=A0=84=20=EA=B4=80=20=C2=B7?= =?UTF-8?q?=20=EA=B5=AC=EC=A1=B0=EB=AC=BC=20=EC=B4=88=EC=95=88=EC=9D=84=20?= =?UTF-8?q?=EC=84=B8=EC=85=98=EC=97=90=20=EB=90=98=EC=93=B0=EB=8D=98=20?= =?UTF-8?q?=ED=9D=A0=20=E2=80=94=20=EC=A0=80=EC=9E=A5=EC=9D=B4=EB=A9=B4=20?= =?UTF-8?q?=EC=B4=88=EC=95=88=20=EC=A0=84=20=EA=B0=92=20=EB=B2=84=EB=A6=BC?= =?UTF-8?q?(commitRouteFacilities)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 화면 검증(검증_sub8)에서 찾음 — 저장 뒤 옹벽 초안이 끌기 전 자리(600)로 남아 다음 [저장]이 옛 자리로 되돌릴 뻔함 - design_pipeline_page 네 줄(commit) · routeSaved 가 노선 초안 비우기 전에 부름 · 시험 test_472_6_route_save Co-Authored-By: Claude Opus 5.5 --- A00_Common/design/design_pipeline_page.ts | 5 +++++ B05_Profile/B05_Profile_UI_RouteEdit_Apply.ts | 7 +++++-- resources/tester/helper_346_3_route_save.cjs | 3 +++ resources/tester/test_346_3_route_save_screen.py | 2 +- resources/tester/test_472_6_route_save.py | 12 ++++++++++++ 5 files changed, 26 insertions(+), 3 deletions(-) diff --git a/A00_Common/design/design_pipeline_page.ts b/A00_Common/design/design_pipeline_page.ts index 6cdf39e0a..da979040d 100644 --- a/A00_Common/design/design_pipeline_page.ts +++ b/A00_Common/design/design_pipeline_page.ts @@ -128,6 +128,7 @@ interface PagePipeline { reconcile(): Promise; ownsCross: boolean; detail(): SectionDetailResponse | null; + commit(): void; dispose(): void; } @@ -177,6 +178,9 @@ export const pipelineDetail = (projectId: string): SectionDetailResponse | null export const pagePipeline = (projectId: string): DesignPipeline | null => pages.get(projectId)?.pipe ?? null; +/** 노선 초안을 저장함(472-6 6-B) — 초안 전 관 · 구조물을 버림(노선 초안이 비어도 「버림」 되돌림 안 함). */ +export const commitRouteFacilities = (projectId: string): void => pages.get(projectId)?.commit(); + export function disposePagePipeline(projectId: string): void { pages.get(projectId)?.dispose(); pages.delete(projectId); @@ -639,6 +643,7 @@ function createPagePipeline( reconcile, ownsCross: Boolean(options.savedCross), detail: () => draftDetailOf(projectId), + commit: () => void (beforeDraft = null), dispose() { disposed = true; setDraftSectionDetail(projectId, null); diff --git a/B05_Profile/B05_Profile_UI_RouteEdit_Apply.ts b/B05_Profile/B05_Profile_UI_RouteEdit_Apply.ts index 7e2ef3ed6..6bcaaa925 100644 --- a/B05_Profile/B05_Profile_UI_RouteEdit_Apply.ts +++ b/B05_Profile/B05_Profile_UI_RouteEdit_Apply.ts @@ -14,6 +14,7 @@ import { clearDrafts, clearResults, clearState, readState } from "../A00_Common/b_page_state"; import type { RouteDraft } from "../A00_Common/design/logic/design_pipeline_types"; import { useDesignStore } from "../A00_Common/design/design_store"; +import { commitRouteFacilities } from "../A00_Common/design/design_pipeline_page"; import { currentRoute, remountRoute } from "../A00_Common/router"; import { hideLoadingOverlay, showLoadingOverlay, showToast } from "@ui/ui_template_elements"; import { invalidateSectionDetail } from "../B06_Section/B06_Section_Section_Store"; @@ -126,9 +127,11 @@ export async function saveRouteDraft( return saved; } -/** 노선을 저장함(서버가 다 저장한 뒤) — 가게 노선 초안 비움 · 조회 결과 캐시 비움(옛 노선 것 · 추천은 새 노선의 - * 출발점이라 다시 적음) · 편집기 「저장됨」. */ +/** 노선을 저장함(서버가 다 저장한 뒤) — 묶음의 초안 전 관 · 구조물 버림(초안 비움을 「버림」으로 되돌리지 않게 · + * 저장한 초안 자리가 정본) · 가게 노선 초안 비움 · 조회 결과 캐시 비움(옛 노선 것 · 추천은 새 노선의 출발점이라 + * 다시 적음) · 편집기 「저장됨」. */ export function routeSaved(projectId: string): void { + commitRouteFacilities(projectId); useDesignStore(projectId, null).set("routeDraft", null); clearResults(projectId); sources.get(projectId)?.saved(); diff --git a/resources/tester/helper_346_3_route_save.cjs b/resources/tester/helper_346_3_route_save.cjs index 18c47a8a6..c62dae2f8 100644 --- a/resources/tester/helper_346_3_route_save.cjs +++ b/resources/tester/helper_346_3_route_save.cjs @@ -36,6 +36,9 @@ const STUBS = { currentRoute: () => "b05-profile", remountRoute: () => calls.push("remount"), }, + "../A00_Common/design/design_pipeline_page": { + commitRouteFacilities: () => calls.push("commit"), // 저장 = 초안 전 관 · 구조물 버림(6-B) + }, "../B06_Section/B06_Section_Section_Store": { invalidateSectionDetail: (_p, routeId) => calls.push(`invalidate:${routeId ?? "all"}`), }, diff --git a/resources/tester/test_346_3_route_save_screen.py b/resources/tester/test_346_3_route_save_screen.py index a4694728b..fcf477f9b 100644 --- a/resources/tester/test_346_3_route_save_screen.py +++ b/resources/tester/test_346_3_route_save_screen.py @@ -94,7 +94,7 @@ def test_추천_적용은_as_initial_저장_뒤_다시_세움(out): assert body["as_initial"] is True and body["initial"] == {"mode": "earthwork"} assert body["draft"]["nodes"] == [[1, 1], [9, 9]] # 잠금 막 하나(472-6 6-B — 저장 직전 저장 관 떠 두기는 서버 한 본문 몫 · 추천은 초안을 비우니 안 받음) - assert out["recommendCalls"] == ["overlay:on", "replan", "overlay:off"] + assert out["recommendCalls"] == ["overlay:on", "replan", "commit", "overlay:off"] # 초안 전 시설 버림 assert out["recommendDraftsLeft"] == {"route": None, "pipes": None} # 새 초기값에서 다시 assert out["rebuilt"] == 1 diff --git a/resources/tester/test_472_6_route_save.py b/resources/tester/test_472_6_route_save.py index 2f736fc16..fd40a72be 100644 --- a/resources/tester/test_472_6_route_save.py +++ b/resources/tester/test_472_6_route_save.py @@ -378,3 +378,15 @@ def test_정상_한_본문은_옛_차례와_같음() -> None: asyncio.run(undo()) files.discard() assert _state(ROOT_DIR) == start + + +def test_저장한_노선_초안은_버림으로_되돌리지_않음() -> None: + """화면 흠(6-B 화면 검증) — 저장 뒤 노선 초안 칸을 비우면 묶음이 「초안 버림」으로 보고 초안 전 관 · + 구조물 초안을 세션에 되써 다음 [저장]이 옛 자리로 되돌렸음 → 저장 성공이면 초안 전 값을 버림(commit).""" + apply = (ROOT / "B05_Profile" / "B05_Profile_UI_RouteEdit_Apply.ts").read_text(encoding="utf-8") + body = apply[apply.index("export function routeSaved") :] + body = body[: body.index("\n}\n")] + assert body.index("commitRouteFacilities(projectId);") < body.index('set("routeDraft", null)') + page = (ROOT / "A00_Common" / "design" / "design_pipeline_page.ts").read_text(encoding="utf-8") + assert "commit: () => void (beforeDraft = null)," in page + assert "if (!beforeDraft) return;" in page # 버린 차례 = 초안 전 값이 있을 때만 되씀