fix(좌측 카드): 모든 좌측 카드 기본 닫힘 — 공용 카드 · 칸 틀 · 구조물 배치 · B07 묶음 · M02 구조물 집계 양식 (389-3)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QfHKQs7J3hQELKMWQMUJEy
This commit is contained in:
@@ -75,7 +75,7 @@ export function part<T>(ctx: DesignPanelContext, name: string): T {
|
||||
export function createSectionFrame(
|
||||
view: DesignView,
|
||||
title: string,
|
||||
collapsed = false,
|
||||
collapsed = true,
|
||||
): { root: HTMLElement; body: HTMLElement } {
|
||||
const root = document.createElement("section");
|
||||
const heading = document.createElement("h3");
|
||||
|
||||
@@ -76,7 +76,7 @@ export function buildStructuresForm(options: {
|
||||
// b05-structure-section: 이 섹션 안의 입력·버튼 높이를 한 값(--b05-control-h)으로
|
||||
// 묶는 스코프(2026-08-29 사용자 지시 — 조작 컨트롤 높이 통일).
|
||||
root.className =
|
||||
"b05-route__panel-section b05-structure-section ui-collapsible ui-sidebar-section";
|
||||
"b05-route__panel-section b05-structure-section ui-collapsible ui-sidebar-section is-collapsed";
|
||||
const heading = document.createElement("h3");
|
||||
heading.className = "ui-collapsible__title";
|
||||
heading.textContent = "구조물 배치";
|
||||
|
||||
@@ -19,7 +19,7 @@ function shortLabel(label: string, kindName: string): string {
|
||||
export function buildDevelopmentSection(
|
||||
items: DesignDrawingItem[],
|
||||
makeButton: (drawing: DesignDrawingItem, label: string) => HTMLButtonElement,
|
||||
collapsed = false,
|
||||
collapsed = true,
|
||||
): HTMLElement {
|
||||
const section = createPanelCard(`전개도 ${items.length}`, collapsed);
|
||||
section.classList.add("b07-drawing-group");
|
||||
|
||||
@@ -44,9 +44,6 @@ export const DRAWING_GROUPS: readonly {
|
||||
{ label: "전개도", kind: "development" },
|
||||
];
|
||||
|
||||
/** 311 기본 접힘 묶음 — 그 밖 묶음(토적도 등)은 기본 펼침. */
|
||||
const FOLDED_KINDS = new Set(["plan", "longitudinal", "cross"]);
|
||||
|
||||
/** 311 지금 목록의 묶음 접힘(kind → 접힘) — 화면을 다시 세울 때 이어 받음 · B07 목록이 없으면 빈 것. */
|
||||
export function foldedGroups(root: ParentNode): Map<string, boolean> {
|
||||
return new Map(
|
||||
@@ -69,7 +66,7 @@ export function buildDrawingSidePanel(
|
||||
/** 311 다시 세울 때 옛 접힘(`foldedGroups`) — 없는 묶음은 기본값. */
|
||||
folded = new Map<string, boolean>(),
|
||||
): HTMLDivElement {
|
||||
const isFolded = (kind: string): boolean => folded.get(kind) ?? FOLDED_KINDS.has(kind);
|
||||
const isFolded = (kind: string): boolean => folded.get(kind) ?? true; // 389-3 모든 묶음 기본 닫힘
|
||||
const panel = document.createElement("div");
|
||||
panel.className = "b07-drawing-list";
|
||||
const heading = document.createElement("div");
|
||||
|
||||
@@ -257,7 +257,7 @@ export function buildPlanSection(
|
||||
items: DesignDrawingItem[],
|
||||
makeButton: (drawing: DesignDrawingItem, label: string) => HTMLButtonElement,
|
||||
onManage?: () => void,
|
||||
collapsed = false,
|
||||
collapsed = true,
|
||||
): HTMLElement {
|
||||
// 컨테이너 = 좌측 패널 공용 카드(269)
|
||||
const section = createPanelCard(`평면도 ${items.length}`, collapsed);
|
||||
|
||||
@@ -133,13 +133,12 @@ export function buildSide(opt: SideOptions): SideHandle {
|
||||
});
|
||||
return sec;
|
||||
};
|
||||
// 구조물 집계 양식 — 층 단추 · 나무 · 처음부터 펼침(집계표가 열려 있음) ·
|
||||
// 구조물 집계 양식 — 층 단추 · 나무 · 처음엔 닫힘(집계표는 가운데에 그대로 열려 있음) ·
|
||||
// 같은 이름 줄 단추 없음(제목이 그 이름 · 29-6)
|
||||
const summary = section(
|
||||
L("M02_KindTable"),
|
||||
el("div", { className: "m02-side__items ui-sidebar-list", children: opt.tree ?? [] }),
|
||||
);
|
||||
summary.classList.remove("is-collapsed");
|
||||
openOnExpand(summary, async () => {
|
||||
if (!isPicked("table", STRUCTURE_TABLE) && (await opt.confirmLeave())) opt.onOpen(null);
|
||||
});
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
"""311 좌측 패널 기본 접힘 · B07 첫 쪽 = 표지 (요구 204).
|
||||
|
||||
못박는 것
|
||||
- 기본 접힘 = B09 「데이터 점검」 · 「공기 옵션」 / B07 「평면도」 · 「종단도」 · 「횡단도」 /
|
||||
B06 「횡단 보기 설정」 / B05 「계획노선」 · 다른 컨테이너 기본값 그대로.
|
||||
- 기본 접힘(389-3) = 좌측 카드 전부 — B09 「데이터 점검」 · 「공기 옵션」 · 인쇄 둘 / B07 묶음 여섯 /
|
||||
B06 「횡단 보기 설정」 / B05 「페이지 설정」 · 「노선 추천」 · 「구조물 배치」 / B08 · M02 집계 양식.
|
||||
- 쪽 안에서 편 것은 다시 그려도 그대로 — B05 · B06 = 한 벌 패널이 칸을 한 번만 세움 · B07 = 다시 세울 때
|
||||
옛 목록 접힘을 이어 받음 · B09 = 좌측 패널을 쪽 그릴 때 한 번만 세움.
|
||||
- B07 처음 들어가면 표지 — 고른 장 기억(모듈 값 `reopenDrawingId` · `reopenCrossSheet`)이 있으면 그 장.
|
||||
@@ -42,7 +42,7 @@ def out():
|
||||
def test_B05_B06_첫_그림_접힘(out):
|
||||
assert out["profileFirst"] == {
|
||||
"페이지 설정": True,
|
||||
"노선 추천": False, # 345-4 단추 칸 — 펼친 채
|
||||
"노선 추천": True, # 389-3 모든 좌측 카드 기본 닫힘
|
||||
}
|
||||
assert out["crossFirst"]["B06_View_Title"] is True
|
||||
assert out["crossFirst"]["B06_Std_Title"] is True # 옛 기본 접힘 그대로
|
||||
@@ -63,9 +63,9 @@ def test_B07_첫_그림_접힘(out):
|
||||
"plan": True,
|
||||
"longitudinal": True,
|
||||
"cross": True,
|
||||
"mass_haul": False,
|
||||
"structure": False, # 376-2 늘 카드 · 기본 펼침
|
||||
"development": False, # 377 전개도 카드 — 기본 펼침
|
||||
"mass_haul": True,
|
||||
"structure": True, # 389-3 토적도 · 구조물 도면 · 전개도 도 기본 닫힘
|
||||
"development": True,
|
||||
}
|
||||
|
||||
|
||||
@@ -75,8 +75,8 @@ def test_B07_다시_세워도_접힘_이어_받음(out):
|
||||
"longitudinal": True,
|
||||
"cross": False,
|
||||
"mass_haul": True,
|
||||
"structure": False,
|
||||
"development": False,
|
||||
"structure": True,
|
||||
"development": True,
|
||||
}
|
||||
|
||||
|
||||
@@ -109,3 +109,23 @@ def test_B09_기본_접힘_좌측은_한_번만_세움():
|
||||
assert "createPanelCard" not in show and "left." not in show
|
||||
print_page = _read("B09_Estimation/draft/B09_Draft_Print_Page.ts")
|
||||
assert 'createPanelCard("영역")' in print_page and 'createPanelCard("쪽 목록")' in print_page
|
||||
|
||||
|
||||
def test_389_3_공용_카드_기본값_닫힘_그_밖_자리():
|
||||
assert "createPanelCard(title: string, collapsed = true)" in _read(
|
||||
"ui_template/ui_template_collapsible.ts"
|
||||
)
|
||||
assert "collapsed = true,\n): { root: HTMLElement; body: HTMLElement }" in _read(
|
||||
"A00_Common/design/design_panel.ts"
|
||||
).replace("\r\n", "\n")
|
||||
form = _read("B05_Profile/B05_Profile_UI_Structures_Form.ts")
|
||||
assert "ui-collapsible ui-sidebar-section is-collapsed" in form
|
||||
# 우클릭 추가 = 구조물 배치 카드를 폄(116-1) 그대로
|
||||
assert 'root.classList.remove("is-collapsed");' in _read(
|
||||
"B05_Profile/B05_Profile_UI_Structures_Panel.ts"
|
||||
)
|
||||
# M02 구조물 집계 양식도 처음엔 닫힘 — 열림 해제 줄 없음
|
||||
assert 'summary.classList.remove("is-collapsed")' not in _read(
|
||||
"M02_MasterTemplete/M02_MasterTemplete_UI_Side.ts"
|
||||
)
|
||||
assert "FOLDED_KINDS" not in _read("B07_DesignDetail/B07_DesignDetail_UI_Panels.ts")
|
||||
|
||||
@@ -329,10 +329,10 @@ def test_구조물_조합_제목_줄_새_항목():
|
||||
|
||||
|
||||
def test_들어오면_두_컨테이너_펼침_끌기_뒤_강조_지움():
|
||||
"""31-5 — 좌측 「구조물 조합」 펼친 채(일위대가는 그 하위 · 39-2) · 끌어 놓은 뒤 강조(나무 칸
|
||||
자신 = 맨 위 자리 포함)를 모두 지움 · 칸 밖으로 나가면 지움(칸 안 자식 위로는 그대로)."""
|
||||
"""31-5 — 끌어 놓은 뒤 강조(나무 칸 자신 = 맨 위 자리 포함)를 모두 지움 · 칸 밖으로 나가면 지움
|
||||
(칸 안 자식 위로는 그대로) · 389-3 좌측 「구조물 집계 양식」 도 처음엔 닫힘."""
|
||||
side = _text(M02 / "M02_MasterTemplete_UI_Side.ts")
|
||||
assert 'summary.classList.remove("is-collapsed");' in side
|
||||
assert 'summary.classList.remove("is-collapsed");' not in side
|
||||
drag = _text(M02 / "M02_MasterTemplete_TreePanel_Drag.ts")
|
||||
mark = drag.split("const dropMark = ")[1].split("};")[0]
|
||||
assert 'body.classList.remove("is-drop");' in mark
|
||||
|
||||
@@ -11,8 +11,8 @@
|
||||
* 스타일은 전역 `ui_template_theme.css`에 있어 어떤 페이지에서도 클래스만 붙이면 동작한다.
|
||||
* ========================================================================== */
|
||||
|
||||
/** 좌측 패널 컨테이너 공용 카드(269) — 접는 제목 + 공용 양식(`ui-panel-form`) · 내용은 카드에 바로 붙임. */
|
||||
export function createPanelCard(title: string, collapsed = false): HTMLElement {
|
||||
/** 좌측 패널 컨테이너 공용 카드(269) — 접는 제목 + 공용 양식(`ui-panel-form`) · 내용은 카드에 바로 붙임 · 기본 닫힘(389-3). */
|
||||
export function createPanelCard(title: string, collapsed = true): HTMLElement {
|
||||
const section = document.createElement("section");
|
||||
section.className = `ui-collapsible ui-sidebar-section ui-sidebar-card ui-panel-form${collapsed ? " is-collapsed" : ""}`;
|
||||
const heading = document.createElement("h3");
|
||||
|
||||
Reference in New Issue
Block a user