From fd1fc8b40122223b2b2bf1917d093f1aff62922c Mon Sep 17 00:00:00 2001 From: umsangdon Date: Wed, 7 Oct 2026 20:52:52 +0900 Subject: [PATCH] =?UTF-8?q?fix(B05=C2=B7B06):=20=EB=85=B8=EC=84=A0=20[?= =?UTF-8?q?=ED=99=95=EC=9D=B8]=20=C2=B7=20[=EC=B4=88=EA=B8=B0=ED=99=94]=20?= =?UTF-8?q?=EB=92=A4=20=EC=98=9B=20=EC=BA=90=EC=8B=9C=20=EC=A0=84=EB=B6=80?= =?UTF-8?q?=20=EB=B2=84=EB=A6=AC=EA=B3=A0=20=ED=8E=98=EC=9D=B4=EC=A7=80=20?= =?UTF-8?q?=ED=86=B5=EC=A7=B8=EB=A1=9C=20=EB=8B=A4=EC=8B=9C=20=EC=9D=BD?= =?UTF-8?q?=EC=9D=8C(77)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 제자리 다시 세우기는 옛 노선 관 목록 등 메모리 · 진행 중 요청이 살아남아 다음 [저장]에 옛 관 위치가 실림(랩탑 메인 pipe_points.json 이 옛 노선 264 측점으로 덮임) - [초기화]도 모든 노선의 초안 · 결과를 버림(복원은 새 노선 번호) Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_019EMfGERKUg5nMMNQsyVZ2j --- A00_Common/design/design_reset.ts | 13 +++++++------ A00_Common/design/design_view_profile.ts | 8 ++++---- resources/tester/test_design_page_single.py | 12 +++++++----- 3 files changed, 18 insertions(+), 15 deletions(-) diff --git a/A00_Common/design/design_reset.ts b/A00_Common/design/design_reset.ts index 4c92ccb87..050f9bc49 100644 --- a/A00_Common/design/design_reset.ts +++ b/A00_Common/design/design_reset.ts @@ -7,7 +7,6 @@ * 확인받는다. (`B05_Profile_UI_Page_Actions.resetDesignAction` 에서 옮겨 왔다 — 동작 그대로.) * ========================================================================== */ -import { ROUTES } from "@config/config_frontend"; import { currentLanguageIndex, ui_locales } from "@ui/ui_template_locale"; import { hideLoadingOverlay, @@ -15,8 +14,7 @@ import { showLoadingOverlay, showToast, } from "@ui/ui_template_elements"; -import { clearDrafts } from "./../b_page_state"; -import { remountRoute } from "./../router"; +import { clearDrafts, clearResults } from "./../b_page_state"; import { clearRouteLatestCache, resetRouteDesign } from "../../B05_Profile/B05_Profile_Api_Fetch"; import { clearAlignmentDrafts } from "../../B05_Profile/B05_Profile_UI_Profile_Edit"; import { invalidateSectionDetail } from "../../B06_Section/B06_Section_Section_Store"; @@ -31,7 +29,7 @@ function L(key: keyof typeof ui_locales): string { */ export async function resetDesign( projectId: string, - routeId: number | null, + _routeId: number | null, onCleared?: () => void, ): Promise { if (!(await showConfirmDialog(L("B05_Route_Reset_Confirm"), "초기화"))) return; @@ -44,13 +42,16 @@ export async function resetDesign( // 사용자 조작(② 초안)은 **등록표 한 곳**에서 통째로 버린다(2026-09-06 일원화). // 예전에는 파일마다 따로 지워 새 값이 늘 때 빠뜨리기 쉬웠다. 노선 범위 초안은 // 노선이 바뀌면 키가 달라져 자연히 딸려 오지 않는다. - clearDrafts(projectId, routeId); + // 복원은 새 노선 번호를 내므로 모든 노선의 초안 · 결과를 버린다(PLAN 77). + clearDrafts(projectId); + clearResults(projectId); onCleared?.(); // 계획선 편집 초안도 함께 버린다 — 남기면 초기값 위에 옛 편집이 다시 얹혀 계획선이 // 측점에서 원지반선과 만나지 않는다(2026-09-04 실측: 새로고침 후 최대 6.0m 어긋남). clearAlignmentDrafts(); showToast(L("B05_Route_Reset_Success"), "success"); - remountRoute(ROUTES.B05_PROFILE); // 같은 페이지라도 다시 세운다 — 보기만 바꾸면 옛 화면이 남음 + // 페이지를 통째로 다시 읽는다 — 제자리 다시 세우기는 옛 메모리 · 진행 중 요청이 남음(PLAN 77). + location.reload(); } catch (error) { showToast(error instanceof Error ? error.message : L("B05_Route_Reset_Failed"), "error"); } finally { diff --git a/A00_Common/design/design_view_profile.ts b/A00_Common/design/design_view_profile.ts index 809e502dc..d29b60ecb 100644 --- a/A00_Common/design/design_view_profile.ts +++ b/A00_Common/design/design_view_profile.ts @@ -8,7 +8,6 @@ * `_Page_Latest`, 3D 측점 바는 `_Page_Stations`, 숨김 · 보임은 `_Page_Life` 가 맡는다.) * ========================================================================== */ -import { ROUTES } from "@config/config_frontend"; import { showToast } from "@ui/ui_template_elements"; import { purgeOtherProjects } from "../b_asset_cache"; import { createProgressCircle } from "@ui/ui_template_progress"; @@ -240,10 +239,11 @@ export async function mountProfileView( const panel = createRoutePanel( { - // 계획노선 편집 — 모달 [확인]에서 서버가 배수유역부터 다시 계산하므로, 끝나면 - // 옛 노선 기준 캐시를 버리고 페이지를 새로 세운다([초기화]와 같은 뒷정리). + // 계획노선 편집 — 모달 [확인]에서 서버가 배수유역부터 다시 계산하고 그 결과가 새 초기값이 + // 된다. 옛 노선 캐시는 모달이 비우고, 페이지는 통째로 다시 읽는다 — 제자리 다시 세우기는 + // 옛 노선 관 목록 등 메모리 · 진행 중 요청이 살아남아 [저장]에 실렸다(PLAN 77). onEditPlannedRoute: () => - void openRouteEditModal(activeProjectId, () => remountRoute(ROUTES.B05_PROFILE), { + void openRouteEditModal(activeProjectId, () => location.reload(), { // 측점 눈금 간격은 좌측 패널이 쥔 값을 그대로 넘긴다 — 모달이 따로 굳히지 않는다. stationIntervalM: panel.values().stationInterval ?? undefined, // 바탕 등고선 — 확정 지표면이 있으면 모달이 LAS 등고선을 쓴다(계획서 0-9 ⑥). diff --git a/resources/tester/test_design_page_single.py b/resources/tester/test_design_page_single.py index 6cdbdd9a3..47e57b4d2 100644 --- a/resources/tester/test_design_page_single.py +++ b/resources/tester/test_design_page_single.py @@ -97,11 +97,13 @@ def test_진행_단계_두_칸이_보기를_따라감(): def test_초기화_계획노선_편집은_다시_세움(): - """같은 페이지 안 이동은 보기만 바꾸므로 [초기화] · 계획노선 편집은 페이지를 다시 세운다.""" - router = _read("A00_Common/router.ts") - assert "export function remountRoute(" in router - assert "remountRoute(ROUTES.B05_PROFILE)" in _read("A00_Common/design/design_reset.ts") - assert "remountRoute(ROUTES.B05_PROFILE)" in _read("A00_Common/design/design_view_profile.ts") + """[초기화] · 계획노선 편집 [확인] = 새 초기값 — 옛 캐시를 다 버리고 페이지를 통째로 다시 읽는다(PLAN 77).""" + reset = _read("A00_Common/design/design_reset.ts") + assert "clearDrafts(projectId);" in reset and "clearResults(projectId);" in reset + assert "location.reload()" in reset + assert "openRouteEditModal(activeProjectId, () => location.reload()" in _read( + "A00_Common/design/design_view_profile.ts" + ) def test_종단_보기_확정은_횡단_보기를_숨긴_채_세움():