fix(pop): 전수 점검 방어 코드 추가 - resolveModalWidth NaN 방어, connections useMemo, filterTabs 의존성 안정화

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
SeongHyun Kim 2026-02-24 13:05:16 +09:00
parent 1acd9fc3b2
commit 3336384434
3 changed files with 10 additions and 4 deletions

View File

@ -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);

View File

@ -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,
});
// 모달 열기/닫기 이벤트 구독

View File

@ -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(() => {