diff --git a/B05_Profile/B05_Profile_UI_RouteEdit_Apply.ts b/B05_Profile/B05_Profile_UI_RouteEdit_Apply.ts index 38a350737..bd43901b7 100644 --- a/B05_Profile/B05_Profile_UI_RouteEdit_Apply.ts +++ b/B05_Profile/B05_Profile_UI_RouteEdit_Apply.ts @@ -150,7 +150,7 @@ export async function carryAfterRouteSave( invalidateSectionDetail(projectId, toRouteId); const detail = await loadSectionDetail(projectId, toRouteId); useStationKeys(projectId, toRouteId, detail); - const outside = carryStationDrafts(projectId, fromRouteId, toRouteId); + const outside = carryStationDrafts(projectId, fromRouteId, toRouteId, { quiet: true }); await saveCachedCrossPatches(projectId, toRouteId); return outside; } diff --git a/B06_Section/B06_Section_Station_Keys.ts b/B06_Section/B06_Section_Station_Keys.ts index 6710c8db1..f6c1cb6ae 100644 --- a/B06_Section/B06_Section_Station_Keys.ts +++ b/B06_Section/B06_Section_Station_Keys.ts @@ -273,11 +273,13 @@ export function writeKeyed( * 노선이 바뀜(새 측점 목록을 `useStationKeys` 로 세운 뒤) — 옛 노선 고침을 측점 열쇠로 새 노선에 넘김. * 넘김 = 카드 선택 넷(지반 유형 · 측구 종류 · 측구 선택 · 2단 경사) · 암 경계 · 암 경사 · 단면 유형 · 측구 * 방향은 새 지형이 정함 · 노견 확장 · 소단 깊이는 안 넘김. 돌려주는 값 = 노선 밖으로 나간 고침 수(측점 단위). + * `quiet` = 알림 없이 수만 돌려줌(부르는 쪽이 결과 한 줄에 합칠 때). */ export function carryStationDrafts( projectId: string, fromRouteId: number, toRouteId: number, + { quiet = false }: { quiet?: boolean } = {}, ): number { const outside = new Set(); for (const name of KEYED_STATES) { @@ -301,7 +303,7 @@ export function carryStationDrafts( } writeState(name, next, projectId, toRouteId); } - if (outside.size) + if (outside.size && !quiet) showToast(`노선 밖 고침 ${outside.size} 건 — 사라진 측점이라 버렸습니다.`, "info"); return outside.size; } diff --git a/resources/tester/helper_346_3_route_save.cjs b/resources/tester/helper_346_3_route_save.cjs index 9cd166030..149d689b1 100644 --- a/resources/tester/helper_346_3_route_save.cjs +++ b/resources/tester/helper_346_3_route_save.cjs @@ -43,7 +43,10 @@ const STUBS = { }, "../B06_Section/B06_Section_Station_Keys": { useStationKeys: (_p, routeId, detail) => calls.push(`keys:${routeId}:${detail.tag}`), - carryStationDrafts: (_p, from, to) => (calls.push(`carry:${from}->${to}`), 2), + carryStationDrafts: (_p, from, to, opts) => ( + calls.push(`carry:${from}->${to}${opts?.quiet ? ":quiet" : ""}`), + 2 + ), }, "./B05_Profile_Api_Fetch": { clearRouteLatestCache: () => calls.push("latest:clear") }, "./B05_Profile_Api_Replan": { diff --git a/resources/tester/test_346_3_route_save_screen.py b/resources/tester/test_346_3_route_save_screen.py index 154d25cb4..850545e9c 100644 --- a/resources/tester/test_346_3_route_save_screen.py +++ b/resources/tester/test_346_3_route_save_screen.py @@ -72,7 +72,13 @@ def test_저장_뒤_가게_초안_비움_결과_한_줄(out): def test_초안_넘김_차례(out): - assert out["carryCalls"] == ["invalidate:9", "load:9", "keys:9:9", "carry:7->9", "crossSave:9"] + assert out["carryCalls"] == [ + "invalidate:9", + "load:9", + "keys:9:9", + "carry:7->9:quiet", + "crossSave:9", + ] assert out["outside"] == 2 @@ -107,3 +113,25 @@ def test_노선_반영_단추_없앰_배선(): assert "saveRecommendedRoute(" in initial[at : at + 900] replan = _read("B05_Profile/B05_Profile_Api_Replan.ts") assert "body: JSON.stringify(body)" in replan and "as_initial?: boolean;" in replan + + +def test_넘김_알림은_결과_한_줄에_합침(): + """346-3 덧 — [저장] 뒤 「노선 밖 고침」 두 줄 → 한 줄 · 넘김은 조용히 수만 · 기본은 알림 그대로.""" + keys = _read("B06_Section/B06_Section_Station_Keys.ts") + assert "{ quiet = false }: { quiet?: boolean } = {}," in keys + assert "if (outside.size && !quiet)" in keys + apply = _read("B05_Profile/B05_Profile_UI_RouteEdit_Apply.ts") + assert "carryStationDrafts(projectId, fromRouteId, toRouteId, { quiet: true })" in apply + + +def test_노선_반영_글자_없음(): + recommend = _read("B05_Profile/B05_Profile_UI_Panel_Recommend.ts") + assert "노선 반영" not in recommend and "다시 계산은 [저장]에서" in recommend + for rel in ( + "B05_Profile/B05_Profile_UI_RouteEdit.ts", + "B05_Profile/B05_Profile_UI_RouteEdit_History.ts", + "B05_Profile/B05_Profile_UI_RouteEdit_Draft.ts", + "A00_Common/design/design_view_profile.ts", + ): + text = _read(rel) + assert "[노선 반영]" not in text and "[반영 전으로]" not in text, rel