feat(B09): 설계내역서 접히지 않는 트리 — 폴더 줄 수식 · 파일 줄 입력 · 안내선 · 더블클릭 입력 · 고른 줄 상자(235-1)

- 공용 표 editOnDouble — 고칠 칸 = 글 · 더블클릭 · Enter · F2 = 그 칸만 글 상자 · Enter · 초점 떠남 = 입력 끝
- 공용 표 level.tree — ├ └ │ 안내선 + 폴더 · 파일 아이콘(공용 나무와 한 벌 TREE_ICON)
- 설계내역서 — 폴더 줄 금액 = 자손 합 수식 풍선 · 고른 줄 = accent 상자 테두리
- test_235_1 새 시험 · test_228_1 들여쓰기 식 개수 고침

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SE9MxeXTu2uaDZ55BJowAY
This commit is contained in:
2026-10-10 19:09:00 +09:00
co-authored by Claude Opus 5.5
parent 21c1428772
commit 3e70362b14
10 changed files with 580 additions and 27 deletions
@@ -5,7 +5,8 @@
*
* 단추 = 보조 탭 줄 도구 자리(`…_UI_TabBar` setTools) · 안내 글 = 표 아래(202-1)
* 동작 = 줄 우클릭 메뉴(`…_UI_Tabs_Bill_Edit` billMenu)의 같은 항목을 부름 — 메뉴에 없으면 단추 흐림 · 키 안 먹음
* 고른 줄 = 표 줄 누름(키로 기억 · 다시 그려도 남음) · 표시 = 줄 class is-focus(Shell 이 줄 class 곁값으로)
* 고른 줄 = 표 줄 누름(키로 기억 · 다시 그려도 남음) · 표시 = 줄 class is-focus(Shell 이 줄 class 곁값으로) ·
* 꼴 = 줄 전체 상자 테두리(235-1 · 페이지 CSS) · 글 칸도 한 번 누름 = 고름 · 더블클릭 · Enter · F2 = 입력(공용 표)
* 키 = Tab 들여쓰기 · Shift+Tab 내어쓰기 · Alt+↑↓ 옮기기 · Esc 편집 끝(편집 아니면 고름 풂)
* 방향키(204) = → 들여쓰기 · ← 내어쓰기 · ↑↓ 옮기기(같은 메뉴 항목) · 끌기 = `…_Bill_Drag`(놓은 줄 = 고른 줄)
* 글 칸 편집 중 · 초점이 표 · 도구 줄 밖이면 안 먹음 — 줄 누름이 다른 탭으로 가는 줄은 글 칸을 눌러 고름
@@ -26,7 +27,8 @@ const ACTS: [string, string][] = [
];
const GUIDE =
"레벨 — 줄을 누르고 단추 · 방향키 ←→ 레벨 · ↑↓ 옮김(Tab · Shift+Tab · Alt+↑↓ 도) · 줄 끌기";
"레벨 — 줄을 누르고 단추 · 방향키 ←→ 레벨 · ↑↓ 옮김(Tab · Shift+Tab · Alt+↑↓ 도) · 줄 끌기 · " +
"입력 = 더블클릭 · Enter · F2(Esc · Enter = 끝)";
const GUIDE_MORE =
"레벨 = 공종 · 명칭 칸 왼쪽 들여쓰기(레벨마다 한 칸) · 묶음 금액 = 아래 줄 합 · " +
"들여쓰기 = 바로 위 줄 아래로(항목이면 저절로 묶음 · 자식이 다 빠진 묶음 = 다시 항목) · " +
@@ -43,6 +45,8 @@ let live: {
tools: HTMLElement[];
run: (label: string) => void;
sync: () => void;
edit: (index: number) => void;
index: () => number;
} | null = null;
let keysOn = false;
@@ -96,6 +100,12 @@ function listenKeys(): void {
(at as HTMLElement).blur();
return live.root.focus();
}
// Enter · F2 = 고른 줄 입력 시작(235-1) — 도구 단추 위 Enter 는 단추 몫
if ((event.key === "Enter" || event.key === "F2") && !editing(at)) {
if (live.tools.includes(at as HTMLElement) || event.isComposing) return;
event.preventDefault();
return live.edit(live.index());
}
const label = keyAct(event, editing(at));
if (!label) return;
event.preventDefault();
@@ -107,6 +117,7 @@ function listenKeys(): void {
export function levelBar(
root: HTMLElement,
table: BillTable,
edit: (index: number) => void = () => {},
): { tools: HTMLElement[]; guide: HTMLElement } {
const index = (): number =>
picked === null ? -1 : table.rows.findIndex((r) => String(r.key) === picked);
@@ -140,7 +151,7 @@ export function levelBar(
});
attachDrag(root, table, (key) => (picked = key));
sync();
live = { root, tools: buttons, run, sync };
live = { root, tools: buttons, run, sync, edit, index };
listenKeys();
return { tools: buttons, guide };
}