feat(M01): 일위대가 로직 기본 보기를 흐름 그림으로 · 상자에서 보고 고치기

방식 C 를 테스트 컨테이너에서 꺼내 로직 화면 기본 보기로 올림(옛 호표 표는 「고급」).
상자를 누르면 값·출처에 더해 쉬운 말 풀이와 원문 표 미리보기(걸린 줄 강조)가 펼쳐짐.
자체 로직은 [고치기] 로 상자 안에서 고치고 줄을 더하거나 지움 — 정본은 「본떠 만들기」 뒤.

- UI_Test_C·_Model·_Style → UI_Logic_Flow·_Model·_Style
- UI_Test_Pick 의 재료·기계 바꿔 고르기를 UI_Logic_Pick 에 합침
- 방식 B 의 설명 카드 로직을 UI_Logic_Note 로 옮겨 흐름 그림과 같이 씀

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PAdA5ThqmtVSsbzjusk1cJ
This commit is contained in:
2026-09-21 09:35:33 +09:00
co-authored by Claude Opus 5
parent 2d24cd358e
commit 98e40f4496
13 changed files with 1213 additions and 728 deletions
@@ -69,6 +69,13 @@ const TEXT = {
Pick_Search: ["이름·키·원문번호", "Name · key · source no."],
Pick_Total: ["{n} 개 중 앞 100 개", "first 100 of {n}"],
Pick_Close: ["닫기", "Close"],
Pick_All: ["(전체)", "(All)"],
Mat_Title: ["쓰이는 재료·기계", "Materials and machines"],
Mat_None: ["이 공종은 재료·기계를 따로 고르지 않습니다", "No materials or machines to pick"],
Mat_Default: ["기본 (원문 그대로)", "Default (as in source)"],
Mat_Price: ["단가", "Unit price"],
Mat_NoPrice: ["단가 없음", "No price"],
Enter_Value: ["값을 넣어 주세요", "Enter a value"],
Save_Done: ["저장했음", "Saved"],
Save_Stale: [
"그 사이 파일이 바뀜 — 고친 것을 버리고 다시 여세요: {v}",
@@ -88,10 +95,85 @@ const TEXT = {
"Unsaved logics stay in the draft",
],
New_Key: ["새 로직", "New logic"],
/* ── 흐름 그림(기본 보기) ── */
View_Flow: ["흐름 그림", "Flow"],
View_Advanced: ["고급 — 호표 표", "Advanced — table"],
Flow_NoInputs: ["받을 값 없음", "No inputs"],
Flow_Other: ["그 밖", "Other"],
Flow_Sub: ["이 로직이 부르는 로직", "Logic called here"],
Flow_SubLines: ["호표", "Unit-cost lines"],
Col_입력: ["설계 값", "Design values"],
Col_중간: ["표 찾기", "Table lookup"],
Col_수량: ["수량", "Qty"],
Col_단가: ["× 단가", "× Unit price"],
Col_덧줄: ["할증·덧줄", "Extra lines"],
Col_비목: ["비목 합계", "Cost items"],
Col_계: ["계", "Total"],
Guide_Flow: [
"왼쪽 「설계 값」을 넣으면 오른쪽으로 수량 → 단가 → 합계 순으로 흐름이 이어짐|상자를 누르면 값·출처·원문 표·쉬운 말 풀이가 펼쳐짐|빨간 글이 뜨면 그 까닭 그대로 값을 채우거나 바꿈",
"Enter design values on the left; quantity, price and total follow to the right|Click a box for values, source, the source table and a plain-words reading|Red text says what is missing",
],
/* ── 상자 속 설명 카드 ── */
Note_Plain: ["쉬운 말 풀이", "In plain words"],
Note_Table: ["원문 표 미리보기", "Source table"],
Note_TableMissing: ["{v} 표 못 찾음", "Table {v} not found"],
Note_Searching: ["찾는 중", "Looking up"],
Note_Formula: ["고급 — 식 그대로", "Advanced — raw formula"],
Note_ThisLine: ["이 줄", "This line"],
Use_Of: ["이 표의 용도", "Used for"],
/* ── 상자에서 고치기 ── */
Edit_On: ["고치기", "Edit"],
Edit_Off: ["고치기 끝", "Done"],
Edit_AddHo: ["호표 줄 더하기", "Add unit-cost line"],
Edit_AddInput: ["설계 값 더하기", "Add design value"],
Edit_AddMiddle: ["표 찾기 더하기", "Add table lookup"],
Edit_AddExtra: ["덧줄 더하기", "Add extra line"],
Edit_Qty: ["수량 식", "Qty formula"],
Edit_OwnOnly: [
"정본 로직은 여기서 못 고침 — 「본떠 만들기」 로 내 것을 만든 뒤 고침",
"Master logics are read-only here — use “Copy as mine” first",
],
Edit_Copy: ["본떠 만들기", "Copy as mine"],
Edit_CopySoon: [
"복제 길(API)이 아직 없음 — 서버가 준비되면 여기서 바로 됨",
"The copy API is not ready yet",
],
/* ── 멈춘 까닭을 설계자 말로 ── */
Stop_Missing: [
"「{name}」 값을 아직 안 넣었습니다 — 값을 넣으면 계산됩니다",
"「{name}」 is empty — enter it to calculate",
],
Stop_NoRow: [
"넣은 값에 맞는 표 줄이 없습니다 — 값을 바꿔 보세요",
"No table row fits these values — try other values",
],
Stop_Spec: [
"「{name}」 규격이 여럿이라 정하지 못함 — 위 「쓰이는 재료·기계」에서 하나를 골라 주세요",
"「{name}」 has several specs — pick one in the materials list above",
],
Stop_NoPrice: [
"「{name}」 단가가 자료에 비어 있어 셈하지 못함 — 자료를 채워야 함",
"「{name}」 has no price in the data yet",
],
} as const satisfies Record<string, readonly [string, string]>;
export type TextKey = keyof typeof TEXT;
/** 엔진이 멈춘 까닭을 설계자 말로 — 모르는 글은 그대로 */
export function plainReason(reason: string): string {
const missing = /입력 「([^」]+)」 없음/.exec(reason);
if (missing) return tx("Stop_Missing", { name: missing[1] });
if (/맞는 줄 0개/.test(reason)) return tx("Stop_NoRow");
const spec = /「([^」]+)」 후보 여럿/.exec(reason);
if (spec) return tx("Stop_Spec", { name: spec[1] });
const noPrice = /「([^」]+)」 값 없음/.exec(reason);
if (noPrice) return tx("Stop_NoPrice", { name: noPrice[1] });
return reason;
}
/** 흐름 그림 머리 「이렇게 씀」 — 줄 목록 */
export const guideLines = (): string[] => tx("Guide_Flow").split("|");
/** 공용 `t()` 와 같은 뜻 — `{n}`·`{v}` 는 채움 */
export function tx(key: TextKey, fill: Record<string, string | number> = {}): string {
const entry = TEXT[key];