fix(pop): 전수 점검 방어 코드 추가 - resolveModalWidth NaN 방어, connections useMemo, filterTabs 의존성 안정화
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
1acd9fc3b2
commit
3336384434
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
});
|
||||
|
||||
// 모달 열기/닫기 이벤트 구독
|
||||
|
|
|
|||
|
|
@ -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(() => {
|
||||
|
|
|
|||
Loading…
Reference in New Issue