fix(M01): 흐름도 패널 글 · 왼쪽 고침 → 오른쪽 따라감 · 시험판 길 지움

- 패널 위 글 「이 로직의 계산 방법을 흐름도로 보여 줌」(「옛 식」 · 「정본」 말 지움)
- 왼쪽 편집기로 고친 뒤 잠시 쉬면 고친 줄을 서버 변환(POST /api/m01/logic/flow {file, key, row})으로 다시 받아 오른쪽에 넣음 · 마지막 물음만 받음 · 길이 아직 없으면 아무 일 없음
- 다른 로직 받기에서 흐름도 시험판(DF-) cfGet 길 지움

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016PSXsvyDxjNmufteN5bqmt
This commit is contained in:
2026-10-02 07:43:09 +09:00
co-authored by Claude Opus 5.5
parent d202a3a6d8
commit 45b614ca55
2 changed files with 51 additions and 10 deletions
@@ -18,8 +18,8 @@ const TEXT = {
New: ["신규 로직", "New logic"],
Waiting: ["흐름도 불러오는 중", "Loading the flow diagram"],
Converted: [
"옛 식을 흐름도로 바꿔 보임 — 저장하면 흐름도가 정본",
"Converted from the old formula — saving makes the flow the master",
"이 로직의 계산 방법을 흐름도로 보여 줌",
"Shows how this logic is calculated as a flow diagram",
],
Failed: ["흐름도를 못 띄움 — {v}", "Couldn't open the flow diagram — {v}"],
} as const;
@@ -122,7 +122,7 @@ export interface FlowAnswer {
notes: string[];
}
/** 마스터 로직의 흐름 — 줄에 흐름이 있으면 그대로 · 없으면 서버가 옛 식을 바꿔 줌 · 길이 없거나 못 받으면 null */
/** 마스터 로직의 흐름 — 줄에 흐름이 있으면 그대로 · 없으면 서버가 계산 방법을 흐름도로 바꿔 줌 · 못 받으면 null */
export async function fetchFlow(key: string, file = ""): Promise<FlowAnswer | null> {
try {
const q = new URLSearchParams({ key, ...(file ? { file } : {}) });
@@ -135,6 +135,27 @@ export async function fetchFlow(key: string, file = ""): Promise<FlowAnswer | nu
}
}
/** 고치는 중인 줄의 흐름 — 왼쪽 편집기로 고친 줄(저장 전)을 서버가 흐름도로 바꿔 줌 · 못 받으면 null */
export async function fetchFlowFor(
row: unknown,
key: string,
file: string,
): Promise<FlowAnswer | null> {
try {
const r = await fetch(`${API_BASE_URL}/m01/logic/flow`, {
method: "POST",
credentials: "include",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ file, key, row }),
});
if (!r.ok) return null;
const got = (await r.json()) as Partial<FlowAnswer>;
return got.flow ? { flow: got.flow, converted: !!got.converted, notes: got.notes ?? [] } : null;
} catch {
return null;
}
}
const loadFlowMods = () =>
Promise.all([
import("../M02_MasterTemplete/DataFlow/M02_DF_Panel"),
@@ -223,9 +244,9 @@ export async function mountLogicFlow(opts: LogicFlowOpts): Promise<LogicFlow> {
let logicSig = "";
let gone = false;
/** 다른 로직 — 흐름도 저장본(DF-) · 마스터 로직(흐름 받기) */
/** 다른 로직 — 마스터 로직(흐름 받기) */
const getLogic = async (key: string): Promise<CfLogic | null> =>
key.startsWith("DF-") ? M.api.cfGet(key) : ((await fetchFlow(key))?.flow ?? null);
(await fetchFlow(key))?.flow ?? null;
const left = (): void => {
const at = opts.leftHost();