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

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

View File

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