From ca5485b208f4d47f7ff85bd32c071d19ee039427 Mon Sep 17 00:00:00 2001 From: umsangdon Date: Fri, 16 Oct 2026 01:13:13 +0900 Subject: [PATCH] =?UTF-8?q?fix(M02=20=EC=8B=A4=EB=AC=B4=EC=9E=90=EB=A3=8C)?= =?UTF-8?q?:=20339=20=EB=8D=A7=EA=B3=A0=EC=B9=A8=202=20=E2=80=94=20?= =?UTF-8?q?=EB=B3=B8=20=EC=B9=B8=20=ED=98=B8=ED=91=9C=20=EB=AA=A9=EB=A1=9D?= =?UTF-8?q?=20=EC=A0=9C=EC=95=88=20=EC=88=98=20=C2=B7=20=EC=85=88=20?= =?UTF-8?q?=EC=A4=91=20=ED=91=9C=EC=8B=9C=20=EC=85=88=20=EB=81=9D=EA=B9=8C?= =?UTF-8?q?=EC=A7=80=20=EB=8B=A4=EC=8B=9C=20=EC=9D=BD=EC=9D=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 본 칸 호표 표: 뒤 숫자 판정 셈 중이면 3 초마다 다시 읽어 「제안 n / 줄 m」 · 호표 줄 갱신(찾기 글 그대로) - 머리 줄 「숫자 판정 셈 중 n/m」 표시 · 셈 끝 · 호표 하나로 감 · 못 읽음이면 멈춤 Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01XWh5wNNycMkbwMpACz1rte --- .../M02_MasterTemplete_Hopyo_View.ts | 34 +++++++++++++++++-- resources/tester/test_m02_hopyo_screen.py | 11 ++++++ 2 files changed, 42 insertions(+), 3 deletions(-) diff --git a/M02_MasterTemplete/M02_MasterTemplete_Hopyo_View.ts b/M02_MasterTemplete/M02_MasterTemplete_Hopyo_View.ts index b7f58f5e4..433c83713 100644 --- a/M02_MasterTemplete/M02_MasterTemplete_Hopyo_View.ts +++ b/M02_MasterTemplete/M02_MasterTemplete_Hopyo_View.ts @@ -14,7 +14,7 @@ import { type HopyoScope, type HopyoView, } from "./M02_MasterTemplete_Hopyo_Api"; -import { buildHopyoCheck } from "./M02_MasterTemplete_Hopyo_Check"; +import { buildHopyoCheck, POLL_MS } from "./M02_MasterTemplete_Hopyo_Check"; import type { HopyoSheetOptions } from "./M02_MasterTemplete_Hopyo_Sheet"; import "./M02_MasterTemplete_Hopyo.css"; @@ -79,6 +79,7 @@ export function buildHopyoView(key: string, opt: HopyoViewOptions): HTMLElement () => void drawFile(), ); if (!file) return; + let hopyos = file.호표; const search = el("input", { className: "ui-input ui-input--sm m02-hopyo__search", attrs: { type: "search", placeholder: "호표 · 품명 · 규격 찾기", value: query }, @@ -88,7 +89,7 @@ export function buildHopyoView(key: string, opt: HopyoViewOptions): HTMLElement const q = search.value.trim().toLowerCase(); query = search.value; body.replaceChildren( - ...file.호표 + ...hopyos .filter((h) => !q || `제${h.번}호표 ${h.이름} ${h.규격}`.toLowerCase().includes(q)) .map((h) => { const tr = el("tr", { @@ -110,6 +111,32 @@ export function buildHopyoView(key: string, opt: HopyoViewOptions): HTMLElement }; search.addEventListener("input", paint); paint(); + // 뒤 숫자 판정 셈 중이면 3 초마다 다시 읽어 「제안 n / 줄 m」 갱신 — 셈 끝 · 다른 화면 · 못 읽음이면 멈춤 + const ready = note(""); + const calc = note(""); + const show = (f: HopyoView): void => { + ready.textContent = `제안 ${f.맞춤[0]} / 줄 ${f.맞춤[1]}`; + const c = f.셈 && !f.셈.끝 ? f.셈 : null; + calc.textContent = c + ? `숫자 판정 셈 중 ${c.한}/${c.모두 ?? "?"}${c.까닭 ? ` · ${c.까닭}` : ""}` + : ""; + calc.hidden = !c; + }; + const my = nav; + const live = (): boolean => my === nav && view.isConnected; + const poll = (f: HopyoView): void => { + if (!f.셈 || f.셈.끝) return; + window.setTimeout(async () => { + const next = live() ? await readHopyo(opt.scope, key).catch(() => null) : null; + if (!next || !live()) return; + hopyos = next.호표; + show(next); + paint(); + poll(next); + }, POLL_MS); + }; + show(file); + poll(file); const wrong = file.검산.어긋남; view.replaceChildren( el("div", { @@ -119,7 +146,8 @@ export function buildHopyoView(key: string, opt: HopyoViewOptions): HTMLElement note(`시트 ${file.시트}`), note(`호표 ${file.호표수}`), note(wrong.length ? `검산 어긋남 ${wrong.length}` : "검산 맞음"), - note(`제안 ${file.맞춤[0]} / 줄 ${file.맞춤[1]}`), + ready, + calc, createButton({ label: "엑셀로 보기", size: "sm", diff --git a/resources/tester/test_m02_hopyo_screen.py b/resources/tester/test_m02_hopyo_screen.py index 978b8e679..99c3c9d5e 100644 --- a/resources/tester/test_m02_hopyo_screen.py +++ b/resources/tester/test_m02_hopyo_screen.py @@ -394,3 +394,14 @@ def test_확인_창_손질_339(): assert "poll(file);" in sheet and "poll(next);" in sheet and "POLL_MS" in sheet assert "if (ok) document.dispatchEvent(new Event(HOPYO_BUILT));" in sheet assert '`맞음 ${tally("맞음")} · 다른 점 ${tally("다른 점")}`' in sheet + + +def test_본_칸_호표_목록_셈_끝까지_다시_읽음_339(): + """339 덧고침 2 — 본 칸 호표 표 「제안 n / 줄 m」 · 머리 「셈 중」 — 셈 중이면 3 초마다 다시 읽음.""" + view = _text("M02_MasterTemplete_Hopyo_View.ts") + assert "poll(file);" in view and "poll(next);" in view and "POLL_MS" in view + assert "hopyos = next.호표;" in view and "...hopyos" in view + assert ( + "const live = (): boolean => my === nav && view.isConnected;" in view + ) # 호표 하나로 가면 멈춤 + assert "숫자 판정 셈 중" in view