From 3336384434a36ca37e0c389fac9a5875a3569ea4 Mon Sep 17 00:00:00 2001 From: SeongHyun Kim Date: Tue, 24 Feb 2026 13:05:16 +0900 Subject: [PATCH] =?UTF-8?q?fix(pop):=20=EC=A0=84=EC=88=98=20=EC=A0=90?= =?UTF-8?q?=EA=B2=80=20=EB=B0=A9=EC=96=B4=20=EC=BD=94=EB=93=9C=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80=20-=20resolveModalWidth=20NaN=20=EB=B0=A9=EC=96=B4,?= =?UTF-8?q?=20connections=20useMemo,=20filterTabs=20=EC=9D=98=EC=A1=B4?= =?UTF-8?q?=EC=84=B1=20=EC=95=88=EC=A0=95=ED=99=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Cursor --- frontend/components/pop/designer/types/pop-layout.ts | 3 ++- frontend/components/pop/viewer/PopViewerWithModals.tsx | 8 ++++++-- .../pop-components/pop-search/PopSearchComponent.tsx | 3 ++- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/frontend/components/pop/designer/types/pop-layout.ts b/frontend/components/pop/designer/types/pop-layout.ts index 1d862438..15e70c65 100644 --- a/frontend/components/pop/designer/types/pop-layout.ts +++ b/frontend/components/pop/designer/types/pop-layout.ts @@ -442,7 +442,8 @@ export function resolveModalWidth( viewportWidth: number, ): number { const preset = sizeConfig?.modeOverrides?.[mode] ?? sizeConfig?.default ?? "md"; - const presetWidth = MODAL_SIZE_PRESETS[preset].width; + const presetEntry = MODAL_SIZE_PRESETS[preset] ?? MODAL_SIZE_PRESETS.md; + const presetWidth = presetEntry.width; // full이면 뷰포트 전체, 아니면 프리셋과 뷰포트 중 작은 값 if (preset === "full") return viewportWidth; return Math.min(presetWidth, viewportWidth); diff --git a/frontend/components/pop/viewer/PopViewerWithModals.tsx b/frontend/components/pop/viewer/PopViewerWithModals.tsx index e8fb1569..8d6e4227 100644 --- a/frontend/components/pop/viewer/PopViewerWithModals.tsx +++ b/frontend/components/pop/viewer/PopViewerWithModals.tsx @@ -11,7 +11,7 @@ "use client"; -import { useState, useCallback, useEffect } from "react"; +import { useState, useCallback, useEffect, useMemo } from "react"; import { Dialog, DialogContent, @@ -65,9 +65,13 @@ export default function PopViewerWithModals({ const { subscribe, publish } = usePopEvent(screenId); // 연결 해석기: layout에 정의된 connections를 이벤트 라우팅으로 변환 + const stableConnections = useMemo( + () => layout.dataFlow?.connections ?? [], + [layout.dataFlow?.connections] + ); useConnectionResolver({ screenId, - connections: layout.dataFlow?.connections || [], + connections: stableConnections, }); // 모달 열기/닫기 이벤트 구독 diff --git a/frontend/lib/registry/pop-components/pop-search/PopSearchComponent.tsx b/frontend/lib/registry/pop-components/pop-search/PopSearchComponent.tsx index e1a33021..380cc103 100644 --- a/frontend/lib/registry/pop-components/pop-search/PopSearchComponent.tsx +++ b/frontend/lib/registry/pop-components/pop-search/PopSearchComponent.tsx @@ -407,7 +407,8 @@ function ModalDialog({ open, onOpenChange, modalConfig, title, onSelect }: Modal setActiveFilterTab(hasFilterTabs ? filterTabs![0] : null); fetchData(); } - }, [open, fetchData, hasFilterTabs, filterTabs]); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [open, fetchData, hasFilterTabs]); // 필터링된 행 계산 const filteredRows = useMemo(() => {