feat(775-2): B05 예정노선 수정 끝 — 지금 편집기 곡선 수를 keep_curves 로 넘김 · 못 지키면 curve_note 안내 토스트

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-03 20:46:23 +09:00
co-authored by Claude Opus 5.5
parent 3c28a15ce5
commit a04a8f4223
2 changed files with 12 additions and 2 deletions
+11 -2
View File
@@ -49,7 +49,10 @@ const HELD =
"예정노선 수정 중 — 「예정노선 수정」을 끈 뒤 [저장]합니다(켠 동안 고친 판은 끌 때 평면선에 들어감).";
/** `POST /route/follow` 응답 — GET `/route/plan` 칸 이름(626-2). */
type FollowResponse = Pick<RoutePlanResponse, "planned" | "nodes" | "curves" | "node_edits">;
type FollowResponse = Pick<RoutePlanResponse, "planned" | "nodes" | "curves" | "node_edits"> & {
/** 수정 전 곡선 수를 못 지켰을 때 안내 글(775-2) · 지켰으면 null. */
curve_note?: string | null;
};
export interface ExpectedDrawParams {
projectId: string;
@@ -71,6 +74,8 @@ export interface ExpectedDrawParams {
onHistory: () => void;
/** 다시 추적한 평면 · 고친 예정노선(빈 = 받은 노선으로) — 편집기 한 걸음. */
onFollow: (plan: FlattenedPlan, expected: Vertex[]) => void;
/** 지금 편집기 곡선 수(저장 안 한 편집 포함) — 다시 추적이 지킬 곡선 수(775-2 `keep_curves`). */
curveCount: () => number;
}
export interface ExpectedDraw {
@@ -325,13 +330,17 @@ export function createExpectedDraw(params: ExpectedDrawParams): ExpectedDraw {
try {
const plan = await requestJson<FollowResponse>(
`/projects/${params.projectId}/route/follow`,
{ method: "POST", body: JSON.stringify({ points, crs: "tm" }) },
{
method: "POST",
body: JSON.stringify({ points, crs: "tm", keep_curves: params.curveCount() || null }),
},
60000,
);
params.onFollow(
flattenServerPlan(plan.nodes ?? [], plan.curves ?? [], plan.node_edits),
expected,
);
if (plan.curve_note) showToast(plan.curve_note, "info");
return true;
} catch (error) {
showToast(
+1
View File
@@ -133,6 +133,7 @@ export async function mountRouteEditor(
onOpen: () => ((picked = -1), syncCurveBar()),
measuring: () => measureControls.mode(), // 켠 동안 재기 = D03 재기 겹(755-2)
onHistory: () => historyControls.sync(), // 켠 동안 되돌리기 = 예정노선 판(755-1)
curveCount: () => curveInfo.length, // 수정 전 곡선 수(775-2)
onFollow: (flat, line) => {
const step = { ...flat, apexLock: [], picked: -1, expected: line };
initial.restoreTag(initial.followed(step)); // 지금 추천 = 예상노선 추적(758-1) · 걸음 사진에 실림