From fcc35c73f448cb66570e56ce265edc91fa16e89d Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Thu, 12 Nov 2026 18:38:29 +0900 Subject: [PATCH] =?UTF-8?q?fix(studio):=20=ED=99=88=20=ED=8F=AC=EC=BB=A4?= =?UTF-8?q?=EC=8A=A4=20=ED=8E=B8=EC=A7=91=EA=B8=B0=EA=B0=80=20=EC=9E=90?= =?UTF-8?q?=EA=B8=B0=20=EC=B4=88=EA=B8=B0=ED=99=94=EB=A5=BC=20=EB=81=9D?= =?UTF-8?q?=EC=97=86=EC=9D=B4=20=EB=B0=98=EB=B3=B5=ED=95=98=EC=A7=80=20?= =?UTF-8?q?=EC=95=8A=EB=8A=94=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Studio 대시보드의 「지금 집중하는 것」(HomeFocusEditor)은 홈 포커스를 읽으면 effect에서 form.reset으로 값을 채운다. effect는 [focus, form.reset]에 걸려 있다. 그런데 useAppForm의 reset은 defaultValues에 의존하고, 이 편집기는 defaultValues를 렌더마다 새 객체 리터럴로 넘긴다. 그래서 포커스가 한 번 읽히면 reset → 상태 갱신 → 다시 렌더 → 새 reset → effect가 끝없이 돈다. 운영(HTTP)에서는 포커스가 있으면 대시보드가 계속 다시 그려진다. 시험 환경에서는 act가 끝나지 않아 시험이 멈춘다. MOCK Studio에서는 지금까지 관리 기능이 HTTP로 나가 실패했기 때문에 포커스가 비어 있었고, 이 경로가 돌지 않았다. 관리 mock(다음 커밋)을 넣자 studio-shell-smoke.test.tsx의 첫 시험이 멈췄다(vitest worker CPU 100%로 19분, FE-GATE-005가 끝나지 않음). defaultValues를 모듈 상수로 둔다. release-editor.tsx가 같은 이유로 EMPTY_RELEASE_DRAFT를 쓰는 방식과 같다. 검증: 관리 mock을 넣은 상태에서 이 수정 전에는 studio-shell-smoke의 첫 시험이 60초 timeout으로 끝나지 않는다. 수정 후 studio-shell-smoke· studio-screens-smoke 8건이 5초에 통과한다. check:types, eslint rc=0. --- .../studio/components/home-focus-editor.tsx | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/features/tech-log/presentation/studio/components/home-focus-editor.tsx b/src/features/tech-log/presentation/studio/components/home-focus-editor.tsx index 107206c..41a16e5 100644 --- a/src/features/tech-log/presentation/studio/components/home-focus-editor.tsx +++ b/src/features/tech-log/presentation/studio/components/home-focus-editor.tsx @@ -39,6 +39,19 @@ const HOME_FOCUS_SCHEMA = z.object({ decisionId: z.string(), }); +/** + * One object for the life of the module. useAppForm's `reset` depends on + * `defaultValues`, and the effect below resets the form when `reset` changes: + * a literal here made a new `reset` every render, so as soon as a home focus + * loaded the editor reset itself, re-rendered and reset again without end. + * release-editor.tsx keeps its defaults the same way (EMPTY_RELEASE_DRAFT). + */ +const EMPTY_HOME_FOCUS = Object.freeze({ + projectId: "", + questionId: "", + decisionId: "", +}); + export function HomeFocusEditor() { const copy = useTechLogCopy(); const { setRequestAnnouncement } = useStudio(); @@ -51,11 +64,7 @@ export function HomeFocusEditor() { const form = useAppForm({ schema: HOME_FOCUS_SCHEMA, - defaultValues: { - projectId: "", - questionId: "", - decisionId: "", - }, + defaultValues: EMPTY_HOME_FOCUS, allowedServerFields: ["projectId", "questionId", "decisionId"] as const, mapToCommand(values) { return {