feat(M02): 구조물 조합 표 — 머리 이름 고침 = 나무 이름 바꾸기 · 단위 줄 숨김 · 열 폭 자동 · 마지막 분류 칸 강조 · 안내글 없앰 (PLAN 31-1)

- 표 부품 combo 선택(구조물 조합 표만): 단위 줄 · 옛 안내글 없음 · 열 폭 = 머리 이름 · 일위대가 키 · 도번 등 번호가 한 줄에 들게(저장 폭 안 씀 · 번호 줄 줄바꿈 없음) · 고른 열의 가장 깊은 이름 칸 강조(나무에서 고를 때도) · 방향키가 숨은 단위 줄을 안 밟음
- 머리 이름 칸 두 번 누르기 · F2 · Enter → headRenameEdit(가장 깊은 칸 = 항목 · 위 칸 = 폴더) → 나무 editFromTable(메뉴 이름 바꾸기와 같은 길 — 저장 물음 · 같은 이름 막음 안내 · 다시 그림) · 쓸 수 있는 층만
- 시험 test_m02_combo_table 3 · test_m02_combo_screen 머리 잠금 기대값

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KmELpdXFDRZHhfbGuRhSmL
This commit is contained in:
2026-09-30 20:13:18 +09:00
co-authored by Claude Opus 5.5
parent 3913258df9
commit f7c91f2f12
9 changed files with 211 additions and 14 deletions
@@ -33,6 +33,7 @@ import {
getActiveLayer,
readTemplate,
type StructureNumbers,
type TreeEdit,
} from "./M02_MasterTemplete_Api_Fetch";
import {
createItemCards,
@@ -221,6 +222,18 @@ export function comboMerge<T>(stored: unknown, edited: T): T {
} as unknown as T;
}
/** 표 머리 이름 칸 고침 → 나무 이름 바꾸기(PLAN 31-1 · 한 정본 = 나무) — 칸이 항목 이름(가장 깊은 칸)이면
* 항목(열 id 로 부름) · 위 칸이면 그 폴더(머리 앞마디 경로). */
export function headRenameEdit(col: StructureColumn, level: number, name: string): TreeEdit {
const named = (parts: (string | null)[]): string[] =>
parts.filter((p): p is string => !!p && p.trim() !== "");
const path = named(col.머리);
const upto = named(col.머리.slice(0, level + 1));
return upto.length >= path.length
? { op: "rename", 경로: path.slice(0, -1), 키: col.id, 이름: name }
: { op: "rename", 경로: upto, 이름: name };
}
/** 구조물 이름 + 변수값 — 제목행 층을 빈칸으로 이음(빈 층은 건너뜀 · 다 비면 열 id) */
export const columnHead = (col: StructureColumn): string =>
col.머리.filter((part): part is string => !!part && part.trim() !== "").join(" ") || col.id;