fix(B05·B06 한 페이지): 횡단 다시 셈 뒤 좌측 시설 폼 자동 칸 다시 그림 — 관 옮긴 뒤 관 길이 = B06 카드 (416-1)

- design_shared crossDesignsUpdated 한 곳 — 두 보기 알림 + 좌측 시설 폼 recount(관 길이 · 흙막이 수)
- 관을 옮긴 순간 셈한 옛 길이(6.9)가 횡단이 늦게 선 뒤에도 남던 것(캐시 6.6 · B06 카드 L=7 m (6.6))
- 시험 test_416_page_cache.py 한 칸 더

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VmC34fsxxbweEG3RUjs3Mn
This commit is contained in:
2026-10-18 12:43:15 +09:00
co-authored by Claude Opus 5.5
parent 9feba3de10
commit 1db2f8f448
2 changed files with 20 additions and 2 deletions
+9 -2
View File
@@ -167,6 +167,13 @@ function toAll<K extends keyof RouteProfilePanelCallbacks>(
)) as NonNullable<RouteProfilePanelCallbacks[K]>;
}
/** 횡단 설계가 다시 셈됨 — 두 보기에 알리고 좌측 시설 폼 자동 칸(관 길이 · 흙막이 수)을 공용 캐시 새 값으로 다시
* 그림(416 · 관을 옮긴 뒤 측점 횡단이 늦게 서도 B05 좌측 = B06 카드). */
function crossDesignsUpdated(shared: DesignPageShared, updated: ReadonlyArray<number>): void {
toAll(shared, "onCrossDesignsUpdated")(updated);
shared.structures?.facility.recount();
}
/** 종단도 한 벌 — 처음 부를 때 만들어 종단도 자리에 붙인다. */
export function sharedProfile(shared: DesignPageShared): DesignProfile {
if (shared.profile) return shared.profile;
@@ -183,7 +190,7 @@ export function sharedProfile(shared: DesignPageShared): DesignProfile {
shared.lastPipes = pipes;
toAll(shared, "onPipesChanged")(pipes);
},
onCrossDesignsUpdated: toAll(shared, "onCrossDesignsUpdated"),
onCrossDesignsUpdated: (updated) => crossDesignsUpdated(shared, updated),
onStructureMove: toView(shared, "onStructureMove"),
onStructureRemove: toView(shared, "onStructureRemove"),
onPipeAdd: toView(shared, "onPipeAdd"),
@@ -227,7 +234,7 @@ function startPagePipeline(shared: DesignPageShared, profile: DesignProfile): vo
if (!detailCross(detail, stations)) return null;
const edits = profile.pipelineSource().edits;
const updated = await refreshCrossDesigns({ projectId, routeId, detail, edits });
if (updated.length) toAll(shared, "onCrossDesignsUpdated")(updated);
if (updated.length) crossDesignsUpdated(shared, updated);
profile.redraw();
return detailCross(detail, stations);
},
+11
View File
@@ -63,6 +63,17 @@ def test_M5_관_길이는_공용_캐시(r):
]
def test_M5_횡단_다시_셈_뒤_좌측_폼_다시_그림():
shared = _read("A00_Common/design/design_shared.ts")
body = shared[shared.index("function crossDesignsUpdated(") :]
body = body[: body.index("\n}\n")]
assert "shared.structures?.facility.recount()" in body
# 종단도 알림 · 저장 노선 다시 셈 두 길 다 이 함수로
assert "onCrossDesignsUpdated: (updated) => crossDesignsUpdated(shared, updated)" in shared
assert "if (updated.length) crossDesignsUpdated(shared, updated);" in shared
assert 'toAll(shared, "onCrossDesignsUpdated")' in body
def test_M1_비운_뒤_두_보기는_새_객체_하나(r):
assert r["m1"] == {
"sameObject": True,