fix(B05 종단): 추가 측점 화면 확인 고침 — 되돌리기 신호 · 열 때 다시 맞춤 · 옛 측점 옮기기 제외 (368-3)

- 되돌리기 · 다시하기 뒤 추가 측점 바뀜 신호(다른 되살림 뒤 한 차례 늦춤)
- 종단 보기 열 때 저장분 도착 뒤 측점 계획 다시 맞춤
- 옛 비정규 측점 옮기기(migrate)가 저장된 추가 측점을 「기타」 구조물로 만들던 흠 — 심는 자리에 추가 측점 포함

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013QyNXY2TUKXCFMwAca2APG
This commit is contained in:
2026-10-17 12:58:16 +09:00
co-authored by Claude Opus 5.5
parent c8be383428
commit f154f57880
4 changed files with 25 additions and 2 deletions
+7
View File
@@ -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,
+6 -1
View File
@@ -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<string, number[]>();
const loaded = new Map<string, Promise<void>>();
@@ -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<void> {
if (!loaded.has(projectId))
+6 -1
View File
@@ -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)
@@ -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(")]