fix(B05·B06): 노선 [확인] · [초기화] 뒤 옛 캐시 전부 버리고 페이지 통째로 다시 읽음(77)
- 제자리 다시 세우기는 옛 노선 관 목록 등 메모리 · 진행 중 요청이 살아남아 다음 [저장]에 옛 관 위치가 실림(랩탑 메인 pipe_points.json 이 옛 노선 264 측점으로 덮임) - [초기화]도 모든 노선의 초안 · 결과를 버림(복원은 새 노선 번호) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019EMfGERKUg5nMMNQsyVZ2j
This commit is contained in:
@@ -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<void> {
|
||||
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 {
|
||||
|
||||
@@ -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 ⑥).
|
||||
|
||||
@@ -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_종단_보기_확정은_횡단_보기를_숨긴_채_세움():
|
||||
|
||||
Reference in New Issue
Block a user