From d9cc66b5e9f2bf8381cc157222a4706bb31fb190 Mon Sep 17 00:00:00 2001 From: umsangdon Date: Fri, 16 Oct 2026 01:03:02 +0900 Subject: [PATCH] =?UTF-8?q?fix(CAD):=20339=20=EB=8D=A7=EA=B3=A0=EC=B9=A8?= =?UTF-8?q?=20=E2=80=94=20CAD=20=EC=8B=9C=EC=9E=91=20=EC=83=81=ED=83=9C?= =?UTF-8?q?=EB=A5=BC=20=E3=80=8C=EB=AA=85=EB=A0=B9:=E3=80=8D=20=EC=89=BC(?= =?UTF-8?q?=EC=84=A0=ED=83=9D=20=EB=8F=84=EA=B5=AC)=EC=9C=BC=EB=A1=9C=20?= =?UTF-8?q?=C2=B7=20=EC=84=A0=20=EB=AA=85=EB=A0=B9=EC=9C=BC=EB=A1=9C=20?= =?UTF-8?q?=EC=8B=9C=EC=9E=91=ED=95=98=EB=8D=98=20=EA=B2=83=20=EA=B3=A0?= =?UTF-8?q?=EC=B9=A8=20=C2=B7=20=EC=8B=9C=EC=9E=91=20=EB=8F=84=EA=B5=AC=20?= =?UTF-8?q?=EC=8B=9C=ED=97=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01QfHKQs7J3hQELKMWQMUJEy --- B07_DesignDetail/openwebcad/src/main.tsx | 5 ++--- resources/tester/cad/prompt-frame.test.ts | 20 ++++++++++++++++++++ 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/B07_DesignDetail/openwebcad/src/main.tsx b/B07_DesignDetail/openwebcad/src/main.tsx index abf4f4d7b..9e4b392d7 100644 --- a/B07_DesignDetail/openwebcad/src/main.tsx +++ b/B07_DesignDetail/openwebcad/src/main.tsx @@ -174,9 +174,8 @@ function initApplication() { startDrawLoop(screenCanvasDrawController, 0); - const lineToolActor = new Actor(TOOL_STATE_MACHINES[Tool.LINE]); - lineToolActor.start(); - setActiveToolActor(lineToolActor); + // 오토캐드처럼 「명령:」 쉼(선택 도구)으로 시작 + setActiveToolActor(new Actor(TOOL_STATE_MACHINES[Tool.SELECT])); } } diff --git a/resources/tester/cad/prompt-frame.test.ts b/resources/tester/cad/prompt-frame.test.ts index 986366abc..e5005bf8b 100644 --- a/resources/tester/cad/prompt-frame.test.ts +++ b/resources/tester/cad/prompt-frame.test.ts @@ -3,6 +3,7 @@ * 설계 `docs/raw/조사/2026-10-15_337_CAD오토캐드조작_설계.md` 2 장 · 6-3 가 줄. * 실행: cd B07_DesignDetail/openwebcad && npx vitest run --dir ../../resources/tester/cad prompt-frame */ +import { readFileSync } from "node:fs"; import { beforeEach, describe, expect, it, vi } from "vitest"; vi.mock("react-toastify", () => ({ @@ -21,6 +22,7 @@ import { remember, renderPrompt, } from "../../../B07_DesignDetail/openwebcad/src/commands/prompt"; +import { TOOL_STATE_MACHINES } from "../../../B07_DesignDetail/openwebcad/src/commands/registry"; import { getLastCommandId, runCommandInput, @@ -418,6 +420,24 @@ describe("엔진 v2 — loopFrom · when · mode · next · escCommits · undo }); describe("쉼 · 명령 이름 · 별칭(2-5 ⑨ · 2-17 · N18)", () => { + it("앱 시작 = 쉼(선택 도구) — main.tsx 가 켜는 도구 · 「l ⏎」 = 첫 번째 점 지정", () => { + const main = readFileSync( + new URL("../../../B07_DesignDetail/openwebcad/src/main.tsx", import.meta.url), + "utf8", + ); + const started = [...main.matchAll(/TOOL_STATE_MACHINES\[Tool\.(\w+)\]/g)].map((m) => m[1]); + expect(started).toEqual(["SELECT"]); + start(TOOL_STATE_MACHINES[Tool.SELECT]); + expect(activeTool()).toBe(Tool.SELECT); + const idle = promptLine(); + expect(idle).not.toBe("첫 번째 점 지정:"); + typeEnter("l"); + expect(activeTool()).toBe(Tool.LINE); + expect(promptLine()).toBe("첫 번째 점 지정:"); + key("Escape"); + expect(promptLine()).toBe(idle); + }); + it("딱 맞음만 — R · LE · CIR · SE = 알 수 없는 명령 · l = LINE · ed = TEXTEDIT", () => { for (const text of ["r", "le", "cir", "se"]) { type(text);