feat(m01-easycalc): Pick 오류를 쉬운 말로 · 목록 100줄 제한 · PLAN 34-3b Pick 검증완료

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019ACSGaHdLgnkEkoA4LDtMU
This commit is contained in:
2026-10-01 09:46:44 +09:00
co-authored by Claude Sonnet 5.5
parent 7bfb2d76bb
commit f9ac244b63
+14 -7
View File
@@ -16,7 +16,7 @@ import {
import { openModal } from "@ui/ui_template_modal";
import { fetchPick, fetchSubs, type SubInfo } from "../M01_MasterData_Api_Fetch";
import { fetchMaterials } from "../M01_MasterData_UI_Logic_Api";
import { listEasy, listMachines, machineElement } from "./M01_EasyCalc_Api";
import { listEasy, listMachines, machineElement, plainError } from "./M01_EasyCalc_Api";
import type { PickResult } from "./M01_EasyCalc_Model";
import "./M01_EasyCalc_Pick.css";
@@ -64,6 +64,8 @@ const te = (key: keyof typeof TEXT, vars: Record<string, string | number> = {}):
);
const won = (n: number): string => Math.round(n).toLocaleString("ko-KR");
/** 목록에 그릴 줄 수 — 더 찾으려면 이름을 쳐서 좁힘 */
const SHOW = 100;
const MAT_FILE = "재료_자재품목.json";
/** 목록 한 줄 — 고르면 PickResult(수량 빼고) 를 만들어 줌 */
@@ -294,16 +296,17 @@ export function openEasyPick(kind?: Kind): Promise<PickResult | null> {
return void list.replaceChildren(
el("p", { className: "m01-easypick__muted", text: te("Hint") }),
);
count.textContent = te("Count", { n: found.total, m: found.items.length });
const shown = found.items.slice(0, SHOW);
count.textContent = te("Count", { n: found.total, m: shown.length });
list.replaceChildren(
...(found.items.length
? found.items.map((c) =>
...(shown.length
? shown.map((c) =>
rowOf(c, () => stepQty(k, c, back ? () => stepList(k, canBack) : null)),
)
: [el("p", { className: "m01-easypick__muted", text: te("None") })]),
);
} catch {
if (mine === seq) showToast(te("Failed"), "error");
} catch (e) {
if (mine === seq) showToast(plainError(e), "error");
}
};
if (src.grouped) bar.unshift(...subFilters(filter, load));
@@ -348,7 +351,11 @@ export function openEasyPick(kind?: Kind): Promise<PickResult | null> {
const submit = async (): Promise<void> => {
const n = parse();
if (n === null) return qty.setError(te("QtyBad"));
done({ ...(await c.make()), qty: n });
try {
done({ ...(await c.make()), qty: n });
} catch (e) {
qty.setError(plainError(e));
}
};
qty.input.addEventListener("input", refresh);
qty.input.addEventListener("keydown", (ev) => ev.key === "Enter" && void submit());