feat(종단보기): 346-2 덧 2 B05 종단 보기 · 3D 측점선도 갈아끼운 상세로 — 보일 때만 · 숨었으면 다시 보일 때 · 횡단 보기 없이도

- design_view_profile_sections: 노선마다 상세 갈아끼움을 듣고 종단도 · 표 · 3D 측점선 다시(보일 때만 · 숨으면 flushSwap 이 다시 보일 때) · 가게 stations 도 들어 횡단 보기를 안 열어도 갈아끼움(먼저 부른 쪽만 · 다음은 「같은 목록」)
- design_view_profile: 받는 줄만(보임 · 떠날 때 끊음 · 다시 보일 때 flushSwap)
- 갈아끼움 알림판 B06_Section_Swap_Bus(가져오기 없음 · 돌고 도는 가져오기 막음) — 조정창 값 · 암 경계 옮김을 어느 보기가 갈아끼웠든 한 번 · 횡단 보기는 알림으로 다시 그림
- 시험: 종단 보기 보임 7 → 8 · 숨음 = 안 그림 · 다시 보임 = 6 · 3D 측점선 같은 차례 · 옛 시험 둘(342-1 화면 선 = listedBase · 323-9 열쇠 모듈 진짜로) 맞춤

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QfHKQs7J3hQELKMWQMUJEy
This commit is contained in:
2026-10-16 12:28:11 +09:00
co-authored by Claude Opus 5.5
parent 69d84e5ca9
commit da3dfc1ca8
13 changed files with 168 additions and 39 deletions
@@ -68,6 +68,10 @@ function loadTs(file) {
return box.exports;
}
// 측점 열쇠 한 벌(344-3 · 346-2)은 진짜로 — 빈 대역은 열쇠 목록을 못 냄
STUBS["@util/common_util_station_key"] = loadTs(
path.join(ROOT, "common_util", "common_util_station_key.ts"),
);
const { saveDesign, savingDesign } = loadTs(
path.join(ROOT, "A00_Common", "design", "design_save.ts"),
);
+1
View File
@@ -26,3 +26,4 @@ export { createCrossPreview } from "../../B05_Profile/B05_Profile_UI_Profile_Pre
export { createHaulPlanPrefetch } from "../../B05_Profile/B05_Profile_Api_HaulPlan";
export { createDesignSync } from "../../B06_Section/B06_Section_UI_Page_Design_Sync";
export { writeState } from "../../A00_Common/b_page_state";
export { listedBase } from "../../A00_Common/design/design_profile_base";
+2 -23
View File
@@ -114,29 +114,8 @@ const irregularStations = [
{ id: "pipe-1", station: 4, remainder: 5.05, chainage_m: PIPE, structure: "파형강관 D800" },
];
/* 화면 선 = design_profile.ts 의 진짜 listed() */
const dpSrc = readFileSync(join(ROOT, "A00_Common", "design", "design_profile.ts"), "utf8");
const listedSrc = dpSrc.match(/\r?\n function listed\(\)[\s\S]*?\r?\n \}\r?\n/)[0];
const listedOf = new Function(
"storedBase",
"detail",
"irregularStations",
"oneStationList",
"irregularGraphStations",
"maxChainageOf",
"followMovedNodes",
`${transpile(listedSrc)}\nreturn listed();`,
);
const screenBase = (detail) =>
listedOf(
m.toAlignmentBase(stored),
detail,
irregularStations,
m.oneStationList,
m.irregularGraphStations,
m.maxChainageOf,
m.followMovedNodes,
);
/* 화면 선 = 종단도가 쓰는 진짜 `listedBase`(design_profile_base · 옛 design_profile 안 listed()) */
const screenBase = (detail) => m.listedBase(m.toAlignmentBase(stored), detail, irregularStations);
const staleOf = (detail, line) =>
m.staleKey({
longitudinal: { design_profiles: [m.toDesignProfile(line, undefined)] },
@@ -190,6 +190,60 @@ const NEW = (dy) => [
stopListen();
}
/* 2-2. 종단 보기(B05) · 3D 측점선 — 횡단 보기 없이도 가게 측점으로 갈아끼우고 보일 때만 다시 그림 */
{
const R2 = 11;
m.writeState("section-detail", oldDetail(), P, R2);
const renders = [];
const lines = [];
let shown = true;
const sections = m.createProfileSections({
projectId: P,
state: {
confirmedSurface: null,
latest: { route_points: [] },
roadWidths: { g: 5 },
detail: null,
corridorVisible: false,
corridorPending: false,
routeReady: true,
restoring: false,
},
viewer: { renderStationLines: (list) => lines.push(list.length), markers: {} },
panel: () => ({
values: () => ({ gradeClass: "g", stationInterval: 20, enforcePipeClearance: false }),
gradeLimitPct: () => 12,
stationDisplayOffset: () => ({ station: 0, cumulative: 0 }),
setCorridorPending: () => undefined,
}),
profilePanel: () => ({
render: (detail) => renders.push(detail.cross_sections.length),
setGradeLimit: () => undefined,
setEnforceMinCover: () => undefined,
setStationDisplay: () => undefined,
setIrregularStations: () => undefined,
alignmentSamples: () => null,
setLoading: () => undefined,
clear: () => undefined,
}),
bridge: () => ({ irregularStations: () => [] }),
visible: () => shown,
});
await sections.restoreSections(R2);
const shop = m.useDesignStore(P, null);
shop.set("stations", NEW(0)); // 보임 — 바로 다시
await new Promise((resolve) => setTimeout(resolve, 30));
const afterShown = [...renders];
shown = false;
shop.set("stations", NEW(0).slice(0, 6)); // 숨음 — 안 그림
await new Promise((resolve) => setTimeout(resolve, 30));
const whileHidden = [...renders];
shown = true;
sections.flushSwap(); // 다시 보임
out.profile = { afterShown, whileHidden, afterShow: [...renders], lines: lines.length };
sections.stopSwap();
}
/* 3. 보이는 카드 먼저 — 바로 그릴 수 */
out.eager = [
m.eagerCardCount({ clientHeight: 600, scrollTop: 0 }, 3, 250, 12),
@@ -23,3 +23,4 @@ export {
} from "../../B06_Section/B06_Section_UI_Page_Link_Session";
export { useDesignStore } from "../../A00_Common/design/design_store";
export { readState, writeState } from "../../A00_Common/b_page_state";
export { createProfileSections } from "../../A00_Common/design/design_view_profile_sections";
@@ -7,6 +7,7 @@
- 가게 `stations` → 캐시 상세 갈아끼움 · 듣는 쪽에 새 상세 + 누가거리 옮김 ·
카드 선택은 측점 열쇠로 새 자리(관 45.054 → 47 m) · 노선 모양이 바뀌면 넘김 규칙
(단면 유형 버림) · 사라진 측점 고침 버림 · 조정창 값도 옮긴 자리로.
- 종단 보기(B05) · 3D 측점선 — 횡단 보기를 안 열어도 가게 측점으로 갈아끼움 · 보일 때만 다시 그림.
- 보이는 카드 먼저 — 보이는 줄 + 한 줄만 바로.
- `formatStation` ↔ 파이썬 `format_station` 같은 글.
@@ -116,6 +117,14 @@ def test_가게_측점으로_상세_갈아끼움_열쇠로_이어_받기(out):
assert store["again"] is True # 같은 목록 = 안 갈아끼움
def test_종단_보기_3D_측점선도_새_목록_보일_때만(out):
profile = out["profile"]
assert profile["afterShown"] == [7, 8] # 처음 7 → 가게 측점으로 갈아끼움 8(횡단 보기 없이)
assert profile["whileHidden"] == [7, 8] # 숨은 동안은 안 그림
assert profile["afterShow"] == [7, 8, 6] # 다시 보일 때 새 목록(6)
assert profile["lines"] == 3 # 3D 측점선도 같은 차례로 다시
def test_보이는_카드_먼저(out):
assert out["eager"] == [12, 27, 4] # 3열 · 600 px · (250+12) px 줄 = 3 줄 + 1
assert out["rename"] == {"47.00": 1, "b47.00": 2, "47.00:outlet": 3, "60.00": 4}