chore: resizable-dialog 디버깅 로그 모두 제거

- console.log 20개 주석 처리
- 콘솔 스팸 방지
- 불필요한 로그 제거로 성능 개선
This commit is contained in:
kjs
2025-11-06 12:46:08 +09:00
parent 4affe623a5
commit bc826e8e49

View File

@@ -87,7 +87,7 @@ const ResizableDialogContent = React.forwardRef<
if (!stableIdRef.current) {
if (modalId) {
stableIdRef.current = modalId;
console.log("✅ ResizableDialog - 명시적 modalId 사용:", modalId);
// // console.log("✅ ResizableDialog - 명시적 modalId 사용:", modalId);
} else {
// className 기반 ID 생성
if (className) {
@@ -95,7 +95,7 @@ const ResizableDialogContent = React.forwardRef<
return ((acc << 5) - acc) + char.charCodeAt(0);
}, 0);
stableIdRef.current = `modal-${Math.abs(hash).toString(36)}`;
console.log("🔄 ResizableDialog - className 기반 ID 생성:", {
// console.log("🔄 ResizableDialog - className 기반 ID 생성:", {
className,
generatedId: stableIdRef.current,
});
@@ -106,14 +106,14 @@ const ResizableDialogContent = React.forwardRef<
return ((acc << 5) - acc) + char.charCodeAt(0);
}, 0);
stableIdRef.current = `modal-${Math.abs(hash).toString(36)}`;
console.log("🔄 ResizableDialog - userStyle 기반 ID 생성:", {
// console.log("🔄 ResizableDialog - userStyle 기반 ID 생성:", {
userStyle,
generatedId: stableIdRef.current,
});
} else {
// 기본 ID
stableIdRef.current = 'modal-default';
console.log("⚠️ ResizableDialog - 기본 ID 사용 (모든 모달이 같은 크기 공유)");
// console.log("⚠️ ResizableDialog - 기본 ID 사용 (모든 모달이 같은 크기 공유)");
}
}
}
@@ -171,7 +171,7 @@ const ResizableDialogContent = React.forwardRef<
const [wasOpen, setWasOpen] = React.useState(false);
React.useEffect(() => {
console.log("🔍 모달 상태 변화 감지:", {
// console.log("🔍 모달 상태 변화 감지:", {
actualOpen,
wasOpen,
externalOpen,
@@ -181,12 +181,12 @@ const ResizableDialogContent = React.forwardRef<
if (actualOpen && !wasOpen) {
// 모달이 방금 열림
console.log("🔓 모달 열림 감지, 초기화 리셋:", { effectiveModalId });
// console.log("🔓 모달 열림 감지, 초기화 리셋:", { effectiveModalId });
setIsInitialized(false);
setWasOpen(true);
} else if (!actualOpen && wasOpen) {
// 모달이 방금 닫힘
console.log("🔒 모달 닫힘 감지:", { effectiveModalId });
// console.log("🔒 모달 닫힘 감지:", { effectiveModalId });
setWasOpen(false);
}
}, [actualOpen, wasOpen, effectiveModalId, externalOpen, context.open]);
@@ -194,7 +194,7 @@ const ResizableDialogContent = React.forwardRef<
// modalId가 변경되면 초기화 리셋 (다른 모달이 열린 경우)
React.useEffect(() => {
if (effectiveModalId !== lastModalId) {
console.log("🔄 모달 ID 변경 감지, 초기화 리셋:", {
// console.log("🔄 모달 ID 변경 감지, 초기화 리셋:", {
이전: lastModalId,
현재: effectiveModalId,
isInitialized,
@@ -207,7 +207,7 @@ const ResizableDialogContent = React.forwardRef<
// 모달이 열릴 때 초기 크기 설정 (localStorage와 내용 크기 중 큰 값 사용)
React.useEffect(() => {
console.log("🔍 초기 크기 설정 useEffect 실행:", {
// console.log("🔍 초기 크기 설정 useEffect 실행:", {
isInitialized,
hasContentRef: !!contentRef.current,
effectiveModalId,
@@ -231,7 +231,7 @@ const ResizableDialogContent = React.forwardRef<
contentWidth = contentRef.current.scrollWidth || defaultWidth;
contentHeight = contentRef.current.scrollHeight || defaultHeight;
console.log("📏 모달 내용 크기 측정:", {
// console.log("📏 모달 내용 크기 측정:", {
attempt: attempts,
scrollWidth: contentRef.current.scrollWidth,
scrollHeight: contentRef.current.scrollHeight,
@@ -241,7 +241,7 @@ const ResizableDialogContent = React.forwardRef<
contentHeight,
});
} else {
console.log("⚠️ contentRef 없음, 재시도:", {
// console.log("⚠️ contentRef 없음, 재시도:", {
attempt: attempts,
maxAttempts,
defaultWidth,
@@ -265,7 +265,7 @@ const ResizableDialogContent = React.forwardRef<
height: Math.max(minHeight, Math.min(maxHeight, Math.max(contentHeight + paddingAndMargin, initialSize.height))),
};
console.log("📐 내용 기반 크기:", contentBasedSize);
// console.log("📐 내용 기반 크기:", contentBasedSize);
// localStorage에서 저장된 크기 확인
let finalSize = contentBasedSize;
@@ -275,7 +275,7 @@ const ResizableDialogContent = React.forwardRef<
const storageKey = `modal_size_${effectiveModalId}_${userId}`;
const saved = localStorage.getItem(storageKey);
console.log("📦 localStorage 확인:", {
// console.log("📦 localStorage 확인:", {
effectiveModalId,
userId,
storageKey,
@@ -292,27 +292,27 @@ const ResizableDialogContent = React.forwardRef<
height: Math.max(minHeight, Math.min(maxHeight, parsed.height)),
};
console.log("💾 사용자가 리사이징한 크기 복원:", savedSize);
// console.log("💾 사용자가 리사이징한 크기 복원:", savedSize);
// ✅ 중요: 사용자가 명시적으로 리사이징한 경우, 사용자 크기를 우선 사용
// (사용자가 의도적으로 작게 만든 것을 존중)
finalSize = savedSize;
setUserResized(true);
console.log("✅ 최종 크기 (사용자가 설정한 크기 우선 적용):", {
// console.log("✅ 최종 크기 (사용자가 설정한 크기 우선 적용):", {
savedSize,
contentBasedSize,
finalSize,
note: "사용자가 리사이징한 크기를 그대로 사용합니다",
});
} else {
console.log(" 자동 계산된 크기는 무시, 내용 크기 사용");
// console.log(" 자동 계산된 크기는 무시, 내용 크기 사용");
}
} else {
console.log(" localStorage에 저장된 크기 없음, 내용 크기 사용");
// console.log(" localStorage에 저장된 크기 없음, 내용 크기 사용");
}
} catch (error) {
console.error("❌ 모달 크기 복원 실패:", error);
// console.error("❌ 모달 크기 복원 실패:", error);
}
}
@@ -384,7 +384,7 @@ const ResizableDialogContent = React.forwardRef<
userResized: true, // 사용자가 직접 리사이징했음을 표시
};
localStorage.setItem(storageKey, JSON.stringify(currentSize));
console.log("💾 localStorage에 크기 저장 (사용자 리사이징):", {
// console.log("💾 localStorage에 크기 저장 (사용자 리사이징):", {
effectiveModalId,
userId,
storageKey,
@@ -392,7 +392,7 @@ const ResizableDialogContent = React.forwardRef<
stateSize: { width: size.width, height: size.height },
});
} catch (error) {
console.error("❌ 모달 크기 저장 실패:", error);
// console.error("❌ 모달 크기 저장 실패:", error);
}
}
};